Mathematics Source Library
C & ASM

 Home Differential Equations Home Embedded Runge-Kutta Methods Home Fehlberg's 3rd and 4th Order Fehlberg's 4th and 5th Order Fehlberg's 5th and 6th Order Fehlberg's 7th and 8th Order Verner's 5th and 6th Order Verner's 6th and 7th Order Verner's 7th and 8th Order Verner's 8th and 9th Order Prince-Dormand 4&5th Order Ver. 1 Prince-Dormand 4&5th Order Ver. 2 Prince-Dormand 4&5th Order Ver. 3

## Fehlberg's 4th and 5th Order Embedded Runge-Kutta Method

### Function List

• int Embedded_Fehlberg_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.