21.04.2015 Views

Lecture Notes in Differential Equations - Bruce E. Shapiro

Lecture Notes in Differential Equations - Bruce E. Shapiro

Lecture Notes in Differential Equations - Bruce E. Shapiro

SHOW MORE
SHOW LESS

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

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

362 LESSON 33. NUMERICAL METHODS<br />

We then observe that s<strong>in</strong>ce y n ≈ y(t n ) and y n+1 ≈ y(t n+1 ), then (33.12)<br />

follows immediately from (33.16).<br />

If the scalar <strong>in</strong>itial value problem of equation (33.4) is replaced by a systems<br />

of equations<br />

y ′ = f(t, y), y(t 0 ) = y 0 (33.17)<br />

then the Forward Euler’s Method has the obvious generalization<br />

y n+1 = yn + hf(t n , y n ) (33.18)<br />

Example 33.1. Solve y ′ = y, y(0) = 1 on the <strong>in</strong>terval [0, 1] us<strong>in</strong>g h = 0.25.<br />

The exact solution is y = e x . We compute the values us<strong>in</strong>g Euler’s method.<br />

For any given time po<strong>in</strong>t t k , the value y k depends purely on the values of<br />

t k1 and y k1 . This is often a source of confusion for students: although the<br />

formula y k+1 = y k + hf(t k , y k ) only depends on t k and not on t k+1 it gives<br />

the value of y k+1 .<br />

We are given the follow<strong>in</strong>g <strong>in</strong>formation:<br />

⎫<br />

(t 0 , y 0 ) = (0, 1) ⎪⎬<br />

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

⎪⎭<br />

h = 0.25<br />

We first compute the solution at t = t 1 .<br />

(33.19)<br />

y 1 = y 0 + hf(t 0 , y 0 ) = 1 + (0.25)(1) = 1.25 (33.20)<br />

t 1 = t 0 + h = 0 + 0.25 = 0.25 (33.21)<br />

(t 1 , y 1 ) = (0.25, 1.25) (33.22)<br />

Then we compute the solutions at t = t 1 , t 2 , . . . until t k+1 = 1.<br />

y 2 = y 1 + hf(t 1 , y 1 ) (33.23)<br />

= 1.25 + (0.25)(1.25) = 1.5625 (33.24)<br />

t 2 = t 1 + h = 0.25 + 0.25 = 0.5 (33.25)<br />

(t 2 , y 2 ) = (0.5, 1.5625) (33.26)<br />

y 3 = y 2 + hf(t 2 , y 2 ) (33.27)<br />

= 1.5625 + (0.25)(1.5625) = 1.953125 (33.28)<br />

t 3 = t 2 + h = 0.5 + 0.25 = 0.75 (33.29)<br />

(t 3 , y 3 ) = (0.75, 1.953125) (33.30)

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

Saved successfully!

Ooh no, something went wrong!