Numerical methods for first order differential equations 467
corrected value, y C 1 in the improved Euler method is
given by:
y C 1 = y 0 +
1
2 h[( y
) 0 + f (x 1 , y P 1 )]
(4)
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
d y
dx
= y − x
in the range 0(0.1)0.5, given the initial conditions
that at x = 0, y = 2.
d y
dx
= y
= y − x
Since the initial conditions are x 0 = 0 and y 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),
y P 1 = y 0 + h(y
) 0 = 2 + (0.1)(2) = 2.2
From equation (4),
y C 1 = y 0 +
1
2 h[(y
) 0 + f (x 1 , y P 1 )]
= y 0 +
1
2 h[(y
) 0 + (y P 1 − x 1 )],
in this case
= 2 +
1
2 (0.1)[2 + (2.2 − 0.1)] = 2.205
(y
) 1 = y C 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 as x 0 , y 0 and (y
) 0
for the next interval and the process is repeated.
Table 49.8
x
y
y
1. 0
2
2
2. 0.1 2.205
2.105
3. 0.2 2.421025
2.221025
4. 0.3 2.649232625 2.349232625
5. 0.4 2.89090205
2.49090205
6. 0.5 3.147446765
For line 3, x 1 = 0.2
y P 1 = y 0 + h(y
) 0 = 2.205 + (0.1)(2.105)
= 2.4155
y C 1 = y 0 +
1
2 h[(y
) 0 + f (x 1 , y P 1 )]
= 2.205 +
1
2 (0.1)[2.105 + (2.4155 − 0.2)]
= 2.421025
( y
) 0 = y C 1 − x 1 = 2.421025 − 0.2 = 2.221025
For line 4, x 1 = 0.3
y P 1 = y 0 + h(y
) 0
= 2.421025 + (0.1)(2.221025)
= 2.6431275
y C 1 = y 0 +
1
2 h[(y
) 0 + f (x 1 , y P 1 )]
= 2.421025 +
1
2 (0.1)[2.221025
+ (2.6431275 − 0.3)]
= 2.649232625
(y
) 0 = y C 1 − x 1 = 2.649232625 − 0.3
= 2.349232625
For line 5, x 1 = 0.4
y P 1 = y 0 + h(y
) 0
= 2.649232625 + (0.1)(2.349232625)
= 2.884155887
y C 1 = y 0 +
1
2 h[(y
) 0 + f (x 1 , y P 1 )]
= 2.649232625 +
1
2 (0.1)[2.349232625
+ (2.884155887 − 0.4)]
= 2.89090205
(y
) 0 = y C 1 − x 1 = 2.89090205 − 0.4
= 2.49090205
For line 6, x 1 = 0.5
y P 1 = y 0 + h(y
) 0
= 2.89090205 + (0.1)(2.49090205)
= 3.139992255
Précédent

- 486/705

Suivant