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.
|Fourth Order Runge-Kutta|