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.

20.7 Improved Euler method 621

Table20.3

Applying the improved Eulermethod to Example 20.6.

i x i y i f(x i ,y i ) y i +hf(x i ,y i ) f(x i+1 ,y i y i+1

+hf(x i ,y i ))

0 0 2 0 2 −1 1.8750

1 0.25 1.8750 −0.8789 1.6553 −1.3700 1.5939

2 0.5 1.5939 −1.2703 1.2763 −1.2217 1.2824

3 0.75 1.2824 −1.2334 0.9741 −0.9489 1.0096

Table20.4

Comparison of the improved Euler

method with the exact solution.

i x i y i y(x i )

0 0.000 2.0000 2.0000

1 0.2500 1.8750 1.8824

2 0.5000 1.5939 1.6000

3 0.7500 1.2824 1.2800

4 1.0000 1.0096 1.0000

Example20.7 Apply both Euler’s method and the improved Euler method tothe solution of

dy

dx =2x y=1whenx=0

for 0 x 0.5 using h = 0.1. Compare your answers with the analytical solution.

Work throughout tothreedecimal places.

Solution We have dy

dx = 2x,x 0 = 0,y 0

= 1.Therefore, usingEuler’s method we find

y i+1

=y i

+hf(x i

,y i

)

Therefore,

=y i

+0.1(2x i

)

=y i

+0.2x i

y 1

=y 0

+0.2x 0

=1+ (0.2)(0) =1

y 2

=y 1

+0.2x 1

= 1 + (0.2)(0.1) = 1.02

The complete solution appears in Table 20.5. Check the values given in the table for

yourself.Usingthe improved Euler method we have

y i+1

=y i

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

=y i

+0.05(2x i

+2x i+1

)

=y i

+0.1(x i

+x i+1

)

Table20.5

ThesolutionofExample20.7usingEuler’smethod,

the improved Eulermethod and the exact solution.

x i y i (Euler) y i (improved y(x i )

Euler) (exact)

0 1.000 1.000 1.000

0.1 1.000 1.010 1.010

0.2 1.020 1.040 1.040

0.3 1.060 1.090 1.090

0.4 1.120 1.160 1.160

0.5 1.200 1.250 1.250

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

Saved successfully!

Ooh no, something went wrong!