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

**Download**(direct link)

**:**

**228**> 229 230 231 232 233 234 .. 609 >> Next

ô(³ï+0 = ô(³ï) + y f[t,ô(t)] dt. (10)

Chapter 8. Numerical Methods

The integral in Eq. (10) is represented geometrically as the area under the curve in Figure 8.1.1 between t = tn and t = t 1. If we approximate the integral by replacing f [t, ô(´)] by its value f [tn, ô (tn)] at t = tn, then we are approximating the actual area by the area of the shaded rectangle. In this way we obtain

Ô(Ï+1) = <P(tn) + f [tn, ô({ï)](tn+1 - tn)

= ô(1ï) + hf[tn ,ô(1ï)]. (11)

Finally, to obtain an approximation yn+1 for ô(^ï+1) we make a second approximation by replacing ô(´ï) by its approximate value yn in Eq. (11). This gives the Euler formula Óï+1 = yn + hf (tn, yn). A more accurate algorithm can be obtained by approximating the integral more accurately. This is discussed in Section 8.2.

A third approach is to assume that the solution y = ô() has a Taylor series about the point tn. Then

h2

ô(ï + h) = ô(ï) + ô'(ï )h + ô"(ï) 2! + •••

or

h2

Ô(³ï+1 ) = Ô(ï) + f [tn ,Ô(ï )]h + ô"(²ï) 2! + •••. (12)

If the series is terminated after the first two terms, and ô(^ï+1) and ô(´ï) are replaced by their approximate values yn+1 and yn, we again obtain the Euler formula (4). If more terms in the series are retained, a more accurate formula is obtained. Further, by using a Taylor series with a remainder it is possible to estimate the magnitude of the error in the formula. This is discussed later in this section.

The Backward Euler Formula. A variation on the Euler formula can be obtained by approximating the derivative in Eq. (8) by the backward difference quotient [ô(ï) — Ô(¿ï_ ])]/h instead of the forward difference quotient used in Eq. (9). In this way we obtain

ô(ï) — ô(ï—1) = hf(tn, Óï)

or

Óï = Óï—1 + hf(tn, Óï).

8.1 The Euler or Tangent Line Method

423

EXAMPLE

2

Stepping the index up from n to n + 1, we obtain the backward Euler formula

Óï+1 = Óï + hf(tn+1 ’ Óï+1 Ó (13)

Assuming that yn is known and yn 1 is to be calculated, observe that Eq. (13) does not provide an explicit formula for yn 1. Rather, it is an equation that implicitly defines yn 1 and must be solved to determine the value of yn 1 . How difficult this is depends entirely on the nature of the function f.

Use the backward Euler formula (13) and step sizes h = 0.05, 0.025, 0.01, and 0.001 to find approximate values of the solution of the initial value problem (5), (6) on the interval 0 < t < 2.

For this problem the backward Euler formula (13) becomes

Óï+1 = Óï + h(1 - tn+1 + 4Óï+1).

We will show the first two steps in detail so that it will be clear how the method works. At the first step we have

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

Solving this equation for y, we obtain

y = 1.0475/0.8 = 1.309375.

Observe that because the differential equation is linear, the implicit equation for y1 is also linear and therefore easy to solve. Next,

Ó2 = Ó1 + h(1 - t2 + 4Ó2) = 1.309375 + (0.05)(1 - 0.1 + 4y), which leads to

y2 = 1.354375/0.8 = 1.69296875.

Continuing the computations on a computer, we obtain the results shown in Table 8.1.2. The values given by the backward Euler method are uniformly too large for this problem, whereas the values obtained from the Euler method were too small. In this problem the errors are somewhat larger for the backward Euler method than for the Euler method, although for small values of h the differences are insignificant. Since the backward Euler method appears to be no more accurate than the Euler method, and is somewhat more complicated, a natural question is why it should even be mentioned. The answer is that it is the simplest example of a class of methods known as backward differentiation formulas that are very useful for certain types of differential equations. We will return to this issue later in this chapter.

Chapter 8. Numerical Methods

TABLE 8.1.2 Results for the Numerical Solution of / = 1 — t + 4y, y(0) = 1 Using the Backward Euler Method for Different Step Sizes h

t h = 0.05 h = 0.025 h = 0.01 h = 0.001 Exact

0 1.0000000 1 . 0000000 1.0000000 1 . 0000000 1 . 0000000

0.1 1.6929688 1.6474374 1.6236638 1.6104634 1.6090418

0.2 2.7616699 2.6211306 2.5491368 2.5095731 2.5053299

0.3 4.4174530 4.0920886 3.9285724 3.8396379 3.8301388

0.4 6.9905516 6.3209569 5.9908303 5.8131282 5.7942260

**228**> 229 230 231 232 233 234 .. 609 >> Next