NUMERICAL METHODS FOR FIRST ORDER DIFFERENTIAL EQUATIONS 465
I
Table 49.7
xy
2.0 1
2.2 1.2
2.4 1.421818
2.6 1.664849
2.8 1.928718
3.0 2.213187
49.4 An improved Euler method
In Euler’s method of Section 49.2, the gradient (y′) 0
atP(x 0 ,y 0 )in Fig. 49.9 across the whole intervalhis
used to obtain an approximate value ofy 1 at point
Q.QRin Fig. 49.9 is the resulting error in the result.
0 x 0 x 1 x
h
P
R
Q
y
y 0
Figure 49.9
In an improved Euler method, called theEuler-
Cauchy method, the gradient atP(x 0 ,y 0 )across half
the interval is used and then continues with a line
whose gradient approximates to the gradient of the
curve atx 1 , shown in Fig. 49.10.
LetyP 1 be the predicted value at pointRusing
Euler’s method, i.e. lengthRZ, where
yP 1 =y 0 +h(y′) 0 (3)
The error shown asQTin Fig. 49.10 is now less than
the errorQRused in the basic Euler method and the
calculated results will be of greater accuracy. The
corrected value,yC 1 in the improved Euler method
is given by:
yC 1 =y 0 +^12 h[(y′) 0 +f(x 1 ,yP 1 )] (4)
0 x 0 x 0 + 12 hx 1 x
P S
R
T
Q
y
h
z
Figure 49.10
The following worked problems demonstrate how
equations (3) and (4) are used in the Euler-Cauchy
method.
Problem 4. Apply the Euler-Cauchy method to
solve the differential equation
dy
dx
=y−x
in the range 0(0.1)0.5, given the initial condi-
tions that atx=0,y=2.
dy
dx
=y′=y−x
Since the initial conditions arex 0 =0 andy 0 = 2
then (y′) 0 = 2 − 0 =2. Interval h= 0 .1, hence
x 1 =x 0 +h= 0 + 0. 1 = 0 .1.
From equation (3),
yP 1 =y 0 +h(y′) 0 = 2 +(0.1)(2)= 2. 2
From equation (4),
yC 1 =y 0 +^12 h[(y′) 0 +f(x 1 ,yP 1 )]
=y 0 +^12 h[(y′) 0 +(yP 1 −x 1 )],
in this case
= 2 +^12 (0.1)[2+(2. 2 − 0 .1)]=2.205
(y′) 1 =yC 1 −x 1 = 2. 205 − 0. 1 = 2. 105
If we produce a table of values, as in Euler’s method,
we have so far determined lines 1 and 2 of Table 49.8.
The results in line 2 are now taken asx 0 ,y 0 and
(y′) 0 for the next interval and the process is repeated.