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

Create successful ePaper yourself

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

134 CHAPTER 10. ORDINARY DIFFERENTIAL EQUATIONS<br />

method:<br />

K 1 ← hf(t, x)<br />

K 2 ← hf(t + h/2, x + K 1 /2)<br />

K 3 ← hf(t + h/2, x + K 2 /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 />

(10.5)<br />

This method has order O ( h 5) . (See http://mathworld.wolfram.com/Runge-KuttaMethod.html)<br />

The Runge-Kutta Method can be extrapolated to even higher orders. However, the number<br />

of function evaluations grows faster than the accuracy of the method. Thus the methods of order<br />

higher than four are normally not used.<br />

We already saw that w 1 = 1, w 2 = 0 corresponds to Euler’s Method. We consider now the case<br />

w 1 = 0, w 2 = 1. The method becomes<br />

x(t + h) ← x(t) + hf<br />

(t + h 2 , x + h 2 f(t, x) )<br />

.<br />

This is called the modified Euler’s Method . Note this gives a different value than if Euler’s<br />

Method was applied twice with step size h/2.<br />

10.2.3 Examples<br />

Example 10.6. Consider the ODE:<br />

{<br />

x ′ = (tx) 3 − ( x<br />

x(1) = 1<br />

Use h = <strong>0.1</strong> to compute x(1.1) using both Taylor’s Series <strong>Methods</strong> and Runge-Kutta methods<br />

of order 2.<br />

t<br />

) 2<br />

10.3 Systems of ODEs<br />

Recall the regular ODE problem: find some x(t) such that<br />

{ dx(t)<br />

dt<br />

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

x(a) = c,<br />

where f, a, c are given.<br />

Sometimes the physical systems we are considering are more complex. For example, we might<br />

be interested in the system of ODEs:<br />

⎧<br />

⎪⎨<br />

⎪⎩<br />

dx(t)<br />

dt<br />

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

dy(t)<br />

dt<br />

= g (t, x(t), y(t)) ,<br />

x(a) = c,<br />

y(a) = d.

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

Saved successfully!

Ooh no, something went wrong!