// RK4th.java basic step code // RUNGE-KUTTA 4th order step wise integration of // ordinary differential equation, given f1(x,y) = dy/dx f(x,y) // and yStart at xStart, find value of f(x,y) at x=xEnd public class RK4th { public RK4th() // constructor { double k1,k2,k3,k4; double x,y; double xStart, yStart, xEnd, yEnd, h; System.out.println("RK4th.java running"); System.out.println("f(x,y)=(x-1)(x-2)(x-3)(x-4)"); System.out.println("RK4th, enter xStart, yStart, xEnd, h"); xStart=0.0; yStart=24.0; xEnd=5.0; yEnd=0.0; h=0.25; // power of 2 needed for near exact solution System.out.println("xStart= "+xStart); System.out.println("yStart= "+yStart); System.out.println("xEnd= "+xEnd); System.out.println("step size h= "+h); // set initial conditions x=xStart; y=yStart; while(x