differential equation
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
470 DIFFERENTIAL EQUATIONS<br />
6. y n+1 = y n + h 6 {k 1 + 2k 2 + 2k 3 + k 4 } and when<br />
n = 0:<br />
y 1 = y 0 + h 6 {k 1 + 2k 2 + 2k 3 + k 4 }<br />
= 2 + 0.1 {2 + 2(2.05) + 2(2.0525)<br />
6<br />
+ 2.10525}<br />
= 2 + 0.1 {12.31025} =2.205171<br />
6<br />
A table of values may be constructed as shown in<br />
Table 49.15. The working has been shown for the<br />
first two rows.<br />
Let n = 1 to determine y 2 :<br />
2. k 1 = f (x 1 , y 1 ) = f (0.1, 2.205171); since<br />
dy<br />
= y − x, f (0.1, 2.205171)<br />
dx<br />
= 2.205171 − 0.1 = 2.105171<br />
(<br />
3. k 2 = f x 1 + h 2 , y 1 + h )<br />
2 k 1<br />
(<br />
= f 0.1 + 0.1<br />
)<br />
0.1<br />
,2.205171 +<br />
2 2 (2.105171)<br />
= f (0.15, 2.31042955)<br />
= 2.31042955 − 0.15 = 2.160430<br />
(<br />
4. k 3 = f x 1 + h 2 , y 1 + h )<br />
2 k 2<br />
(<br />
= f 0.1 + 0.1<br />
)<br />
0.1<br />
,2.205171 +<br />
2 2 (2.160430)<br />
= f (0.15, 2.3131925) = 2.3131925 − 0.15<br />
= 2.163193<br />
5. k 4 = f (x 1 + h, y 1 + hk 3 )<br />
= f (0.1 + 0.1, 2.205171 + 0.1(2.163193))<br />
= f (0.2, 2.421490)<br />
= 2.421490 − 0.2 = 2.221490<br />
6. y n+1 = y n + h 6 {k 1 + 2k 2 + 2k 3 + k 4 }<br />
and when n = 1:<br />
y 2 = y 1 + h 6 {k 1 + 2k 2 + 2k 3 + k 4 }<br />
= 2.205171+ 0.1<br />
6 {2.105171+2(2.160430)<br />
+ 2(2.163193) + 2.221490}<br />
= 2.205171 + 0.1 {12.973907} =2.421403<br />
6<br />
This completes the third row of Table 49.15. 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.15. Such a table<br />
is best produced by using a spreadsheet, such as<br />
Microsoft Excel.<br />
This problem is the same as problem 3, page 463<br />
which used Euler’s method, and problem 4, page 465<br />
which used the improved Euler’s method, and a comparison<br />
of results can be made.<br />
The <strong>differential</strong> <strong>equation</strong> dy = y − x may be solved<br />
dx<br />
analytically using the integrating factor method of<br />
chapter 48, with the solution:<br />
y = x + 1 + e x<br />
Substituting values of x of 0, 0.1, 0.2, ..., 0.5 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 with<br />
the exact values is shown in Table 49.16 below.<br />
Table 49.15<br />
n x n k 1 k 2 k 3 k 4 y n<br />
0 0 2<br />
1 0.1 2.0 2.05 2.0525 2.10525 2.205171<br />
2 0.2 2.105171 2.160430 2.163193 2.221490 2.421403<br />
3 0.3 2.221403 2.282473 2.285527 2.349956 2.649859<br />
4 0.4 2.349859 2.417339 2.420726 2.491932 2.891824<br />
5 0.5 2.491824 2.566415 2.570145 2.648838 3.148720