25.08.2021 Views

082-Engineering-Mathematics-Anthony-Croft-Robert-Davison-Martin-Hargreaves-James-Flint-Edisi-5-2017

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

620 Chapter 20 Ordinary differential equations II

20.7 IMPROVEDEULERMETHOD

YouwillrecallthatEuler’smethodisobtainedbyfirstfindingtheslopeofthesolutionat

(x 0

,y 0

) and imposing a straight line approximation (often called a tangent line approximation)

there as indicated in Figure 20.10. If we knew the gradient of the solution at

x =x 1

in addition to the gradient atx =x 0

, a better approximation to the gradient over

the whole interval might be the mean of the two. Unfortunately, the gradient atx = x 1

which is

dy

dx∣ =f(x 1

,y 1

)

x=x1

cannot be obtained until we knowy 1

. What we can do, however, is use the value ofy 1

obtained by Euler’s method in estimating the gradient atx = x 1

. This gives rise to the

improved Euler method:

y 1

=y 0

+h×(average of gradients atx 0

andx 1

)

{ } f(x0 ,y

=y 0

+h× 0

)+f(x 1

,y 1

)

2

=y 0

+ h 2 {f(x 0 ,y 0 )+f(x 1 ,y 0 +hf(x 0 ,y 0 ))}

Then, knowingy 1

the whole process isstartedagain tofindy 2

, etc. Generally,

y i+1

=y i

+ h 2 {f(x i ,y i )+f(x i+1 ,y i +hf(x i ,y i ))}

It can be shown that, like Euler’s method, the improved Euler method is equivalent to

truncating the Taylor series expansion, inthis case afterthe third term.

Example20.6 Use the improved Euler method to solve the differential equationy ′ = −xy 2 ,y(0) = 2,

inExample20.4.Asbeforetakeh = 0.25,butworkthroughouttofourdecimalplaces.

Solution Here f(x,y) = −xy 2 ,y 0

= 2,x 0

= 0.Wefind f(x 0

,y 0

) = f(0,2) = −0(2 2 ) = 0.The

improved Euler method

yields

y 1

=y 0

+ h 2 {f(x 0 ,y 0 )+f(x 1 ,y 0 +hf(x 0 ,y 0 ))}

y 1

=2+ 0.25 {0 + f(0.25,2)}

2

Now f (0.25,2) = −0.25(2 2 ) = −1,so that

y 1

= 2 +0.125(−1) = 1.875

WeshallsetoutthecalculationsrequiredinTable20.3.Youshouldworkthroughthenext

fewstagesyourself.Comparingthevaluesobtainedinthiswaywiththeexactsolution,

we see that, over the interval of interest, our solution is usually correct to two decimal

places (Table 20.4).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!