Now we revert to a ``Taylor series'' interpretation of problem (see 0.1.3). We consider in some detail the EXPLICIT CASE and will make only cursory comments on the IMPLICIT Runge-Kutta methods. RK are single-step methods and can be either explicit or implicit. Later we'll consider multi-step methods.
Perhaps the most popular ODE integrator around, because it is explicit,
easily programmable, of high order, and applicable to even mildly stiff
problems:
-order ERK (Explicit Runge
Kutta) or ERK4. The
order
is known as
Heun's Method and is also popular but used less often.
All ERK's are written as
To illustrate general procedure: ERK2 ``Heun's Method''
![]() |
so substitute in (36)
![]() |
with![]() |
i.e.
![]() | |||
![]() | |||
![]() |
Take simple case, with
. Assume
smooth, for simplicity,
![]() |
from
| 0 | ||
| 0 |
| 0 | ||
| 0 | ||
``RK Tableaux''
3-Stage Examples (both are 3
order)
``Classical''
| 0 | |||
| 0 | |||
| 0 | |||
4-Stage (fourth-order)
| 0 | ||||
| 0 | ||||
| 0 | 0 | |||
Compare to
with![]() |
| Max stages | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| Max order | 1 | 2 | 3 | 4 | 4 | 5 | 6 | 6 |
Not worth it usually if number of stages is much greater than max order.
IMPLICIT RK(IRK): We won't study in detail. Complicated. Used in stiff equation solutions because they exhibit superior stability properties.
Generally:
by conventionFor references see J.C. Butcher ``The Numerical Anaylsis of ODE'S,'' John Wiley Publ. (He's one of the world's experts).
RK-FEHLBERG (RKF)
This is an adaptive step size
method which illustrates how error control can be incorporated into
RK. The technique is not only applicable to RK, though. It is based on
an idea similar to
Richardson extrapolation
The idea is to adapt the step size to control the error
and ensure error is kept within a (reasonable) specified bound,
. It is an example of a scheme that incorporates ``error
control''.
Most popular
General strategy:
Take
For presentation purposes we will assume that the schemes under
consideration are explicit, single step and that the scheme for
has a truncation error
Assume the scheme is of the form
Use another scheme with
Take
Assume that
, i.e. assume that the schemes
and
are convergent. The if we subtract
but
and
hence the major error contribution
The idea is to adjust the step size to stay within a certain error bound.
Since
You
might be wondering about the fact that in the above expression
and
appear and these are quantities that are sought
after. What's done algorithmically is not unique: one possibility is to
take a step and produce some proxi
and
. Make the
estimate as per above equation, and if it is not satisfied, reduce
till it is. Then do the real time step.
Note, also, that on implementation, it is possible for the above
condition not to be satisfied (either because you chose an
that is unreasonable small, or because the method should not be applied
to the IVP in the first place). Hence, an escape sequence should be
supplied in the algorithm so that the user gets a warning of the
method's failure.
An implementation of this is ERKF4: use a 5
order RK to
estimate the 4
order RK (there's one for 5
-order
equations as well and it is easily derivable.)
ALGORITHM
INPUT
, initial condition
, TOL,
,
OUTPUT
| Step 1 | ||
| Step 2 | While (FLAG=1) do Step 3-11 | |
| Step 3 |
![]() | |||
![]() | |||
![]() | |||
![]() | |||
![]() | |||
![]() |
Note:
| Step 5 |
|
| Step 6 | if |
| Step 7 | |
![]() |
|
| Step 8 | output
|
| Step 9 | if
|
| else if
|
|
| else set
|
|
| Step 10 | if |
| Step 11 | If |
| else if |
|
| else if |
|
| set FLAG |
|
| output ('minimum |
|
| Step 12 | STOP, END |
Two final remarks are in order:
1) the formal introduction of the method in a schematic way is meant to convey that the trick is general and can be constructed using other schemes, in addition to RK. The overall choice of methods to combine should be dictated by the overall goal: to exploit adaptivity to make the computation more efficient, and to make codes that are more robust and less prone to users' bad choice of time stepping parameters.
2) All too often scientists will try to use adaptivity in step size to
try to circumvent a problematic nature of an IVP. Adaptivity is useful
when the problem exhibits solutions that have periods of high activity,
followed by periods of low activity. It is important that you learn to
recognize the difference between an IVP that is STIFF and one that
merely has periods of heightened activity. It is common for people to
think that one can still use an explicit method with adaptivity to
counteract the stiffness of an IVP. This is not true in general,
although it might work in some circumstances. Adaptivity might force a
method to stay within its stability region, by making
small
enough. It works properly if the stability range gets significantly
smaller and larger as the code steps through the approximate
solution. It does not work, when the code is forced to use a small step
and then is forced to keep such small step for the rest of the
integration interval: you're better off coding something up that is
simpler and more robust and forego adaptivity, since it brings no
benefit. And of course, it goes without saying, that if you choose a
method for which no
value could produce a stable approximation, then
adaptivity is not going to help things...