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 5. RUNGE-KUTTA METHODS 97<br />

Figure 5.3: Region of absolute stability for the “classical” 4-stage Runge-Kutta<br />

method.<br />

Using the trigonometric identity 2 cos θ = e iθ + e −iθ ,<br />

1 ≥ 2 (<br />

24r 4 cos 4θ + (24)(4 + r 2 ) cos 3θ+<br />

576<br />

(5.72)<br />

12(24 + 8r 2 + r 4 ) cos 2θ+ (5.73)<br />

4(144 + 72r 2 + 12r 4 + r 6 ) cos θ+ (5.74)<br />

(576 + 576r 2 + 144r 4 + 16r 6 + r 8 ) ) (5.75)<br />

<strong>The</strong> region of absolute stability is illustrated in figure 5.3.<br />

FIgure 5.4 compares the absolute error (y n (1) − e) at t = 1 using the 4-stage<br />

Runge-Kutta and Euler’s method. Clearly the RK4 method, which is fourth order,<br />

has much lower error and the error improves must faster with small step size then<br />

does Euler.<br />

Example 5.1. Compute the solution to the test equation y ′ = y, y(0) = 1 on [0, 1]<br />

using the 4-stage Runge Kutta method with h = 1/2.<br />

Solution. Since we start at t = 0 and need to compute through t = 1 we have to<br />

compute two iterations of RK. For the first iteration,<br />

k 1 = y 0 = 1 (5.76)<br />

k 2 = y 0 + h 2 f(t 0, k 1 ) (5.77)<br />

= 1 + (0.25)(1) = 1.25 (5.78)<br />

k 3 = y 0 + h 2 f(t 1/2, k 2 ) (5.79)<br />

= 1 + (0.25)(1.25) = 1.3125 (5.80)<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!