Mathematics Source Library

Prince-Dormand 4&5th Order Ver. 2

Prince-Dormand's 4th and 5th Order Embedded Runge-Kutta Method Version 2

Function List

  • int Embedded_Prince_Dormand_v2_4_5( double (*f)(double, double), double y[ ], double x0, double h, double xmax, double *h_next, double tolerance )

    Solve the differential equation y' = f(x,y) from x0 to xmax with initial condition
    y(x0) = y[0] using the initial step size h. The result at x = xmax is returned in y[1]. Upon returning h_next contains the estimated step size so that the final answer is within tolerance of the actual solution at x = xmax, this value of h_next can be used as the initial step size h in the subsequent call to this function. This function returns a 0 if a solution was found, -1 if a solution could not be found, and -2 if xmax < x0 or if
    h ≤ 0.

C Source Code