03.03.2014 Views

Numerical Methods Course Notes Version 0.1 (UCSD Math 174, Fall ...

Numerical Methods Course Notes Version 0.1 (UCSD Math 174, Fall ...

Numerical Methods Course Notes Version 0.1 (UCSD Math 174, Fall ...

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.

136 CHAPTER 10. ORDINARY DIFFERENTIAL EQUATIONS<br />

For example, Euler’s Method, equation 10.3 can be written as<br />

X(t + h) ← X(t) + hF (t, X(t)) .<br />

As in 1D, this method is derived from approximating X by its linearization.<br />

In fact, our general strategy of using Taylor’s Theorem also carries through without change.<br />

That is we can use the k th order method to step as follows:<br />

X(t + h) ← X(t) + hX ′ (t) + h2<br />

2 X′′ (t) + . . . + hk<br />

k! X(k) (t).<br />

Additionally we can write the Runge-Kutta <strong>Methods</strong> as follows:<br />

Order two:<br />

K 1 ← hF (t, X)<br />

K 2 ← hF (t + h, X + K 1 )<br />

X(t + h) ← X(t) + 1 2 (K 1 + K 2 ) .<br />

Order four:<br />

K 1 ← hF (t, X)<br />

(<br />

K 2 ← hF t + 1 2 h, X + 1 )<br />

2 K 1<br />

(<br />

K 3 ← hF t + 1 2 h, X + 1 )<br />

2 K 2<br />

K 4 ← hF (t + h, X + K 3 )<br />

X(t + h) ← x(t) + 1 6 (K 1 + 2K 2 + 2K 3 + K 4 ) .<br />

Example Problem 10.8. Consider the system of ODEs:<br />

⎧<br />

⎪⎨<br />

⎪⎩<br />

x ′ 1 (t) = x 2 − x 2 3<br />

x ′ 2 (t) = t + x 1 + x 3<br />

x ′ 3 (t) = x 2 − x 2 1<br />

x 1 (0) = 1,<br />

x 2 (0) = 0,<br />

x 3 (0) = 1.<br />

Approximate X(<strong>0.1</strong>) by taking a single step of size <strong>0.1</strong>, for Euler’s Method, and the Runge-Kutta<br />

Method of order 2.<br />

Solution: We write<br />

⎡<br />

x 2 (t) − x 2 3 (t) ⎤ ⎡ ⎤<br />

1<br />

F (t, X(t)) = ⎣ t + x 1 (t) + x 3 (t) ⎦ X(0) = ⎣ 0 ⎦<br />

x 2 (t) − x 2 1 (t)<br />

1<br />

Thus we have<br />

⎡<br />

F (0, X(0)) = ⎣<br />

−1<br />

2<br />

−1<br />

⎤<br />

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

Saved successfully!

Ooh no, something went wrong!