The Initial Value Problem y' = f(x, y); y(c) = d 107
disadvantages of requiring starting values, occasionally being numerically un-
stable, providing no error estimate, and requiring more computer storage than
single-step methods. Predictor-corrector methods provide error estimates at
each step and require only a few function evaluations per step. The amount of
computer storage and the numerical stability of predictor-corrector algorithms
depend upon whether the formulas employed are single-step or multistep.
Many people prefer to use a fourth or higher order single-step method such
as a Runge-Kutta method to numerically solve simple initial value problems
on a one-time basis over a "small" interval. Such a method is usually selected
because it is self-starting and numerically stable but- most usually- because
the user has a better understanding of and confidence in such a method.
However, when a numerical method is to be used to so lve the same or similar
complex initial value problems many times or the solution is to be produced
over a "large" interval, then some form of a multistep, predictor-corrector
method should be chosen. Such a method of solut ion should be selected
because it normally requires less computing time to produce a given accuracy
and because an estimate of the error at each step is b uilt into the method.
In this section , we presented several single-step, multistep, and predictor-
corrector methods for approximating the solution of an initial value problem.
In our examples, we always used a constant stepsize; however, commercially
available software permits the user to specify the initial value problem, the
interval on which it is to be so lved, and an error bound- either absolute or
relative error. If the solut ion values vary by orders of magnitude, t hen it is
more appropriate to specify a relative error bound. It is essential that t he soft-
ware you choose to use have an automatic stepsize selection and error control
routine. In addition, the software should have the following features as well.
If the algorithm is a multistep method, the software should determine the
necessary starting values itself. If the algorithm is a variable-order method,
which Adams and predictor-corrector methods sometimes are, then the algo-
rithm should select and change the order of the method automatically. Also
the software should calculate approximate values of the so lut ion at any set of
points the user chooses rather than just at points selected by the algorithm
during its integration procedure.
2.4.4 Pitfalls of Numerical Methods
!Comments on Computer Software I Most mathematical software packages
which contain algorithms to so lve ordinary differential equations include one
or more routines which attempt to numerically approximate the solution of
t h e initial value problem y' = f(x, y); y(c) = d on the interval [a, b] where
a :::::; c :::::; b. The best way for us to illustrate how to use these programs,
the typical output of the programs, and some of the pitfalls that may occur
when the programs are used is through the following set of examples. We
suggest that you run these examples and compare your results with those
given here. It is very possible that your results will not be exactly the same.