24.05.2018 Views

differential equation

Create successful ePaper yourself

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

472 DIFFERENTIAL EQUATIONS<br />

Table 49.17<br />

n x n k 1 k 2 k 3 k 4 y n<br />

0 1.0 4.0<br />

1 1.2 2.0 2.1 2.09 2.182 4.418733<br />

2 1.4 2.181267 2.263140 2.254953 2.330276 4.870324<br />

3 1.6 2.329676 2.396708 2.390005 2.451675 5.348817<br />

4 1.8 2.451183 2.506065 2.500577 2.551068 5.849335<br />

5 2.0 2.550665 2.595599 2.591105 2.632444 6.367886<br />

(<br />

4. k 3 = f x 1 + h 2 , y 1 + h )<br />

2 k 2<br />

(<br />

= f 1.2 + 0.2<br />

)<br />

0.2<br />

,4.418733 +<br />

2 2 (2.263140)<br />

= f (1.3, 4.645047) = 3(1 + 1.3) − 4.645047<br />

= 2.254953<br />

5. k 4 = f (x 1 + h, y 1 + hk 3 )<br />

= f (1.2 + 0.2, 4.418733 + 0.2(2.254953))<br />

= f (1.4, 4.869724) = 3(1 + 1.4) − 4.869724<br />

= 2.330276<br />

6. y n+1 = y n + h 6 {k 1 + 2k 2 + 2k 3 + k 4 } and when<br />

n = 1:<br />

y 2 = y 1 + h 6 {k 1 + 2k 2 + 2k 3 + k 4 }<br />

= 4.418733 + 0.2 {2.181267 + 2(2.263140)<br />

6<br />

+ 2(2.254953) + 2.330276}<br />

= 4.418733 + 0.2 {13.547729} =4.870324<br />

6<br />

This completes the third row of Table 49.17. In a<br />

similar manner y 3 , y 4 and y 5 can be calculated and<br />

the results are as shown in Table 49.17. As in the<br />

previous problem such a table is best produced by<br />

using a spreadsheet.<br />

This problem is the same as problem 1, page 461<br />

which used Euler’s method, and problem 5, page 467<br />

which used the Euler-Cauchy method, and a comparison<br />

of results can be made.<br />

The <strong>differential</strong> <strong>equation</strong> dy = 3(1 + x) − y may<br />

dx<br />

be solved analytically using the integrating factor<br />

method of chapter 48, with the solution:<br />

y = 3x + e 1−x<br />

Substituting values of x of 1.0, 1.2, 1.4, ..., 2.0 will<br />

give the exact values. A comparison of the results<br />

obtained by Euler’s method, the Euler-Cauchy<br />

method and the Runga-Kutta method, together<br />

with the exact values is shown in Table 49.18 on<br />

page 473.<br />

It is seen from Table 49.18 that the Runge-Kutta<br />

method is exact, correct to 4 decimal places.<br />

The percentage error in the Runge-Kutta method<br />

when, say, x = 1.6 is:<br />

( )<br />

5.348811636 − 5.348817<br />

×100% = −0.0001%<br />

5.348811636<br />

From problem 6, page 468, when x = 1.6, the percentage<br />

error for the Euler method was 0.688%, and<br />

for the Euler-Cauchy method −0.048%. Clearly, the<br />

Runge-Kutta method is the most accurate of the three<br />

methods.<br />

Now try the following exercise.<br />

Exercise 187 Further problems on the<br />

Runge-Kutta method<br />

1. Apply the Runge-Kutta method to solve<br />

the <strong>differential</strong> <strong>equation</strong>: dy<br />

dx = 3 − y for the<br />

x<br />

range 1.0(0.1)1.5, given that the initial conditions<br />

that x = 1 when y = 2.<br />

[see Table 49.19]

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

Saved successfully!

Ooh no, something went wrong!