Consider an adaptive Runge Kutta method of order 2 for the initial-value problem:
In our program, rk2adp, we use the second order modified Euler method
together with the third order error monitor (Kutta's method)
where
and
Notice that
and
are used in
the modified Euler method and hence the error monitor requires only one
additional function evaluation. It can be shown that the local error in the
modified Euler method is approximately equal to
We accept the approximation given by modified Euler if
, where T denotes the final value and tol is a
specified absolute error tolerance. Thus the criterion for an acceptable
computed value is
If the computed value is unacceptable we recompute with a new stepsize given
by
where
The Matlab file, rk2adp.m , in zipped form can be downloaded.
Next: Examples
Previous: The Model Problem