390 NUMERICAL METHODS FOR ORDINARY DIFFERENTIAL EQUATIONS
Table
6.14
Numerical example of the Adams method
Error
for
Error
for
X
h =
.125
h =
.0625
Ratio
2.0
2.07E-
5
1.21E-
6
17.1
4.0
2.21E-
6
1.20E-
7
18.3
6.0
3.74E-
7
2.00E-
8
18.7
8.0
l.OOE-
7
5.24E-
9
19.1
10.0
3.58E-
8
1.83E-
9
19.6
which has the solution
Y(x)
=
x/(1
+ x
2
).
The initial values y
1
,
Jl,
y
3
were
taken to be the true values to simplify the example. The solution values were
computed with two values of
h, and the resulting errors
at
a
few
node points are
given in Table 6.14. The column labeled Ratio is the ratio of the error with
h = .125 to that with h =
.0625.
Note that the values of Ratio are near
16,
which
is
the theoretical ratio that would be expected since method {6.7.27)
is
fourth
order.
Variable-order methods At present, the most popular predictor-corrector al-
gorithms control the truncation error by varying both the stepsize and the order
of the method, and all of these algorithms use the Adams
family of formulas. The
first such computer programs that were widely used were DIFSUB from Gear
(1971, pp. 158-166) and codes due to Krogh (1969). Subsequently, other such
variable-order Adams codes were written with
GEAR
from Hindmarsh (1974)
and
DE/STEP
from Shampine and Gordon (1975) among the most popular. The
code
GEAR
has been further improved, to the code LSODE, and
is
a part of a
larger program package called
ODEPACK [see Hindmarsh (1983) for a descrip-
tion]. The code
DE/STEP
has been further improved, to DDEABM, and it is
part
of another general package, called DEPAC [see Shampine and Watts (1980)
for a description]. In all cases, the previously cited codes use error estimation that
is based on the formulas (6.7.23)
or
(6.7.25), although they [and formulas (6.7.22)
and (6.7.26)] may need to be modified for a variable stepsize. The codes vary in a
number
of
important but technical aspects, including the amount of iteration
of
the Adams-Moulton corrector, the form in which past information about deriva-
tive
f
is
carried forward, and the form of interpolation of the solution to the
current output node point. Because of lack of space, and because of the
complexity
of
the issues involved,
we
omit any .further discussion of the compara-
tive differences in these codes. For some further remarks
on
these codes, see
Gupta
et al. (1985, pp. 16-19).
By
allowing the order to vary, there
is
no difficulty in obtaining starting values
for the higher order Adams methods. The programs begin with the second-order
trapezoidal formula with an Euler predictor; the order
is
then generally increased
as extra starting values become available.
If
the solution
is
changing rapidly, then
the program will generally choose a low-order formula, while for a smoother and
more slowly varying solution, the order will usually be larger.