11.11.2014 Views

Introductory Differential Equations using Sage - William Stein

Introductory Differential Equations using Sage - William Stein

Introductory Differential Equations using Sage - William Stein

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

1.6. NUMERICAL SOLUTIONS - EULER’S METHOD AND IMPROVED EULER’S METHOD41<br />

x y h m+m′<br />

0 1 −15/8<br />

1/2 1 + (−15/8) = −7/8 −95/64<br />

1 −7/8 + (−95/64) = −151/64<br />

2<br />

= 25x+5y−10<br />

4<br />

so y(1) ∼ = − 151<br />

64<br />

= −2.35... This is the final answer.<br />

Aside: For your information, this is closer to the exact value y(1) = e − 5 = −2.28... than<br />

the “usual” Euler’s method approximation of −2.75 we obtained above.<br />

1.6.3 Euler’s method for systems and higher order DEs<br />

We only sketch the idea in some simple cases. Consider the DE<br />

and the system<br />

y ′′ + p(x)y ′ + q(x)y = f(x), y(a) = e 1 , y ′ (a) = e 2 ,<br />

y ′ 1 = f 1(x,y 1 ,y 2 ), y 1 (a) = c 1 ,<br />

y ′ 2 = f 2(x,y 1 ,y 2 ), y 2 (a) = c 2 .<br />

We can treat both cases after first rewriting the DE as a system: create new variables<br />

y 1 = y and let y 2 = y ′ . It is easy to see that<br />

y ′ 1 = y 2, y 1 (a) = e 1 ,<br />

y ′ 2 = f(x) − q(x)y 1 − p(x)y 2 , y 2 (a) = e 2 .<br />

Tabular idea: Let n > 0 be an integer, which we call the step size. This is related to<br />

the increment by<br />

This can be expressed simplest <strong>using</strong> a table.<br />

h = b − a<br />

n .<br />

x y 1 hf 1 (x,y 1 ,y 2 ) y 2 hf 2 (x,y 1 ,y 2 )<br />

a e 1 hf 1 (a,e 1 ,e 2 ) e 2 hf 2 (a,e 1 ,e 2 )<br />

a + h e 1 + hf 1 (a,e 1 ,e 2 )<br />

a + 2h<br />

.<br />

. e 1 + hf 1 (a,e 1 ,e 2 )<br />

.<br />

b ??? xxx xxx xxx<br />

The goal is to fill out all the blanks of the table but the xxx entry and find the ??? entries,<br />

which is the Euler’s method approximation for y(b).<br />

.

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

Saved successfully!

Ooh no, something went wrong!