public override Cauchy_Point Method(Cauchy_Point cpO, double x1) { double h = x1 - cpO.x, h2 = 0.5 * h, k1, k2, k3, y1, dy1; k1 = h * f(cpO.x, cpO.y); k2 = h * f(cpO.x + h2, cpO.y + h2 * cpO.dy + h * k1 / 8.0); k3 = h * f(cpO.x + h, cpO.y + h * cpO.dy + h2 * k2); dy1 = cpO.dy + (k1 + 4 * k2 + k3) / 6.0; y1 = cpO.y + h * (cpO.dy + (k1 + 2 * k2) / 6.0); return(new Cauchy_Point(x1, y1, dy1)); }
abstract public Cauchy_Point Method(Cauchy_Point cpO, double x1);
public MAC_ODE_Order_2_RungeKutta_4_B (Cauchy_Point cauchy_point, Func <double, double, double> f) : base(cauchy_point) { this.f = f; }
public MAC_ODE_Order_2(Cauchy_Point cauchy_point) { CPO = new Cauchy_Point(cauchy_point); }