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.6 Euler’s method 619

Whenx = 1,y = 1 so thatD = 1, and the analytical solution is thereforey = x. We

see that in this example the numerical solution by Euler’s method produces the exact

solution. This will always be the case when the exact solution is a linear function and

exact arithmeticisemployed.

EXERCISES20.6

1 Using Euler’s method estimatey(3) given

y ′ = x +y

x

y(2) =1

Useh = 0.5 andh = 0.25. Solvethisequation

analytically and compare your numerical solutions

with the true solution.

2 Findy(0.5)ify ′ =x +y,y(0) = 0.Useh = 0.25and

h = 0.1.Find the truesolution forcomparison.

3 Use Euler’s methodto find v(0.01)given

10 −2dv +v =sin100πt v(0) =0

dt

Takeh = 0.005 andh = 0.002. Find the analytical

solution forcomparison.

Solutions

1 Exact:y =xln |x| −0.1931x

x i y i y i y

(h = 0.5) (h = 0.25) (exact)

2.00 1.0000 1.0000 1.0000

2.25 -- 1.3750 1.3901

2.50 1.7500 1.7778 1.8080

2.75 -- 2.2056 2.2509

3.00 2.6000 2.6561 2.7165

3 Exact:

sin100πt − πcos100πt + πe−100t

v =

π 2 +1

t i v i v

(h = 0.005) (exact)

0 0.0000 0.0000

0.005 0.0000 0.2673

0.010 0.5000 0.3954

2 Exact:y=−x−1+e x

x i y i y

(h = 0.25) (exact)

0 0.0000 0.0000

0.25 0.0000 0.0340

0.50 0.0625 0.1487

x i y i y

(h = 0.1) (exact)

t i v i v

(h = 0.002) (exact)

0 0.0000 0.0000

0.002 0.0000 0.0569

0.004 0.1176 0.1919

0.006 0.2843 0.3354

0.008 0.4176 0.4178

0.010 0.4517 0.3954

0 0.0000 0.0000

0.1 0.0000 0.0052

0.2 0.0100 0.0214

0.3 0.0310 0.0499

0.4 0.0641 0.0918

0.5 0.1105 0.1487

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

Saved successfully!

Ooh no, something went wrong!