21.04.2015 Views

The Computable Differential Equation Lecture ... - Bruce E. Shapiro

The Computable Differential Equation Lecture ... - Bruce E. Shapiro

The Computable Differential Equation Lecture ... - 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.

CHAPTER 4. IMPROVING ON EULER’S METHOD 83<br />

✬<br />

Algorithm 4.1. Backward Euler Method Using Fixed Point<br />

Iteration. To solve the initial value problem<br />

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

on an interval [t 0 , t max ] with a fixed step size h.<br />

1. input: f(t, y), t 0 , y 0 , h, t max , tol<br />

2. output: (t 0 , y 0 )<br />

3. let t = t 0 , y = y 0<br />

4. while t < t max<br />

(a) let i = 0<br />

(b) let y (0)<br />

next = y + hf(t + h, y) ⇐=<br />

(c) Repeat:<br />

y (i+1)<br />

next<br />

i = i + 1<br />

= y + hf(t + h, y (i)<br />

next ) ⇐=<br />

✩<br />

✫<br />

until |y (i+1)<br />

next<br />

(d) let y = y (i+1)<br />

next<br />

(e) let t = t + h<br />

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

− y (i)<br />

next | < tol<br />

(g) output: (t 0 , y 0 ), . . . , (t n , y n )<br />

✪<br />

<strong>The</strong>orem 4.6 (Newton’s Method). To find the root r of the scalar equation<br />

g(t) = 0, iterate on<br />

r (i+1) = r (i) − g(r(i) )<br />

g ′ (r (i) )<br />

To find the root r of the vector equation g(y) = 0, iterate on<br />

(4.106)<br />

( ) ∣<br />

∂g(y)<br />

−1∣∣∣∣y=r r (i+1) = r (i) −<br />

g(r (i) ) ⇐= (4.107)<br />

∂y<br />

(i)<br />

For the scalar IVP, we can use Newton’s method to find the root of<br />

g(y n ) = y n − y n−1 − hf(t, y n ) = 0 (4.108)<br />

c○2007, B.E.<strong>Shapiro</strong><br />

Last revised: May 23, 2007<br />

Math 582B, Spring 2007<br />

California State University Northridge

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

Saved successfully!

Ooh no, something went wrong!