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.

20.8 Runge--Kutta method of order 4 623

20.8 RUNGE--KUTTAMETHODOFORDER4

The‘Runge--Kutta’methods arealargefamilyofmethods usedforsolvingdifferential

equations. The Euler and improved Euler methods are special cases of this family. The

orderofthemethodreferstothehighestpowerofhincludedintheTaylorseriesexpansion.Weshallnowpresentthefourth-orderRunge--Kuttamethod.Thederivationofthis

isbeyond the scope ofthis book.

To solve the equation dy

dx = f (x,y) subject toy = y 0 whenx = x 0

we generate the

sequence ofvalues,y i

, from the formula

where

y i+1

=y i

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

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

)

Example20.8 UsetheRunge--Kuttamethodtosolve dy

dx = −xy2 ,for0 x 1,subjecttoy(0) = 2.

Useh = 0.25 and work tofour decimal places.

Solution We shall show the calculations required to findy 1

. You should follow this through and

then verifythe results inTable 20.6. The exact solution is shown forcomparison.

f(x,y)=−xy 2 h=0.25 x 0

=0 y 0

=2

Takingi = 0 inEquation (20.17), wehave

k 1

= f(x 0

,y 0

) = −0(2) 2 =0

k 2

= f (0.125,2) = −0.125(2) 2 = −0.5

(

k 3

=f 0.125,2 + 0.25 )

2 (−0.5) = f (0.125,1.9375)

= −0.125(1.9375) 2 = −0.4692

k 4

= f (0.25,2 +0.25(−0.4692)) = f (0.25,1.8827)

Therefore,

= −0.25(1.8827) 2 = −0.8861

y 1

=2+ 0.25 (0 +2(−0.5) +2(−0.4692) + (−0.8861)) = 1.8823

6

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

Saved successfully!

Ooh no, something went wrong!