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.
462 DIFFERENTIAL EQUATIONS<br />
For line 5, where x 0 = 1.8:<br />
y 1 = y 0 + h(y ′ ) 0<br />
= 5.312 + (0.2)(2.488) = 5.8096<br />
and (y ′ ) 0 = 3(1 + 1.8) − 5.8096 = 2.5904<br />
For line 6, where x 0 = 2.0:<br />
y 1 = y 0 + h(y ′ ) 0<br />
= 5.8096 + (0.2)(2.5904)<br />
= 6.32768<br />
(As the range is 1.0 to 2.0 there is no need to calculate<br />
(y ′ ) 0 in line 6). The particular solution is given by the<br />
value of y against x.<br />
A graph of the solution of dy = 3(1 + x) − y<br />
dx<br />
with initial conditions x = 1 and y = 4 is shown in<br />
Fig. 49.6.<br />
y<br />
x = 0(0.2)1.0 means that x ranges from 0 to 1.0 in<br />
equal intervals of 0.2 (i.e. h = 0.2 in Euler’s method).<br />
dy<br />
dx + y = 2x,<br />
dy<br />
hence = 2x − y,<br />
dx i.e. y′ = 2x − y<br />
If initially x 0 = 0 and y 0 = 1, then<br />
(y ′ ) 0 = 2(0) − 1 = −1.<br />
Hence line 1 in Table 49.2 can be completed with<br />
x = 0, y = 1 and y ′ (0) =−1.<br />
Table 49.2<br />
x 0 y 0 (y ′ ) 0<br />
1. 0 1 −1<br />
2. 0.2 0.8 −0.4<br />
3. 0.4 0.72 0.08<br />
4. 0.6 0.736 0.464<br />
5. 0.8 0.8288 0.7712<br />
6. 1.0 0.98304<br />
6.0<br />
5.0<br />
4.0<br />
Figure 49.6<br />
1.0 1.2 1.4 1.6 1.8 2.0 x<br />
In practice it is probably best to plot the graph as<br />
each calculation is made, which checks that there is<br />
a smooth progression and that no calculation errors<br />
have occurred.<br />
Problem 2. Use Euler’s method to obtain a<br />
numerical solution of the <strong>differential</strong> <strong>equation</strong><br />
dy<br />
+ y = 2x, given the initial conditions that at<br />
dx<br />
x = 0, y = 1, for the range x = 0(0.2)1.0. Draw<br />
the graph of the solution in this range.<br />
For line 2, where x 0 = 0.2 and h = 0.2:<br />
y 1 = y 0 + h(y ′ ), from <strong>equation</strong> (2)<br />
= 1 + (0.2)(−1) = 0.8<br />
and (y ′ ) 0 = 2x 0 − y 0 = 2(0.2) − 0.8 = −0.4<br />
For line 3, where x 0 = 0.4:<br />
y 1 = y 0 + h(y ′ ) 0<br />
= 0.8 + (0.2)(−0.4) = 0.72<br />
and (y ′ ) 0 = 2x 0 − y 0 = 2(0.4) − 0.72 = 0.08<br />
For line 4, where x 0 = 0.6:<br />
y 1 = y 0 + h(y ′ ) 0<br />
= 0.72 + (0.2)(0.08) = 0.736<br />
and (y ′ ) 0 = 2x 0 − y 0 = 2(0.6) − 0.736 = 0.464<br />
For line 5, where x 0 = 0.8:<br />
y 1 = y 0 + h(y ′ ) 0<br />
= 0.736 + (0.2)(0.464) = 0.8288<br />
and (y ′ ) 0 = 2x 0 − y 0 = 2(0.8) − 0.8288 = 0.7712<br />
For line 6, where x 0 = 1.0:<br />
y 1 = y 0 + h(y ′ ) 0<br />
= 0.8288 + (0.2)(0.7712) = 0.98304<br />
As the range is 0 to 1.0, (y ′ ) 0 in line 6 is not needed.