06.12.2016 Views

Taylor Series Expansion

2016+Week4

2016+Week4

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Example 3:<br />

Solve the differential equation y' = x/y, y(0)=1 by Euler's method to get y(1). Use the step<br />

lengths h = 0.1 and 0.2 and compare the results with the analytical solution (y 2 = 1 + x 2 )<br />

Solution:<br />

f(x, y) = x/y,<br />

with h = 0.1<br />

y 1 = y 0 + h f(x 0 , y 0 ) = 1.0 + 0.1*0.0/1.0 = 1.00<br />

y 2 = y 1 + h f(x 1 , y 1 ) = 1.0 + 0.1*0.1/1.0 = 1.01<br />

y 3 = y 2 + h f(x 2 , y 2 ) = 1.01 + 0.1*0.2/1.01 = 1.0298<br />

y 4 = y 3 + h f(x 3 , y 3 ) = 1.0298 + 0.1*0.3/1.0298 = 1.0589<br />

y 5 = y 4 + h f(x 4 , y 4 ) = 1.0589 + 0.1*0.4/1.0589 = 1.0967<br />

y 6 = y 5 + h f(x 5 , y 5 ) = 1.0967 + 0.1*0.5/1.0967 = 1.1423<br />

y 7 = y 6 + h f(x 6 , y 6 ) = 1.1423 + 0.1*0.6/1.1423 = 1.1948<br />

y 8 = y 7 + h f(x 7 , y 7 ) = 1.1948 + 0.1*0.7/1.1948 = 1.2534<br />

y 9 = y 8 + h f(x 8 , y 8 ) = 1.2534 + 0.1*0.8/1.2534 = 1.3172<br />

y 10 = y 9 + h f(x 9 , y 9 ) = 1.3172 + 0.1*0.9/1.3172 = 1.3855

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

Saved successfully!

Ooh no, something went wrong!