Help: Adaptive Runge-Kutta

This is the ODEINT algorithm from "Numerical Recipes in Pascal" by W.H. Press, B.P. Flannery, S.A. Teukolsky and W.T. Vetterling, Cambridge U. Press, Cambridge 1989 (with a few minor changes). The algorithm uses fourth-order Runge-Kutta together with step doubling and Richardson extrapolation to obtain a fifth-order method. The step size is adjusted to achieve a given error tolerance.

Let Y1 be the result of one fourth-order Runge-Kutta step of step size h starting at (X,Y), and Y2 the result of two fourth-order Runge-Kutta steps of size h/2 starting from the same point. Then we take

Y(X + h) = (16 Y2 - Y1)/15

with local error estimate Y2 - Y1. We adjust h so that

|Y2 - Y1| < p |Y|

where p is the "Error tolerance" as set in the Main window.
Euler
Improved Euler
Fourth Order Runge-Kutta
Difference equation
Main window
Help index