method becomes computationally expensive in terms of the number of required
operations; (2) round-off errors can dominate the total error and any improvement
in accuracy is lost; (3) round-off errors will accumulate and become relatively large
because now many, many steps are involved. This will corrupt the final solution at
t ¼ t
f
.
What happens when h is not small enough? Let’s first take a closer look at the
exact solution. If λ
4
0, the true solution blows up at large times and y ! ∞. We are
not interested in the unstable problem. We consider only those situations in which
λ
5
0. For these values of λ the solution decays with time to zero. Examples of
physical situations in which this equation applies are radioactive decay, drug elim-
ination by the kidneys, and first-order (irreversible) consumption of a chemical
reactant.
In a first-order decay problem,
dy
dt
¼λy; λ
4
0: yð0Þ
4
0
According to the exact solution, it is always the case that yt
2
ðÞ
5
yðt
1
Þ, where t
2
4
t
1
.
The numerical solution of this ODE problem is y
kþ1
¼ 1 λhðÞy
k
.When
1 λh
jj
5
1, then we will always have y
kþ1
5
y
k
. To achieve a decaying solution, h
must be constrained to the range 1
5
1 λh
5
1or0
5
h
5
2=λ. Note that h is always
positive in a forward-marching scheme, so the condition that assures a decaying
numerical solution is h
5
2=λ.If0
5
h
5
1=λ, then the decay is monotonic. If
1=λ
5
h
5
2=λ, an oscillatory decay is observed. What happens when h ¼ 1=λ?If
h ¼ 2=λ, then the numerical solution does not decay but instead oscillates from α
to α at every time step.
When h 2=λ, the numerical solution is bounded and the numerical solution is said
to be stable over this range of step size values. The accuracy of the solution will depend
on the size of h.Whenh
4
2=λ, the numerical solution diverges with time with sign
reversal at each step and tends towards infinity. The solution blows up because the
errors grow (as opposed to decay) exponentially and cause the solution to blow up. For
this range of h values, the numerical solution is unstable. The magnitude of λ defines the
upper bound for the step size. A large λ requires a very small h to ensure stability of the
numerical technique. However, if h is too small, then the limits of numerical precision
may be reached and round-off error will preclude any improvement in accuracy.
The stability of numerical integration is determined by the ODE to be solved, the
step size,
and the numerical integration scheme. We explore the stability limits of
Euler’s method by looking at how the error accumulates with each step. Equation
(7.20) express es the global truncation error at t
kþ1
in terms of the error at t
k
:
yt
kþ1
ðÞy
kþ1
1 þ h
∂f
∂y
yt
k
ðÞy
k
ðÞþ
Mh
2
2
: (7:20)
Note that the global error at t
k
, which is given by yt
k
ðÞy
k
, is multiplied by an
amplification factor, which for Euler’s forward method is 1 þ hð∂f=∂yÞ.Ifð∂f=∂y Þ is
positive, then 1 þ h ð∂f=∂yÞ
4
1, and the global error will be amplified regardless of
the step size. Even if the exact solution is bounded, the numerical solution may
accumulate large errors along the path of integrati on. If ð∂f=∂yÞ is negative and h is
chosen such that 1 1 þ h ð∂f=∂yÞ
5
1, then the error remains bounded for all
times within the time interval. However, if ð∂f=∂yÞ is very negative, then ð∂f=∂yÞjj
is large. If h is not small enou gh, then 1 þ hð∂f=∂yÞ
5
1orhð∂f=∂yÞ
5
2. The
errors
will be magnified at each step, and the numerical method is rendered unstable.
424
Numerical integration of ODEs