SelfStudys Document
SelfStudys Document
SelfStudys Document
x
x x5
y3 y0 x0
f ( x, y2 )dx
x3 x 4
y5 1 1 2 x x2 dx (1)
0 3 12 120
Continuing this process, we obtain y4, y5, yn where
x3 x 4 x 5 x6
x 1 x x2
yn y0 x0
f ( x, yn1 )dx 3 12 60 720
(ii) Given equation
Hence this method gives a sequence of approximations y1, y2, y3
dy
each giving a better result than the preceding one. y x is a Leibnitzs linear in x
dx
NOTE Obs. Picard’s method is of considerable theoretical value, but Its, I.F. being ex the solution is
can be applied only to a limited class of equations in which the
successive integrations can be performed easily. The method can yex xe x
dx c
be extended to simultaneous equations and equations of higher
order (See Sections 10.11 and 10.12).
xe x
e dx c xe
x x
ex c
y ce x x 1
EXAMPLE 10.1
Since y 1, when x 0, c 2.
Using Picard’s process of successive approximations, obtain a solution Thus the desired particular solution is
up to the fifth approximation of the equation dy/dx y x, such that
y 2ex x 1
y 1 when x 0. Check your answer by finding the exact particular solution. (2)
x2 x3 x 4
Solution: Or using the series: e x 1 x
x 2! 3! 4!
(i) We have y 1 x0
( x y)dx
x3 x 4 x 5 x6
We get y 1 x x2 (3)
First approximation. Put y 1 in y x, giving 3 12 60 360
x Comparing (1) and (3), it is clear that (1), approximates to the exact
y1 1 x0
(1 x)dx 1 x x2 /2
particular solution (3) upto the term in x5.
Second approximation. Put y 1 x x2/2 in y x, giving
x
NOTE Obs. At x 1, the fourth approximation y4 3.433 and the fifth
y1 1 x0
(1 x x2 /2)dx 1 x x2 x3 /6 approximation y5 3.434 whereas the exact value is 3.44.
Obs. This is a single step method and works well so long as EXAMPLE 10.4
NOTE
the successive derivatives can be calculated easily. If (x, y) is Find by Taylor’s series method, the values of y at x 0.1 and x 0.2 to
somewhat complicated and the calculation of higher order five places of decimals from dy/dx x2y – 1, y(0) 1.
derivatives becomes tedious, then Taylor’s method cannot
be used gainfully. This is the main drawback of this method Solution:
and therefore, has little application for computer programs. Differentiating successively, we get
However, it is useful for finding starting values for the y x2y – 1, (y)0 – 1 [ y(0) 1]
application of powerful methods like Runga-Kutta, Milne and
Adams- Bashforth which will be described in the subsequent y 2xy x2y, (y)0 0
sections. y 2y 4xy x2y, (y)0 2
yiv 6y 6xy x2y, (yiv)0 – 6, etc.
EXAMPLE 10.3
Putting these values in the Taylor’s series, we have
Solve y x y, y(0) 1 by Taylor’s series method. Hence find the val-
x2 ( x)3 ( x)4
ues of y at x 0.1 and x 0.2. y 1 x 1 (0) (2) (6)
2 3! 4!
Solution:
x3 x 4
Differentiating successively, we get 1 x
3 4
y x y y(0) 1 [ y(0) 1] Hence y(0.1) 0.90033 and y(0.21) 0.80227
y 1 y y(0) 2
EXAMPLE 10.5
y y y(0) 2
y y y(0) 2, etc. Employ Taylor’s method to obtain approximate value of y at x 0.2 for
the differential equation dy/dx 2y 3ex, y(0) 0. Compare the numerical
Taylor’s series is solution obtained with the exact solution.
( x x0 )2 ( x x0 )3 Solution:
y y0 ( x x0 )(y)0 (y)0 (y)0
2! 3!
Here x0 0, y0 1 (a) We have y 2y 3ex; y(0) 2y(0) 3e0 3.
2 3 4 Differentiating successively and substituting x 0, y 0 we get
x ( x) ( x)
y 1 x 1 (2) (2) (4)
2 3! 4! y 2y 3ex, y(0) 2y(0) 3 9
0.1 3
0.1 4 y 2y 3ex, y(0) 2y(0) 3 21
2
Thus y 0.1 1 0.1 0.1
3! 4! yiv 2y 3ex, yiv(0) 2y(0) 3 45 etc.
1.1103 Putting these values in the Taylor’s series, we have
2 0.2 3 0.2 4 x2 x3 x4
and y 0.2 1 0.2 0.2 y( x) y(0) xy(0) y(0) y(0) yiv (0)
3 6 2! 3! 4!
1.2427 9 21 45
0 3 x x2 x3 x 4
2 6 24
9 21 15
3 x x2 x3 x 4
2 6 8
Hence y(0.2) 3(0.2) 4.5(0.2)2 3.5(0.2)3 1.875(0.2)4 0.8110 (i) 1 1
Hence y 0.1 1 (0.1)2 (0.1)3 1.005
dy 2 3
(b) Now 2 y 3e x is a Leibnitz’s linear in x 1 1
dx y 0.2 1 (0.2)2 (0.2)3 1.017
2 3
Its I.F. being e–2x, the solution is
1 1
y 0.3 1 (0.3)2 (0.3)3 1.036
ye–2 x 3e x. 2 x
e dx c –3e– x c or y –3e x ce2 x 2 3
Since y 0 when x 0, c 3. EXAMPLE 10.7
dy
Thus the exact solution is y 3(e2x – ex) Solve by Taylor’s series method the equation log( xy) for y(1.1)
and y(1.2), given y(1) 2. dx
When x 0.2, y 3(e – e ) 0.8112
0.4 0.2
(ii)
Comparing (i) and (ii), it is clear that (i) approximates to the exact value Solution:
up to three decimal places We have y log x log y; y(1) log 2
Differentiating w.r.t., x and substituting x 1, y 2, we get
EXAMPLE 10.6 1 1 1
3 2 y y y 1 log 2
Solve by Taylor series method of third order the equation dy x xy , x y 2
y(0) 1 for y at x 0.1, x 0.2 and x 0.3 dx ex 1
1 1
y 2
y y y;
Solution: x2 y y
We have y x3 xy2 e– x ; y 0 0 1 1 1 2
y 1 1 log 2 log 2
Differentiating successively and substituting x 0, y 1. 2 2 4
y ( x3 xy2 )(– e– x ) (3 x2 y2 x.2 y.y)ex Substituting these values in the Taylor’s series about s 1, we have
EXAMPLE 10.8 We repeat this step until y2 becomes stationary. Then we proceed to calcu-
Using Euler’s method, find an approximate value of y corresponding to late y3 as above and so on.
x 1, given that dy/dx x y and y 1 when x 0. This is the modified Euler’s method which gives great improvement in
Solution: accuracy over the original method.
Since the last two values are equal, we take y(0.2) 1.2432.
EXAMPLE 10.9
0.2 1.4432 — 1.2432 0.1 (1.4432) 1.3875
Given dy y x with initial condition y 1 at x 0; find y for x 0.1 0.3 0.3 1.3875 1 1.2432 0.1 (1.5654) 1.3997
2 (1.4432 1.6875)
dx y x
by Euler’s method. 0.3 0.3 1.3997 1 1.2432 0.1 (1.5715) 1.4003
2 (1.4432 1.6997)
Solution: 0.3 0.3 1.4003 1 1.2432 0.1 (1.5718) 1.4004
2 (1.4432 1.7003)
We divide the interval (0, 0.1) in to five steps, i.e., we take n 5 and
h 0.02. The various calculations are arranged as follows: 0.3 0.3 1.4004 1 1.2432 0.1 (1.5718) 1.4004
2 (1.4432 1.7004)
Since the last two values are equal, we take y(0.3) 1.4004.
Hence y(0.3) 1.4004 approximately. x y ex Mean slope Oldy 0.2 (mean slope) new y
Obs. In Example 10.8, we obtained the approximate value of y 0.4 0.5968 e0.4 2.0887 1 0.2468 0.2 (1.7784) 0.6025
NOTE 2 (1.4682 2.0887)
for x 0.3 to be 1.53 whereas by the modified Euler’s method 1.7784
the corresponding value is 1.4003 which is nearer its true
value 1.3997, obtained from its exact solution y 2ex – x – 1 by 0.4 0.6025 e0.4 2.0943 1 0.2468 0.2 (1.78125) 0.6030
2 (1.4682 2.0943)
putting x 0.3. = 1.78125
0.4 0.6030 e0.4 2.0949 1 0.2468 0.2 (1.7815) 0.6031
EXAMPLE 10.11 2 (1.4682 2.0949)
= 1.7815
Using the modified Euler’s method, find y(0.2) and y(0.4) given
0.4 0.6031 e0.4 2.0949 1 0.2468 0.2 (1.7815) 0.6031
2 (1.4682 2.0949)
y y ex, y(0) 0.
= 1.7816
Solution:
We have y y ex f (x, y); x 0, y 0 and h 0.2 Since the last two value of y are equal, we take y(0.4) 0.6031
The various calculations are arranged as under: Hence y(0.2) 0.2468 an d y(0.4) 0.6031 approximately.
To calculate y(0.2):
EXAMPLE 10.12
x y ex y Mean slope Old y h (Mean slope)
new y Solve the following by Euler’s modified method:
0.0 1 — 0 0.2 (1) 0.2 dy
0.2 0.2 e0.2 1.4214 1 0 0.2 (1.2107) 0.2421 log( x y), y(0) 2
2 (1 1.4214) 1.2107 dx
at x 1.2 and 1.4 with h 0.2.
0.2 0.2421 e0.2 1.4635 1
1.4635) 1.2317 0 0.2 (1.2317) 0.2463
2 (1 Solution:
0.2 0.2463 e 1.4677
0.2
1 0 0.2 (1.2338) 0.2468 The various calculations are arranged as follows:
(1 1.4677) 1.2338
2 x log (x y) y Mean slope Old y 0.2 (mean slope) new y
0.2 0.2468 e0.2 1.4682 1
1.4682) 1.2341 0 0.2 (1.2341) 0.2468 0.0 log (0 2) — 2 0.2(0.301) 2.0602
2 (1
0.2 log (0.2 2.0602) 1
2 (0.310 0.3541) 2 0.2 (0.3276) 2.0655
Since the last two values of y are equal, we take y (0.2) 0.2468.
0.2 log (0.2 2.0655) 1 2 0.2 (0.3281) 2.0656
2 (0.301 0.3552)
To calculate y(0.4): 0.2 0.3552 — 2.0656 0.2 (0.3552) 2.1366
1
x y ex Mean slope Oldy 0.2 (mean slope) new y 0.4 log (0.4 2.1366) 2 (0.3552 0.4042) 2.0656 0.2 (0.3797) 2.1415
0.2 0.2468 e0.2 1.4682 — 0.2468 0.2 (1.4682) 0.5404 0.4 log (0.4 2.1415) 1
2 (0.3552 0.4051) 2.0656 0.2 (0.3801) 2.1416
0.4 0.5404 e0.4 2.0322 1 0.2468 0.2 (1.7502) 0.5968 2.1416 0.2 (0.4051) 2.2226
2 (1.4682 2.0322)
0.4 0.4051 —
1
1.7502 0.6 log (0.6 2.2226) 2 (0.4051 0.4506) 2.1416 0.2 (0.4279) 2.2272
0.6 log (0.6 2.2272) 1
2 (0.4051 0.4514) 2.1416 0.2 (0.4282) 2.2272
x log (x y) y Mean slope Old y 0.2 (mean slope) new y x x y y Mean slope Old y 0.2
0.6 0.4514 — 2.2272 0.2 (0.4514) 2.3175 (mean slope) new y
0.2 1 1 0.2 (1.1544) 1.2309
log (0.8 2.3175) 2.2272 0.2 (0.4726) 2.3217 0.2 1.2295 2 (1 1.3088)
1
0.8 2 (0.4514 0.4938)
log (1 2.4245) 1
2.3217 0.2 (0.5144) 2.4245 0.2 1.3094 — 1.2309 0.2 (1.3094) 1.4927
2 (0.4943 0.5346)
1.0
0.4 1 1.2309 0.2 (1.4654) 1.5240
0.4 1.4927 2 (1.3094 1.6218)
1.0 0.5346 — 2.4245 0.2 (0.5346) 2.5314
= 1.6218 = 1.4654
1.2 log (1.2 2.5314) 1
2 (0.5346 0.5719) 2.4245 0.2 (0.5532) 2.5351
0.4 1 1.2309 0.2 (1.4718) 1.5253
0.4 1.524 2 (1.3094 1.6345)
1.2 log (1.2 2.5351) 1
2 (0.5346 0.5723) 2.4245 0.2 (0.5534) 2.5351 = 1.4718
= 1.6345
1.2 0.5723 — 2.5351 0.2 (0.5723) 2.6496 0.4 1 1.2309 0.2 (1.4721) 1.5253
0.4 1.5253 2 (1.3094 1.6350)
1.4 log (1.4 2.6496) 1
2 (0.5723 0.6074)
2.5351 0.2 (0.5898) 2.6531 = 1.4721
= 1.6350
log (1.4 2.6531) 1
2.5351 0.2 (0.5900) 2.6531 0.4 1.6350 — 1.5253 0.2 (1.635) 1.8523
2 (0.5723 0.6078)
1.4
0.6 1 1.5253 0.2 (1.798) 1.8849
0.6 1.8523 2 (1.635 1.961)
Hence y(1.2) 2.5351 an d y(1.4) 2.6531 approximately. 1.798
= 1.9610
0.6 1 1.5253 0.2 (1.804) 1.8861
0.6 1.8849 2 (1.635 1.9729)
EXAMPLE 10.13
= 1.8040
= 1.9729
Using Euler’s modified method, obtain a solution of the equation
0.6 1 1.5253 0.2 (1.8042) 1.8861
dy/dx x y 0.6 1.8861 2 (1.635 1.9734)
= 1.8042
with initial conditions y 1 at x 0, for the range 0 £ x £ 0.6 in steps of 0.2. = 1.9734
1 1 1 1
k3 hf x0 h, y0 k2 0.2 f 0.1,1.09836 0.1967 k2 hf x0 h, y0 k1 0.1 f 0.05,1.1 0.1152
2 2 2 2
EXAMPLE 10.18
EXAMPLE 10.17
Using the Runge-Kutta method of fourth order, solve for y at x 1.2,
Apply the Runge-Kutta method to find the approximate value of y for
1.4
x 0.2, in steps of 0.1, if dy/dx x y2, y 1 where x 0.
dy 2 xy e x
From given x0 1, y0 0
Solution: dx x2 xe x
Given f(x, y) x y2. Solution:
Here we take h 0.1 and carry out the calculations in two steps. 2 xy e x
We have f ( x, y)
Step I. x0 0, y0 1, h 0.1 x2 xe x
k1 hf ( x0 , y0 ) 0.1 f 0,1 0.1000 To find y(1.2):
Here x01, y00, h0.2 This is Milne’s predictor-corrector method. To insure greater accuracy,
0 e we must first improve the accuracy of the starting values and then sub-
k1 hf ( x0 , y0 ) 0.2 0.1462 divide the intervals.
1 e
h k 2 1 0.10 0.073 e10.1
k2 hf x0 , y0 1 0.2 EXAMPLE 10.19
2 2 1 0.12 1 0.1 e10.1
0.1402 Apply Milne’s method, to find a solution of the differential equation
y x – y2 in the range 0 x 1 for the boundary condition y 0 at x 0.
1 1 2 1 0.10 0.07 e1.1
k3 hf x0 h, y0 k2 0.2 Solution:
2 2 1 0.12 1 0.1 e1.1
0.1399
Using Picard’s method, we have
x
2 1.2 0.1399 e1.2
y y 0 f ( x, y)dx, where f ( x, y) x y
2
k4 hf x0 h, y0 k3 0.2
0
1.2 2 1.2 e1.2
To get the first approximation, we put y 0 in f(x, y),
x x2
0.1348 Giving y1 0
0
xdx
2
1 1
and k k 2 k2 2 k3 k4 0.1462 0.2804 0.2798 0.1348 To find the second approximation, we put
6 1 6
0.1402 x x4 x2 x 5
Giving y2 x dx
0 4 2 20
Hence y(1.2) y0 k 0 0.1402 0.1402.
Similarly, the third approximation is
To find y (1.4):
x x5
2
x2 x2 x5 x8 x11
Here x1 1.2, y1 0.1402, h 0.2 y3 x 2 20 dx 2 20 160 4400
0
(i)
k1 hf ( x1 , y1 ) 0.2 f 1.2,0 0.1348
Now let us determine the starting values of the Milne’s method from
k2 hf x1 h/2, y1 k1 /2 0.2 f 1.3,0.2076 0.1303 (i), by choosing h 0.2.
k3 hf x1 h/2, y1 k2 /2 0.2 f 1.3,0.2053 0.1301 x0 0.0, y0 0.0000, f0 0.0000
x1 0.2, y1 0.020, f1 0.1996
k4 hf ( x1 h, y1 k3 ) 0.2 f 1.3,0.2703 0.1260
x2 0.4, y2 0.0795 f2 0.3937
1
k k 2 k2 2 k3 k4 x3 0.5, y3 0.1762, f3 0.5689
6 1
1 4h
y0 2 f1 f2 2 f3
( p)
0.1348 0.2606 0.2602 0.1260 Using the predictor, y4
6 3
0.1303
x 0.8 f4 0.7070
( p)
y4 0.3049,
Hence y(1.4) y1 k 0.1402 0.1303 0.2705. h
and the corrector, y2 f2 4 f3 f4 , yields
y(4c)
3
( c)
y4 0.3046 f4 0.7072 (ii)
Again using the corrector, Given y x(x2 y2) e–x, y(0) 1, find y at x 0.1, 0.2, and 0.3 by Taylor’s
series method and compute y(0.4) by Milne’s method.
y(5c) 0.4555, a value which is the same as before.
Solution:
Hence y(1) 0.4555.
Given y(0) 1 and h 0.1
We have y( x) x( x2 y2 )ex y0 0
EXAMPLE 10.20
( x3 xy2 )(ex ) (3 x2 y2 x(2 y)y)
y( x) ex
Using Milne’s method find y(4.5) given 5xy y 2 0 given y(4) 1,
2
y(4.1) 1.0049, y(4.2) 1.0097, y(4.3) 1.0143; y(4.4) 1.0187. x3 xy2 3 x2 y2 2 xyy
ex ; y0 1
Solution: y( x) e x3 xy2 3 x2 y2 2 xyy 6 x 2 yy 2 xy '2 2 xyy
x
We have y (2 – y2 )/5 x f ( x) [say] y0 2
Then the starting values of the Milne’s method are Substituting these values in the Taylor’s series,
2 12
x0 0, y0 1, f0 0.05 x x2 x3
5 4 y( x) y 0 y0 y0 y0
1! 2! 3!
x1 4.1, y1 1.0049, f1 0.0485
1 1
x2 4.2, y2 1.0097, f2 0.0467 y(0.1) 1 (0.1) 0 (0.1)2 1 (0.1)3 2
2 6
x3 4.3, y3 1.0143, f3 0.0452 1 0.005 – 0.0003 1.0047, i.e., 1.005
x4 4.4, y4 1.0187, f4 0.0437 Now taking x 0.1, y(0.1) 1.005, h 0.1
Since y5 is required, we use the predictor y0.1 0.092, y0.1 0.849, y0.1 1.247
4h
y5 y1 2 f2 f3 2 f4
( p)
(h 0.1) Substituting these values in the Taylor’s series about x 0.1,
3 0.1 0.12 0.13
y(0.2) y 0.1 y0.1 y0.1 y0.1
4 0.1 1! 2! 3!
x 4.5, y5 1.0049
( p)
2 2.0467 0.0452 2 0.0437 1.023
3 (0.1)2 (0.1)3
1.005 (0.1) 0.092 0.849 1247
2 6
=1.018
Now taking x 0.2, y(0.2) 1.018, h 0.1 1 1
k2 hf x0 h, y0 k1 0.1 f 0.05,1.05 0.1155
y0.2 0.176, y0.2 0.77, y 0.2 0.819 2 2
Substituting these values in the Taylor’s series 1 1
k3 hf x0 h, y0 k2 0.1 f 0.05,1.0577 0.1172
0.1 0.12 0.13 2 2
y(0.2) y 0.2 y0.2 y0.2 y0.2
1! 2! 3! k4 hf x0 h, y0 k3 0.1 f 0.1, 1.1172 0.13598
1.018 0.0176 0.0039 0.0001
1
1.04 k k 2 k2 2 k3 k4
Thus the starting values of the Milne’s method with h 0.1 are 6 1
1
x0 0.0, y0 1 f0 y00 0.1 0.231 0.2343 0.13598 0.11687
6
x1 0.1, y1 1.005 f1 0.092
Thus y(0.1) y1 y0 k 1.1169
x2 0.2, y2 1.018 f2 0.176
x3 0.3, y3 1.04 f3 0.26 To find y(0.2):
1 EXAMPLE 10.24
k k 2 k2 2 k3 k4 0.2267
6 1 dy
If 2 e x y, y(0) 2, find y(4) using the Adams predictor corrector
y(0.3) y3 y2 k 1.504 dx
Now the starting values for the Milne’s method are: formula by calculating y(1), y(2), and y(3) using Euler’s modified formula.
x0 0.0 y0 1.0000 f0 1.0000 Solution:
x1 0.1 y1 1.1169 f1 1.3591 We have f(x, y)2exy
x2 0.2 y2 1.2773 f2 1.8869 x 2exy Mean slope Oldy h (mean slop) new y
x3 0.3 y3 1.5049 f3 2.7132 0 4 2 0.1(4) 2.4
Using the predictor 0.1 0.1
2e (2.4) = 5.305 1 2 0.1 (4.6524) 2.465
2 4 5.305 4.6524
4h 2 4 5.465 4.7244
2 0.1 (4.7244) 2.472
y4 y0 2 f1 f2 2 f3 1
( p) 0.1 2e0.1(2.465) = 5.449
3
( p) 0.1 0.1
2e (2.4724) = 5.465 1 2 0.1 (4.7324) 2.473
x4 0.4 y4 1.8344 f4 4.0988 2 4 5.465 4.7324
Solve the initial value problem dy/dx x – y2, y(0) 1 to find y(0.4) by k1 hf ( x2 , y2 ) 0.1 f 0.25,0.8494 0.0521
Adam’s method. Starting solutions required are to be obtained using the 1 1
k2 hf x2 h, y2 k1 0.1 f 0.25,0.8233 0.0428
Runge-Kutta method of the fourth order using step value h 0.1 2 2
Solution: 1 1
k3 hf x2 h, y2 k2 0.1 f 0.25,0.828 0.0436
We have f(x, y) x – y2. 2 2
To find y(0.1): k4 hf x2 h, y2 k3 0.1 f 0.3,0.058 0.0349
Here x0 0, y0 1, h 0.1. k
1
k 2 k2 2 k3 k4 0.0438
6 1
k1 hf ( x0 , y0 ) 0.1 f 0, 1 – 0.1000
1 1 Thus y(0.3) y3 y2 k 0.8061
k2 hf x0 h, y0 k1 0.1 f 0.05,0.95 –0.08525
2 2 Now the starting values for the Milne’s method are:
1 1 x0 0.0 y0 1.0000 f0 0.0 (0.1)2 1.0000
k3 hf x0 h, y0 k2 0.1 f 0.05,0.9574 –0.0867
2 2 x1 0.1 y1 0.9117 f1 0.1 (0.9117)2 0.7312
k4 hf x0 h, y0 k3 0.1 f 0.1,0.9137 –0.07341 x2 0.2 y2 0.8494 f2 0.2 (0.8494)2 0.5215
1 x3 0.3 y3 0.8061 f3 0.3 (0.8061)2 0.3498
k k 2 k2 2 k3 k4 0 0.0883
6 1
h2 h3 Solution:
z2 z1 hz1 z z (6)
2! 1 3! 1 Here x0 0, y0 2, z0 1,
Since y1 and z1 are known, we can calculate y1 , y1, and z1 , z1, . Sub- dy
stituting these in (5) and (6), we get y2 and z2. and f ( x, y, z) x z
dx
Proceeding further, we can calculate the other values of y and z step dz
by step. ( x, y, z) x y2
dx
(iii) Runge-Kutta method is applied as follows: x x
y y0 x0
f ( x, y, z)dx and z z0
x0
( x, y, z)dx
Starting at (x0, y0, z0) and taking the step-sizes for x, y, z to be h, k, l
respectively, the Runge-Kutta method gives, First approximations
x x 1
k1 hf ( x0 , y0 , z0 ) y1 y0 x0
f ( x, y0 , z0 )dx 2
( x 1)dx 2 x x2
x0 2
l1 h ( x0 , y0 , z0 ) x x 1
1 1 1
z1 z0
x0
( x, y0 , z0 )dx 1
x0
( x 4)dx 1 4 x x2
2
k2 hf x0 h, y0 k1 , z0 l1
2 2 2 Second approximations
1 1 1 x x 1
l2 h x0 h, y0 k1 , z0 l1
2 2 2
y2 y0 x0
f ( x, y1 , z1 )dx 2 (1 4 x 2 x )dx
0
2
1 1 1 3 x3
k3 hf x0 h, y0 k2 , z0 l2 2 x x2
2 2 2 2 6
x
2
1 1 1 x 1 2
l3 h x0 h, y0 k2 , z0 l2
2 2 2
z2 z0 x0
( x, y1 , z1 )dx 1 x 2 x 2 x dx
x0
1 1 1 3 x4 x5
k4 hf x0 h, y0 k3 , z0 l3 1 4 x x2 x3
2 2 2 2 4 20
1 1 1 Third approximations
l4 h x0 h, y0 k3 , z0 l3
2 2 2 x 3 1 1 1 1 6
Hence
1
y1 y0 k1 2 k2 2 k3 k4
y3 y0 x0
f ( x, y2 , z2 )dx 2 x x2 x3 x 4 x 5
2 2 4 20 120
x
6 x
and
1
z1 y0 l1 2 l2 2 l3 l4
z3 z0 x0
( x, y2 , z2 )dx
6 3 5 7 31 1 1 7
To compute y2 and z2, we simply replace x0, y0, z0 by x1, y1, z1 in the 1 4 x x2 x3 x 4 x 5 x6 x
above formulae. 2 3 12 60 12 252
and so on.
When x 0.1
EXAMPLE 10.26
y1 2.105, y2 2.08517, y3 2.08447
Using Picard’s method, find approximate values of y and z correspond-
ing to x 0.1, given that y(0) 2, z(0) 1 and dy/dx x z, dz/dx x – y2. z1 0.605, z2 0.58397, z3 0.58672.
Hence y(0.1) 2.0845, z(0.1) 0.5867 EXAMPLE 10.28
correct to four decimal places. Solve the differential equations
dy dz
1 xz, xy for x 0.3
EXAMPLE 10.27 dx dx
Find an approximate series solution of the simultaneous equations dx/ using the fourth order Runge-Kuta method. Intial values are x 0,
dt xy 2t, dy/dt 2ty x subject to the initial conditions x 1, y – 1, y 0, z 1.
t 0. Solution:
Solution: Here f ( x, y, z) 1 xz, ( x, y, z) xy
x and y both being functions of t, Taylor’s series gives x0 0, y0 0, z0 1. Let us take h 0.3.
t2 t3
and x x
x(t) x0 tx0 (i) k1 h f (x0, y0, z0) 0.3 f (0, 0, 1) 0.3 (1 0) 0.3.
2! 0 3! 0
l1 h ( x0 , y0 , z0 ) 0.3 –0 0 0
t2 t3
y(t) y0 ty0 y0 y0
2! 3! 1 1 1
k2 hf x0 h, y0 k1 , z0 l1
Differentiating the given equations 2 2 2
x xy 2 t 0.3 f 0.15,0.15,1 0.3 1 0.15 0.345
(ii)
y 2 ty x 1 1 1
(iii) l2 h x0 h, y0 k1 , z0 l1
w.r.t. t, we get 2 2 2
0.3 0.150.15 0.00675
x xy xy 2 y 2 ty 2 y x
(iv) 1 k l
x xy xy xy xy y 2 ty 2 y 2 y x k3 hf x0 h, y0 2 , z0 2
2 2 2
Putting x0 1, y0 – 1, t0 0 in (ii), (iii), and (iv), we obtain 0.3 f 0.15,0.1725,0.996625
x0 – 1 2 0 –1 y0 1 0.3 1 0.996625 0.15 0.34485
x0 x0 y0 x0 y0 2 y0 0 2 y0 x0 1 k l
l3 h x0 h, y0 2 , z0 2
1.1 – 1 – 1 2 4 2 –1 –1 –3 2 2 2
x0 –3 – 11 4 –1 – 1 –9 y0 2 2 4 8 etc 0.3 0.150.1725 0.007762
1
i.e., y(0.3) 0 0.3 2(0.345) 2(0.34485) 0.3893 0.34483 Taylor’s series for y(1.1) is
6
1 h2 h3
z x h y0 l1 2 l2 2 l3 l4 y(1.1) y(1) hy(1) y1 y1 ....
and 2! 3!
6
Also y(1) 1, y(1) 1, y(1) z(1) 0, y(1) z(1) 1
1
i.e. z(0.3) 1 0 2 0.00675 2(0.0077625) (0.03104)
6 0.12 0.13
y(1.1) (1) 0.1(1) 0 0 1.1002.
0.98999 2 6
Taylor’s series for z(1.1) is
10.12 Second Order Differential Equations h2 h3
z(1.1) z(1) hz(1) z1 z1 ....
Consider the second order differential equation 2! 3!
d2 y dy Here z(1) 1, z(1) 0, z(1) 1, z(1) 3
f x, y,
dx2 dx 0.12 0.13
z(1.1) (1) 0.1(0) 1 3 1.0055
By writing dy/dx z, it can be reduced to two first order simultaneous 2 6
differential Equations Hence y(1.1) 1.1002 and z(1.1) 1.0055.
dy dz
z, f(x, y, z)
dx dx EXAMPLE 10.30
These equations can be solved as explained above. Using the Runge-Kutta method, solve y xy2 – y2 for x 0.2 correct
to 4 decimal places. Initial conditions are x 0, y 1, y 0.
EXAMPLE 10.29 Solution:
Find the value of y(1.1) and y(1.2) from y y2y x3; y(1) 1, y(1) Let dy/dx z f(x, y, z)
1, using the Taylor series method dy
Then xz2 – y2 ( x, y, z)
Solution: dx
We have x0 0, y0 1, z0 0, h 0.2
Let y z so that y z
Runge-Kutta formulae become
Then the given equation becomes z y2z z3
k1 hf(x0, y0, z0) 0.2(0) 0
y z
1 1 1
z x3 – y2z (i) k2 hf xo h, y0 k1 , z0 l1
2 2 2
such that y(1) 1, z(1) 1, h 0.1. (ii) 0.2 – 0.1 – 0.02
Now from (i) y z, y z, y z (iii) 1 1 1
k3 hf xo h, y0 k2 , z0 l2
z x3 y2 z, z 3 x2 y2 z 2 yz2 y z 2 2 2
0.2 – 0.0999 –0.02
and from (ii) z 6 x (y2 z 2 yyz) 2 yz2 y2 zz (iv)
k4 hf xo h, y0 k3 , z0 l3
6 x (y z 2 yz ) 2 z 2 yzz
2 2 3
0.2 – 0.1958 –0.0392
1 Expanding y(x) by Taylor’s series, we have
k k 2 k2 2 k3 k4 0.0199
6 1 x2 x3
y( x) y(0) xy1 (0) y (0) y3 (0)
l1 hf(x0, y0, z0) 0.2(– 1) – 0.2 2! 2 3!
1 1 1 x2 3 4 5 3 6
l2 h x0 h, y0 k1 , z0 l1 y( x) 1 x x (2)
2 2 2 2! 4! 6!
0.2(0.999) 0.1998 1 1
and z( x) y( x) x x3 x 5 xy, (3)
1 1 1 2 8
l3 h x0 h, y0 k2 , z0 l2
2 2 2 From (2), we have
0.2 – 0.9791 –0.1958 0.12 1 4
y 0.1 1 0.1 0.995
l4 h x0 h, y0 k3 , z0 l3 2 8
2 4
0.2 0.2
0.2 0.9527 –0.1905 y 0.2 1 0.9802
2 8
1
l l 2 l2 2 l3 l4 0.1970 0.32 0.34 0.36
6 1 y 0.3 1 0.956
Hence at x 0.2, 2 8 48
From (3), we have
y y0 k 1 – 0.0199 0.9801
z(0.1) – 0.0995, z(0.2) – 0.196, z(0.3) – 0.2863.
and y z z0 l 0 – 0.1970 – 0.1970.
Also from (1), z(x) – (xz y)
EXAMPLE 10.31 z(0.1) 0.985, z(0.2) – 0.941, z(0.3) – 0.87.
Given y xy y 0, y(0) 1, y(0) 0, obtain y for x 0(0.1) 0.3 by Applying Milne’s predictor formula, first to z and then to y, we obtain
4
any method. Further, continue the solution by Milne’s method to calculate z 0.4 z 0 0.1 2 z0.1 – z0.2 2 z0.3
y(0.4). 3
0.4
Solution: 0 – 1.79 0.941 – 1.74 –0.3692
3
Putting y z, the given equation reduces to the simultaneous equa-
4
tions and y 0.4 y 0 0.1 2 y0.1 – y0.2 2 y0.3 [ y z]
z xz y 0, y z (1) 3
0.4
We employ Taylor’s series method to find y. 0 – 0.199 0.196 – 0.5736 0.9231
3
Differentiating the given equation n times, we get
Also z(0.4) – {x(0.4) z(0.4) y(0.4)}
yn2 xn+1 nyn yn 0
– {0.4(– 0.3692) 0.9231} – 0.7754.
At x 0, (yn2)0 – (n 1)(yn)0
Now applying Milne’s corrector formula, we get
y(0) 1, gives y2(0) – 1, y4(0) 3, y6(0) – 5 × 3, ......
h
and y1(0) 0 yields y3(0) y5(0) ...... 0. z0.2 4 z0.3 z0.4
z 0.4 z 0.2
3
0.1
–0.196 –0.941 – 3.48 – 0.7754 –0.3692
3
h
and y0.2 4 y0.3 y0.4
y 0.4 y 0.2 Similarly in the fourth order of the Runge-Kutta method, the trunca-
3 tion error is of O(h5).
0.1
0.9802 –0.196 – 1.1452 – 0.3692 0.9232 In the Milne’s method, the truncation error
3
14 v 5
Hence y(0.4) 0.9232 and z(0.4) – 0.3692. due to predictor formula yn h
45
1
Exercises 10.6 and due to corrector formula ynv h 5 .
90
i.e., the truncation error in Milne’s method is also of O(h5).
1. Apply Picard’s method to find the third approximations to the values of y
and z, given that Similarly the error in the Adams-Bashforth method is of the fifth order.
dy/dx z, dz/dx x3(y z), given y 1, z 1/2 when x 0. Also the predictor error TP and the corrector error Tc are so related that
19TP – 251 Tc.
2. Using Taylor’s series method, find the values of x and y for t 0.4, The relative error of an approximate solution is the ratio of the total
satisfying the differential equations error to the exact value. It is of greater importance than the error itself for
dx/dt x y t, d2y/dt2 x – t with initial conditions x 0, y 1, if the true value becomes larger, then a larger error may be acceptable. If
dy/dt – 1 at t 0. the true value diminishes, then the error must also diminish otherwise the
3. Solve the following simultaneous differential equations, using Taylor computed results may be absurd.
series method of the fourth order, for x 0.1 and 0.2:
dy dz EXAMPLE 10.32
xz 1; xy; y 0 1.
dx dy Does applying Euler’s method to the differential equation
4. Find y(0.1), z(0.1), y(0.2), and z(0.2) from the system of equations: y dy/dx f(x, y), y(x0) y0, estimate the total error?
x z, z x – y2 given y(0) 0, z(0) 1 using Runge-Kutta method of the
fourth order. When f(x, y) – y, y(0) 1, compute this error neglecting the round-off
error.
5. Using Picard’s method, obtain the second approximation to the solution
of Solution:
d2 y dy 1 We know that Euler’s solution of the given differential equation is
x3 x3 y so that y 0 1.y0 .
dx2 dx 2 yn+1 yn hf(xn, yn) where xn x0 nh.
6. Use Picard’s method to approximate y when x 0.1, given that i.e., yn+1 yn hyn (1)
d2 y d2 y dy dy Denoting the exact solution of the given equation at x xn by y(xn) and
2 x 2 2 x y 0 and y 0.5, when x 0. expanding y(xn1) by Taylor’s series, we obtain
dx2 dx dx dx 0.1
7. Find y(0.2) from the differential equation y 3xy – 6y 0 where y(0) h2
, y n , xn n xn 1
y( xn1 ) y( xn ) hy( xn ) (2)
1, y(0) 0.1, using the Taylor series method. 2!
8. Using the Runge-Kutta method of the fourth, solve y y xy, y(0) 1, The truncation error Tn1 y(xn1) – yn1 (1/2)h2 y (n)
y(0) 0 to find y(0.2) and y(0.2). Thus the truncation error is of O(h2) as h 0.
To include the effect of round-off error Rn, we introduce a new ap- Also 1 hf0(xn, yn) 1 0.01(– 1) 0.99.
proximation yn which is defined by the same procedure allowing for the Neglecting the round-off error and using the above results, (5) gives
round-off error.
yn1 yn hf xn , yn Rn1 E0 0, E1 E0(0.99) T1 5 × 10–5 0.00005
(3)
E2 E1(0.99) T2 < 5 × 10–5 5 × 10–5 0.0001
The total error is defined by
En1 y( xn1 ) – yn1 E3 E2(0.99) T3 < 10–4 5 × 10–5 0.00015
[(2) – (3)]
E4 E3(0.99) T4 < 1.5 × 10–4 5 × 10–5 0.0002 etc.
h2
y( xn ) hy( xn )
2!
y n yn hf ( xn , yn ) Rn1 NOTE Obs. The exact solution is y e–x.
(4) Actual error in y(0.03) e–0.03 – 0.9703 0.00014
y( xn ) yn
h
h( xn ) f ( xn , yn )
Tn1 Rn1
and actual error in y(0.04) e–0.04 – 0.9606 0.00019.
Assuming continuity of f/y and using Mean-Value theorem, we have Clearly the total error E4 agrees with the actual error in y(0.04).
f[xn, y(xn)] – f(xn, yn) [y(xn) – yn] fy(xn, n ), where n lies between y(xn)
and yn. 10.14 Convergence of a Method
(4) takes the form Any numerical method for solving a differential equation is said to be
En1 [y( xn ) – yn
1 hf y xn , n Tn1 Rn1 convergent if the approximate solution yn approaches the exact solution
y(xn) as h tends to zero provided the rounding errors arise from the initial
or En1 En [1 hfy(xn, n )] Tn1 Rn+1 (5) conditions approach zero. This means that as a method is continually re-
This is the recurrence formula for finding the total error. The first terms fined by taking smaller and smaller step-sizes, the sequence of approximate
on the right-hand side is the inherited error, i.e., the propagation of the er- solutions must converge to the exact solution.
ror from the previous step yn to yn1. Taylor’s series method is convergent provided f(x, y) possesses enough
(b) We have dy/dx – y, y(0) 1. continuous derivatives. The Runge-Kutta methods are also convergent un-
der similar conditions. Predictor corrector methods are convergent if f(x, y)
Taking h 0.01 and applying (1) successively, we obtain
satisfies the Lipschitz condition, i.e.,
y(0.01) 1 0.01(– 1) 0.99
| f ( x, y) – f ( x, y) k y – y |,
y(0.02) 0.99 0.01 (– 0.99) 0.9801
k being a constant, then the sequence of approximations to the numeri-
y(0.03) 0.9703, y(0.04) 0.9606 cal solution converges to the exact solution.
The truncation error
Tn1 (1/2)h2y( ) 0.00005y ) 5 × 10–5 y(xn) [ dy/dx is – ve] 10.15 Stability Analysis
i.e., T1 5 × 10–5 y(0) 5 × 10–5 There is a limit to which the step-size h can be reduced for controlling
T2 5 × 10–5 y(0.01) 5 × 10–5 (0.99) < 5 × 10–5 the truncation error, beyond which a further reduction in h will result in
the increase of round-off error and hence increase in the total error. This
T3 5 × 10–5 y(0.02) 5 × 10–5 (0.9801) < 5 × 10–5 behavior of the error bound is shown in Figure 10.3.
T4 5 ×10–5 y(0.03) 5 × 10–5 (0.9703) < 5 × 10–5 etc. In such situations, we have to use stable methods so that an error intro-
duced at any stage does not get magnified.
A method is said to be stable if it produces a bounded solution which yn–1 (1 h) yn–2
imitates the exact solution. Otherwise it is said to be unstable. If a method .......................................
is stable for all values of the parameter, it is said to be absolutely or uncon-
ditionally stable. If it is stable for some values of the parameter, it is said to y2 (1 h) y1
be conditionally stable. y1 (1 h) y0
The Taylor’s method and Adams-Bashforth method prove to be rela- Multiplying all these equations, we obtain
tively stable. Euler’s method and the Runge-Kutta method are condition-
ally stable as will be seen from Example 10.23. yn (1 h)n y0 (2)
The Milne’s method is however, unstable since when the parameter is Integrating (1), we get y cex
negative, each of the errors is magnified while the exact solution decays. Using y(x0) y0, y0 cex0 y y0el(x–x0)
In particular, the exact solution through (xn, yn) is
xnx 0
ro
r yn y0 e y0 e nh [ xn x0 nh]
er r
tal rro
To e n
ti on h 2
ca or yn y0 (e h )n y01 h (3)
un 2
Tr
Error
Unstable Im(λh)
Stable
Round-off error
–2 –1 Re(λh)
Optimum, h
FIGURE 10.3
FIGURE 10.4
EXAMPLE 10.33 Clearly the numerical solution (2) agrees with exact solution (3) for
small values of h. The solution (2) increases if |1 h| > 1.
Does applying Euler’s method to the equation
Hence |1 h|< 1 defines a stable zone.
dy/dx y, given y(x0) y0,
When is real, then the method is stable if |1 h| < 1 i.e. – 2 < h < 0
determine its stability zone? What would be the range of stability when
– 1? When is complex ( a ib), then it is stable if
Solution: |1 (a ib) h | < 1 i.e. (1 ah)2 (bh)2 < 1
We have y y, y(x0) y0 (1) i.e., (x 1)2 y2 < 1, [where x ah, y bh.]
By Euler’s method, i.e., h lies within the unit circle shown in Figure 10.4.
yn yn–1 hyn–1 yn–1 hyn–1 (1 h)yn–1 [by (1) When is imaginary ( ib), |1 h| 1, then we have a periodic-stability.