25.08.2021 Views

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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

618 Chapter 20 Ordinary differential equations II

Table20.1

ComparisonofnumericalsolutionbyEuler’s

method with exact solution.

i x i y i y(x i )

numerical exact

0 0.000 2.000 2.000

1 0.250 2.000 1.882

2 0.500 1.750 1.600

3 0.750 1.367 1.280

4 1.000 1.017 1.000

Table20.2

The solution to Example 20.5

byEuler’smethod.

i x i y i

0 1.00 1.00

1 1.20 1.20

2 1.40 1.40

3 1.60 1.60

4 1.80 1.80

5 2.00 2.00

Table 20.1 summarizes the numerical and exact solutions. In this example only one

correct significant figure is obtained. In practice, for most equations a very small step

size is necessary which means that computation is extremely time consuming. An improvement

to Euler’s method, which usually yields more accurate solutions, is given in

Section 20.7.

Example20.5 Obtain a solution forvalues ofxbetween 1 and 2 of

dy

dx = y x

subject toy = 1whenx = 1usingEuler’smethod.Useastepsizeofh = 0.2,working

throughouttotwodecimalplacesofaccuracy.Compareyouranswerwiththeanalytical

solution. Comment upon the approximate and exact solutions.

Solution Here we have f (x,y) = y x , y 0 = 1, x 0

= 1 and h = 0.20. With a step size of 0.2,

x 1

= 1.2,x 2

= 1.4,...,x 5

= 2.0. We need to calculatey 1

,y 2

,...,y 5

. Euler’s method,

y i+1

=y i

+hf (x i

,y i

), reduces to

( )

yi

y i+1

=y i

+0.2

x i

Therefore,

Similarly,

y 1

=y 0

+0.2

y 2

=y 1

+0.2

(

y0

(

y1

x 0

)

( 1

=1+0.2 = 1.20

1)

) ( ) 1.20

= 1.20 +0.2 = 1.40

x 1

1.20

ContinuinginasimilarfashionweobtaintheresultsshowninTable20.2.Toobtainthe

analytical solution we separate the variables togive

∫ ∫ dy dx

y = x

so that

lny=lnx+lnD=lnDx

Therefore,

y=Dx

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

Saved successfully!

Ooh no, something went wrong!