106 Ordinary Differential Equations
SOLUTION
We easily find the exact solution of the given linear initial value problem to
be y(x) = (2e-^3 x + 1)/3. Table 2.9 contains the values of the exact solution,
Euler's approximation, Euler's approximation minus the exact solution, the
midpoint rule approximation, and the midpoint rule approximation minus the
exact so lution. Notice that near the initial value, xo = 0, the midpoint rule
approximation is more accurate than the Euler's method approximation. This
is due to the fact that the midpoint rule has a smaller local discretization error.
But notice that as x increases, the error of the midpoint rule approximation
increases rapidly. This occurs because the parasitic solution associated with
the midpoint rule is beginning to overwhelm the fundamental solution. For
x > .8 the Euler's approximation is more accurate than the midpoint rule
approximation.
Table 2.9 Euler and midpoint rule approximations to the IVP
y' = -3y + 1; y(O) = 1 on the interval [O, 2.4] with h = .1
Exact
solution Euler's method Midpoint rule
Xn c/>(xn) Yn Yn - cf>(xn) Yn Yn - c/>(xn)
.0 1.000000 1.000000 .000000 1.000000 .000000
.2 .699208 .870000 .170792 .703673 .004465
.4 .534129 .596300 .062171 .540668 .006539
.6 .443533 .462187 .018654 .452303 .008770
.8 .393812 .396472 .002660 .406768 .013868
1.0 .366525 .364271 -.002254 .387669 .021144
1.2 .351549 .348493 - .003056 .388130 .036581
1.4 .3433 30 .340762 -.002568 .408319 .064989
1.6 .338820 .336973 -. 001847 .455502 .116682
1.8 .336344 .355117 -.001227 .546665 .210321
2.0 .334986 .334207 -.000779 .714628 .379642
2.2 .334241 .333762 -.000479 1.019856 .685615
2.4 .333831 .333543 - .000288 1.572232 1.238401
In summary, single-step methods, such as the fourth order Runge-Kutta
method, have the advantages of being self-starting, numerically stable, and
requiring a small amount of computer storage. They have the disadvantages
of requiring multiple function evaluations per step and providing no error es-
timates except for Runge-Kutta-Fehlberg methods. Multistep methods have
the advantage of requiring only one function evaluation per step but have the