# Elementary Differential Equations and Boundary Value Problems - Boyce W.E.

**Download**(direct link)

**:**

**230**> 231 232 233 234 235 236 .. 609 >> Next

en+1 = ô(ï+³) — Óï+1 = 2ô,,( Jn)h2- (21)

Thus the local truncation error for the Euler method is proportional to the square of the step size h and the proportionality factor depends on the second derivative of the solution ô. The expression given by Eq. (21) depends on n and, in general, is different for each step. A uniform bound, valid on an interval [a, b], is given by

\en\ < Mb2,/2, (22)

where M is the maximum of \ô"(t)\ on the interval [a, b]. Since Eq. (22) is based on a consideration of the worst possible case, that is, the largest possible value of W(t )\,

426

Chapter 8. Numerical Methods

it may well be a considerable overestimate of the actual local truncation error in some parts of the interval [a, b]. One use ofEq. (22) is to choose a step size that will result in a local truncation error no greater than some given tolerance level. For example, if the local truncation error must be no greater than e, then from Eq. (22) we have

h < J2e/M. (23)

The primary difficulty in using any of Eqs. (21), (22), or (23) lies in estimating |ô" (t)| or M. However, the central fact expressed by these equations is that the local truncation error is proportional to h2. Thus, if h is reduced by a factor of 1, then the error is reduced by 4, and so forth.

More important than the local truncation error is the global truncation error En. The analysis for estimating En is more difficult than that for en. However, knowing the local truncation error, we can make an intuitive estimate of the global truncation error at a fixed t > t0 as follows. Suppose that we take n steps in going from t0 to t = t0 + nh. In each step the error is at most Mh2/2; thus the error in n steps is at most nMh2/2. Noting that n = (t - t0)/h, we find that the global truncation error for the Euler method in going from t0 to t is bounded by

Mh2 _ Mh

n— = (t - ^) —. (24)

This argument is not complete since it does not take into account the effect that an error at one step will have in succeeding steps. Nevertheless, it can be shown that the global truncation error in using the Euler method on a finite interval is no greater than a constant times h; see Problem 23 for more details. The Euler method is called a first order method because its global truncation error is proportional to the first power of the step size.

Because it is more accessible, we will hereafter use the local truncation error as our principal measure of the accuracy of a numerical method, and for comparing different methods. If we have a priori information about the solution of the given initial value problem, we can use the result (21) to obtain more precise information about how the local truncation error varies with t. As an example, consider the illustrative problem

Ó = 1 - t + 4y, y(0) = 1 (25)

on the interval 0 < t < 2. Let y = ô(t) be the solution of the initial value problem

(25). Then, as noted previously,

ô(ó = (4t - 3 + 19e4t)/16

and therefore

ô"(t) = 19e .

Equation (21) then states that

19e47nh2

T

en+1 = --------î-----, tn < tn < tn + h. (26)

The appearance of the factor 19 and the rapid growth of e4t explain why the results in this section with h = 0.05 were not very accurate.

8.1 The Euler or Tangent Line Method

PROBLEMS

For instance, the error in the first step is

19e4t0 (0.0025)

~2

It is clear that e1 is positive and, since e4t0 < e0 2, we have

19e02 (0.0025)

1

Note also that e4t0 > 1; hence ex > 19(0.0025)/2 = 0.02375. The actual error is 0.02542. It follows from Eq. (26) that the error becomes progressively worse with increasing t; this is also clearly shown by the results in Table 8.1.1. Similar computations for bounds for the local truncation error give

e1 = ô(1 - Ó! =-------------------------------------------, 0 < 10 < 0.05.

ej <-------------------V- = 0.02901. (27)

19e38(0.0025) 19e4(0.0025)

---------- < e-,r. < ----------

2 - 20 - 2

in going from 0.95 to 1.0 and

1.0617 =----------^------- < e20 < -------^------- = 1.2967 (28)

19e78(0.0025) 19e8(0.0025) , 4

57.96 =---------^-------1 < e40 < ------K—----------------------}- = 70.80 (29)

in going from 1.95 to 2.0.

These results indicate that for this problem the local truncation error is about 2500 times larger near t = 2 than near t = 0. Thus, to reduce the local truncation error to an acceptable level throughout 0 < t < 2, one must choose a step size h based on an analysis near t = 2. Of course, this step size will be much smaller than necessary near t = 0. For example, to achieve a local truncation error of 0.01 for this problem, we need a step size of about 0.00059 near t = 2 and a step size of about 0.032 near t = 0. The use of a uniform step size that is smaller than necessary over much of the interval results in more calculations than necessary, more time consumed, and possibly more danger of unacceptable round-off errors.

**230**> 231 232 233 234 235 236 .. 609 >> Next