Runge Kutta Verfahren 2010-01-20 21:53:13 public class RungeKutta { public static double f(double x, double y) { return (1.0/4.0) * (x*x + y*y); } public static void main(String[] args) { double h, x, y, y0, y1, yA, yB, yC; h = 0.01; x = 0; y = 0; double bis = 2.0; while(x < bis) { y0 = f(x, y); yA = f(x + h/2.0, y + h/2.0 * y0); yB = f(x + h/2.0, y + h/2.0 * yA); yC = f(x + h, y + h * yB); y1 = y + h * (1.0/6.0) * (y0 + 2.0 * (yA + yB) + yC); y = y1; x = x + h; System.out.println("y("+ x +"): " + y); } } }