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.

624 Chapter 20 Ordinary differential equations II

Table20.6

Comparison of the Runge--Kutta method

with exact solutions.

i x i y i y(x i )

0 0.0 2.0 2.0

1 0.25 1.8823 1.8824

2 0.5 1.5999 1.6000

3 0.75 1.2799 1.2800

4 1.0 1.0000 1.0000

Table20.7

The solution to

Example 20.9.

x i

y i

0.0 0.0

0.2 0.0213

0.4 0.0897

0.6 0.2112

Example20.9 Usethe fourth-order Runge--Kutta method toobtain a solution of

Solution We have

dy

dx =x2 +x−y

subject toy = 0 whenx = 0, for 0 x 0.6 withh = 0.2. Work throughout to four

decimal places.

where

y i+1

=y i

+ h 6 (k 1 +2k 2 +2k 3 +k 4 )

k 1

= f(x i

,y i

)

(

k 2

=f x i

+ h )

2 ,y i +h 2 k 1

(

k 3

=f x i

+ h )

2 ,y i +h 2 k 2

k 4

=f(x i

+h,y i

+hk 3

)

Inthisexample, f (x,y) =x 2 +x−yandx 0

= 0,y 0

= 0.Thefirststageinthesolution

isgiven by

k 1

=f(x 0

,y 0

)=0

k 2

= f(0.1,0) = 0.11

k 3

= f(0.1,0 + (0.1)(0.11)) = f(0.1,0.011) = 0.099

k 4

= f (0.2,0 + (0.2)(0.099)) = f (0.2,0.0198) = 0.2202

Therefore,

y 1

=0+ 0.2 (0 +2(0.11) +2(0.099) +0.2202) = 0.0213

6

which, in fact, is correct to four decimal places. Check the next stage for yourself. The

complete solution isshown inTable 20.7.

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

Saved successfully!

Ooh no, something went wrong!