Numerical Solution of ODEs
Numerical Solution of ODEs
CHAPTER
10
UMERICAL
OLUTION
OF
RDINARY
IFFERENTIAL
QUATIONS
Chapter Objectives
Introduction
Picard’s method
Runge’s method
Runge-Kutta method
Predictor-corrector methods.
Milne’s method
Adams-Bashforth method
Error analysis
Convergence of a method
Stability analysis
Boundary-value problems
Finite-difference method
Shooting method
420
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
10.1 Introduction
These methods are of even greater importance when we realize that com-
puting machines are now readily available which reduce numerical work
considerably.
in terms of a finite
closed
or
dx
), given
(1)
either
as a power se-
ries in
x
or
a set of values of
and
in (1) is approximated
The information
about the curve at one point is utilized and the solution is not iterated. As
single-step methods.
step-by-step
methods
over a lim-
ited range of
for finding
methods require starting values which are found by Picard™s Taylor series
or Runge-Kutta methods.
UMERIC AL
OLUTION
OF
O
RDINARY
IFFERENTIAL
QUATIONS
421
of the
22
,,/,/ ,)
(/0
nn
(2)
,,)
,,
(,0
xyc cc
(3)
constants
can be determined.
say:x
)
, then the dif-
initial value
problem
If the conditions are prescribed at two or more points, then the problem
is termed as
In this chapter, we shall first describe methods for solving initial value
and
shooting
method
(,)
dy
fxy
dx
(1)
value
0
when
(,) or (,)
dyfxydxyyfxydx
(2)
known
As a first approximation y
to the solution
, we put
y
0
in
) and
100
(, )
yyfxydx
, we put
in
(
x
) and integrate
(2), giving
yyfxydx
422
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
Similarly,
a third approximation is
302
(, )
yyfxydx
where
0
01
(,)
nn
yyfxydx
Obs.
EXAMPLE 10.1
dy
dx
, such that
1 when
Solution:
) We have
1()
x
yxydx
First approximation
Put
1 in
, giving
1(1)1/2
yxdxxx
Second approximation.
Put
y
1
/2
in
giving
223
1(1/2)1/6
yxxdxxxx
Third approximation.
Put
/6 in
x,
giving
34
232
3
1(1/6)12
324
xx
yxxxdxxx
Fourth approximation
. Put
in
, giving
34
0
345
112
324
312120
xx
yxxdx
xxx
xx
NOTE
UMERIC AL
OLUTION
OF
RDINARY
IFFERENTIAL
E
QUATIONS
423
in
, giving
345
3456
112
312120
31260720
x
xxx
yxxdx
xxxx
xx
(1)
ii
) Given equation
dy
yx
dx
is a Leibnitzs linear in
the solution is
xx
xxxx
yexedxc
xeedxcxeec
ycex
Since
1, when
0,
2.
21
yex
(2)
2!3!4!
xxx
ex
We get
3456
31260360
xxxx
yxx
(3)
Comparing (1) and (3), it is clear that (1), approximates to the exact
Obs.
At x
1,
3.433
approximation y
3.434
3.44.
EXAMPLE 10.2
for
,(0) 1.
dyyx
dxyx
Solution:
We have
0
yx
ydx
yx
NOTE
424
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
First approximation
. Put
y
00
111
12log(1)12log(1)
xx
yx
ydxdx
yxx
xxxx
2 log(1 +
x
) in the integrand,
giving
12log(1)
12log(1)
11
12log(1)
xxx
ydx
xxx
dx
0.1 in (
) we obtain
(0.1)
1 Œ (0.1)
2 log 1.1
0.9828.
(,)
dy
fxy
dx
(1)
dydy
ff
xydx
dx
i.e.
xy
yf ff
(2)
iv
yy
etc. Putting
and
0, the
Values of
000
(),( ),( )
yy y
can be obtained.
23
00
00000
()()
()() () ()...
2!3!
xxxx
yyxxyyy
(3)
for
from (3),
,
y
at
. In
this way, the solution can be extended beyond the range of convergence of
series (3).
UMERIC AL
OLUTION
OF
O
RDINARY
IFFERENTIAL
QUATIONS
425
Obs.
sections.
EXAMPLE 10.3
Solve
y, y
(0)
ues of y at
0.1 and
0.2.
Solution:
x
y
(0)
1[
(0)
1]
(0)
(0)
2
y
(0)
2, etc.
Taylor™s series is
23
00
00000
()()
()()()()
2!3!
xxxx
yyxxyyy
Here
0,
y
0
234
()()
11(2)(2)(4)
23! 4!
xxx
yx
Thus
34
0.10.1
3!4!
1.1103
and
34
0.20.2
0.21 0.20.2
36
1.2427
NOTE
426
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
EXAMPLE 10.4
y
at
0.1 and
0.2 to
dy
dx
yÐ
1,
(0)
1.
Solution:
2
y
Œ 1, (
Œ1[
(0)
1]
xy
, (
y
2
xy
, (
iv
xy
x
2
, (
iv
Œ 6, etc.
234
34
()()
11(0)(2)(6)
23! 4!
34
xxx
yx
xx
Hence
y
(0.1)
0.90033 and
(0.21)
0.80227
EXAMPLE 10.5
at
0.2 for
dy
dx
,y
(0)
Solution:
) We have
(0)
(0)
3.
x
0,
0 we get
(0)
(0)
3
e
(0)
(0)
21
iv
iv
(0)
(0)
3
45 etc.
234
234
234
()(0)(0)(0)(0)(0)
2!3!4!
92145
03
2624
92115
268
iv
xxx
yxyxyy y y
xxxx
xxxx
N
UMERIC AL
OLUTION
OF
RDINARY
IFFERENTIAL
QUATIONS
427
Hence
234
b
) Now
23
dy
ye
dx
is a Leibnitz™s linear in
Œ2
, the solution is
Œ2 .2 Œ2
3Œ3 or Œ3
xxxxxx
yeeedxcecyece
Since
0 when
0,
c
3.
3(
When
0.2,
3(
0.4
0.2
0.8112 (
ii
)
Comparing (
) and (
ii
), it is clear that (
EXAMPLE 10.6
32
dy xxy
dx
(0)
1 for
at
0.1,
0.2 and
x
0.3
Solution:
We have
32
;00
yxxyey
0,
1.
3222
3222Œ
Œ3.2 .
ŒŒ32;
()()()
() 01
x
x
yxxyexyxyye
xxyxyxyyey
3222Œ
22
2Œ
ŒŒ32 Œ
Œ3Œ.2 .62
()()
{()
[()]}
20Œ2
y xxyxy xyye
xyxyyxyy
yyxy yyey
Substituting these values in the Taylor™s series, we have
23
23
23
()(0)(0)(0)(0)
2!3!
1(0)(1)(2)
26
26
xx
yxyxyy y
xx
xx
428
•
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
Hence
23
23
23
11
23
11
23
11
0.310.3
()()
()()
() 0.3 1.036
23
()
EXAMPLE 10.7
log()
dy
xy
dx
for
(1.1)
and
y
(1.2), given
(1)
Solution:
We have
log
log
(1)
log 2
Differentiating w.r.t.,
and substituting
1,
2, we get
111
1log2
yyy
xy
22
111
111
11log2log2
224
yyyy
xy
1, we have
23
'
11
()(1)1(1)(1)(1)
2!3!
11
2( 1)log2( 1)1log2
22
1111
(1)log2log2
6244
xx
yxyxyyy
xx
x
23
(0.1)1(0.1)111
(1.1)2 (0.1)log21log2log2log2
22 6244
2.036
23
(0.2)1(0.2)111
(1.2)2 (0.2)log21log2log2log2
22 6244
2.081
UMERIC AL
OLUTION
OF
RDINARY
D
IFFERENTIAL
QUATIONS
429
Exercises 10.1
1.
dy
dx
xy
with
0,
1 up to the
third approximation.
2.
dy
dx
for
0.4, given
that
0 when
0.
3.
y
x
/(
1),
(0)
0.
4.
when
0.1, if
dy
dx
and
y
1
at
0, using
) Picard™s method (
) Taylor™s series.
5.
Solve
given
(1)
0. Find
(1.1) and
mals from
12
dy
xy
dx
given that
(0)
0.
7.
Evaluate
method if
) satisfies
xy
1,
(0)
1.
8.
Solve
(0)
(0.1) and
(0.2).
9.
Evaluate
methods if
dy
dx
(0)
1.
10.
given that
dy
dx
y
2
(0)
dy
dx
(1)
given that
0
,
on
this curve.
LL
+ hx
hx
+ nh
y
0
True value of
Error
Approx. value of
1
FIGURE 10.1
Let us divide
LM
into
at
so that
is quite small
In the interval
LL
. If the
ordinate through
1
meets this tangent in
), then
LP
R
1
PR
tan
0000
()
dy
yhyhfxy
dx
Let
1
be the curve of solution of (1) through
in
). Then
2
y
hf
) (1)
MP
of
MQ
given by
Œ1 0 Œ1
()
1,
nnn
yyhfxnhy
This is
EulerÕs method
Obs.
NOTE
UMERIC AL
OLUTION
OF
O
RDINARY
IFFERENTIAL
QUATIONS
431
EXAMPLE 10.8
corresponding to
1, given that
dy
dx
and
1 when
x
0.
Solution:
We take
10 and
xy
dy
dx
Old
dy
/
dx
new y
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
1.00
1.10
1.22
1.36
1.53
1.72
1.94
2.19
2.48
2.81
3.18
1.00
1.20
1.42
1.66
1.93
2.22
2.54
2.89
3.29
3.71
1.00
0.1 (1.00)
1.10
1.10
0.1 (1.20)
1.22
1.22
0.1 (1.42)
1.36
1.36
0.1 (1.66)
1.53
1.53
0.1 (1.93)
1.72
1.72
0.1 (2.22)
1.94
1.94
0.1 (2.54)
2.19
2.19
0.1 (2.89)
2.48
2.48
0.1 (3.29)
2.81
2.81
0.1 (3.71)
3.18
3.18.
Obs.
EXAMPLE 10.9
Given
dyyx
dxyx
at
0; find
for
0
.
by Euler™s method.
Solution:
i.e.,
we take
5 and
NOTE
432
UMERIC AL
ETHODS
IN
E
NGINEERING
AND
CIENCE
xydy
dx
Oldy
02
dy
dx
new y
0.00
0.02
0.04
0.06
0.08
0.10
1.0000
1.0200
1.0392
1.0577
1.0756
1.0928
1.0000
0.9615
0.926
0.893
0.862
1.0000
0.02(1.0000)
1.0200
1.0200
0.02(0.9615)
1.0392
1.0392
0.02(0.926)
1.0577
1.0577
0.02(0.893)
1.0756
1.0756
0.02(0.862)
1.0928
1.0928.
LL
is approxi-
, we have
y
hf
) (1)
[i.e.,
dy
dx
)
P
)]
to
through
L
2
in
).
(1)
of
0
h
and
i.e.,
(1)
100001
[(,)(,)]
yyfxyfxhy
as found in (1)
by Euler™s method and insert it on R.H.S. of (2) to obtain the first modified
value
y
(1)
1(2)
corresponding
to
as
(2)(1)
100001
[(,)(,)]
yyfxyfxhy
L
2
Once
corresponding to
hf
y
1
(1)
(1)
210 10 2
[(,)(2,)]
yy fxhyfxhy
UMERIC AL
OLUTION
OF
RDINARY
IFFERENTIAL
E
QUATIONS
433
late
This is the
EXAMPLE 10.10
when
0
.
3, given that
dy
dx
and
when
0.
Solution:
0.1:
Mean slope
Old y
mean slope
new y
0.0
1.00
0.1 (1.00)
1.10
0.1
0.1
1.1
()
11.2
1.00
0.1 (1.1)
1.11
0.1
0.1
1.11
11
()
.21
1.00
0.1 (1.105)
1.1105
0.1
0.1
1.1105
11.
()
2105
1.00
0.1 (1.1052)
1.1105
y
(0.1)
1.1105.
0.1 1.2105Š
1.1105
0.1 (1.2105)
1.2316
0.2
0.2
1.2316
1.121051.4
()
316
1.1105
0.1 (1.3211)
1.2426
0.2
0.2
1.2426
1.21051.4
()
426
1.1105
0.1 (1.3266)
1.2432
0.2
0.2
1.2432
1.21051.4
()
432
1.1105
0.1 (1.3268)
1.2432
(0.2)
1.2432.
0.2 1.4432Š
1.2432
0.1 (1.4432)
1.3875
0.3
0.3
1.3875
2
1.44321.6
()
875
1.2432
0.1 (1.5654)
1.3997
0.3
0.3
1.3997
1.44321.6
()
997
1.2432
0.1 (1.5715)
1.4003
0.3
0.3
1.4003
1.44321.7
()
003
1.2432
0.1 (1.5718)
1.4004
0.3
0.3
1.4004
1.4432 1.7
()
004
1.2432
0.1 (1.5718)
1.4004
(0.3)
1.4004.
434
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
Hence
(0.3)
1.4004 approximately.
Obs.
for x
2ex Ð x Ð 1 by
putting x
0.3.
EXAMPLE 10.11
(0
.
2) and
(0
4)
given
,y
(0)
Solution:
We have
y
ex
);
0,
0 and
0.2
To calculate
(0
2)
ex
y
Mean slope
Old y
Mean slope
new y
0.01 Š
0.2 (1)
0.2
0.2
0.2
0.2
1.4214
1 1.42141.
)07
(21
0.2 (1.2107)
0.2421
0.2
0.2421
0.2
1.4635
1 1.46351.
)17
(23
0.2 (1.2317)
0.2463
0.2
0.2463
0.2
1.4677
11.467
()
2
71.2338
0.2 (1.2338)
0.2468
0.2
0.2468
0.2
1.4682
1 1.468
()1
2.2341
0.2 (1.2341)
0.2468
(0.2)
0.2468.
To calculate y
(0
4)
ex
Mean slope
Oldy
mean slope
new y
0.2
0.2468
0.2
1.4682
Š
0.2468
0.2 (1.4682)
0.5404
0.4
0.5404
0.4
2.0322
1.46822.0322)
1.7502
0.2468
0.2 (1.7502)
0.5968
NOTE
UMERIC AL
OLUTION
OF
RDINARY
IFFERENTIAL
QUATIONS
435
ex
Mean slope
Oldy
mean slope
new y
0.4
0.5968
0.4
2.0887
1.46822.0
()
887
1.7784
0.2468
0.2 (1.7784)
0.6025
0.4
0.6025
0.4
2.0943
(1.46822.09)
= 1.7 5
43
812
0.2468
0.2 (1.78125)
0.6030
0.4
0.6030
0.4
2.0949
1.46822.0
= 1.
949
781
0.2468
0.2 (1.7815)
0.6031
0.4
0.6031
e
0.4
2.0949
1.46822.0
()
= 1.
49
781
0.2468
0.2 (1.7815)
0.6031
(0.4)
0.6031
Hence
(0.2)
0.2468 an d
(0.4)
0.6031 approximately.
EXAMPLE 10.12
log()()
,02
dy
xyy
dx
at
and
4
with
2.
Solution:
log
Mean slope
Old y
(
mean slope
new y
0.0
0.2
0.2
log (0
2)
log (0.2
2.0602)
log (0.2
2.0655)
0.310
()
0.3541
0.301
()
0.3552
2
0.2(0.301)
2.0602
0.2 (0.3276)
2.0655
0.2 (0.3281)
2.0656
0.2
0.4
0.4
0.3552
log (0.4
2.1366)
log (0.4
2.1415)
0.35520.4)
(042
0.35520.4
()
051
2.0656
0.2 (0.3552)
2.1366
2.0656
0.2 (0.3797)
2.1415
2.0656
0.2 (0.3801)
2.1416
0.4
0.6
0.6
0.4051
log (0.6
2.2226)
log (0.6
2.2272)
0.4051 0.4
()
506
1
2
0.4051 0.4
()
514
2.1416
0.2 (0.4051)
2.2226
2.1416
0.2 (0.4279)
2.2272
2.1416
0.2 (0.4282)
2.2272
436
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
log
Mean slope
Old y
mean slope
new y
0.6
0.8
0.8
0.4514
log (0.8
2.3175)
log (0.8
2.3217)
0.45140.4
()
938
0.45140.4
()
943
2.2272
0.2 (0.4514)
2.3175
2.2272
0.2 (0.4726)
2.3217
2.2272
0.2 (0.4727)
2.3217
0.80.4943Š
2.3217
0.2 (0.4943)
2.4206
1.0
log (1
2.4206)
0.4943)
0.5341
2.3217
0.2 (0.5142)
2.4245
1.0
log (1
2.4245)
0.49430.5
()
346
2.3217
0.2 (0.5144)
2.4245
1.00.5346Š
2.4245
0.2 (0.5346)
2.5314
1.2
log (1.2
2.5314)
0.53460.5
()
719
2.4245
0.2 (0.5532)
2.5351
1.2
log (1.2
2.5351)
0.53460.5
()
723
2.4245
0.2 (0.5534)
2.5351
1.20.5723Š
2.5351
0.2 (0.5723)
2.6496
1.4
log (1.4
2.6496)
0.57230.6
()
074
2.5351
0.2 (0.5898)
2.6531
1.4
log (1.4
2.6531)
0.57230.6
()
078
2.5351
0.2 (0.5900)
2.6531
Hence
(1.2)
2.5351 an d
(1.4)
2.6531 approximately.
EXAMPLE 10.13
dydxxy
at
£0
in steps of
2.
Solution:
xyy
Mean slope
Old y
mean slope
)
new y
0.0
0.2 (1)
1.2
0.2
0.21.2
= 1.2954
11.2954
()
= 1.1477
0.2 (1.1477)
1.2295
UMERIC AL
S
OLUTION
OF
RDINARY
IFFERENTIAL
QUATIONS
437
xyy
Mean slope
Old y
mean slope
new y
0.2
0.21.2295
= 1.3088
11.3088
()
= 1.1544
0.2 (1.1544)
1.2309
0.2
0.21.2309
= 1.3094
11.3094
()
= 1.1547
0.2 (1.1547)
1.2309
0.21.3094Š
1.2309
0.2 (1.3094)
1.4927
0.4
0.41.4927
= 1.6218
1.30941.6
()
= 1.
18
465
1.2309
0.2 (1.4654)
1.5240
0.4
0.41.524
= 1.6345
1.30941.6
()
= 1.
45
471
1.2309
0.2 (1.4718)
1.5253
0.4
0.41.5253
= 1.6350
1.3094 1.6
()
= 1.
50
472
1.2309
0.2 (1.4721)
1.5253
0.41.6350Š
1.5253
0.2 (1.635)
1.8523
0.6
0.61.8523
= 1.9610
1.6351.961)
1.798
1.5253
0.2 (1.798)
1.8849
0.6
0.61.8849
= 1.9729
1.6351.97
()
= 1. 0
29
804
1.5253
0.2 (1.804)
1.8861
0.6
0.61.8861
= 1.9734
1
2
1.6351.97
()
= 1. 2
34
804
1.5253
0.2 (1.8042)
1.8861
Hence
(0.6)
1.8861 approximately.
Exercises 10.2
1.
(0)
0,
choosing the step length
2.
when
0.6 of
dy
dx
1Œ2
xy
, given that
0 when
0 (take
0.2).
3.
at
0.1 from
dy
dx
xy
(0)
0.025.
438
UMERIC AL
ETHODS
IN
E
NGINEERING
AND
CIENCE
4.
Solve
1Œ
(0)
at
5.
Given that
dy
dx
x
and
(0)
(0.1), taking
6.
Given
sin
(0)
1. Compute
y
(0.2) and
(0.4) with
0.2
7.
Given
dyyx
dxyx
1 when
0, find
approximately
for
8.
Given that
/2
dydxxy
and
y
1 when
1. Find approximate
value of
at
00
(,),()
dy
fxyyxy
dx
(1)
0
) is
) (Figure 10.2).
) to (
0
k
), we have
00
00
(,)
ykxh
yx
dyfxydx
(2)
L N M
S
1
FIGURE 10.2
Carl Runge
(1856-1927).
UMERIC AL
OLUTION
OF
RDINARY
IFFERENTIAL
QUATIONS
•
439
as the mid-point of
LM
)(
i.e., dy
dx
) at the points
h
/2,
. For
at these points.
PQ
in
PT
in
. The value of
S
1
110
. tan
yNSLPHSyPH
00
00
()
/(,
yhdydxyfxy
(3)
Also
000
.tan( ).
hfxy
yMTLPRTyPRy
Now the value of
at
through
y
T
) meets
MQ
Slope at
00000
tan ,,
())]
[(
Tfxhyfxhyhfxy
000000
.tan[,(, )]
yRRTyPRyhfxhyhfxy
(4)
,
y
) at
),
the value of
) at
x
0
/2, y
) at
)
where
and
000 0
(,)4
()(/2,)(,
xh
PSQ
SQ
kfxydxfff
fxyfxhyxhy
by Simpson™s rule
for equi-spaced
points.
Working rule
to solve
(1)
by RungeÕs method
Calculate successively
100
(, ),
khfxy
2001
11
22
khfxhy k
001
khfxhyk
440
UMERIC AL
ETHODS
IN
NGINEERING
AND
S
CIENCE
and
300
khfxhyk
Finally compute,
123
kkkk
k.
(Note that
,
k
, and
).
EXAMPLE 10.14
when
given that
dy
dx
and
1
when
0.
Solution:
Here we have
0,
1,
0.2,
)
1
100
(, )0.210.200
khfxy
2001
11
0.240
0.20.1,1.1
22
khfxhy kf
001
,0 0.
.20.2,28
20
1.
khfxhyk f
and
300
,0.20.1,1.280.296
khfxhykf
123
11
k4kk0.2000.9600.0.242
66
29
is 1.2426.
do not require the calculations of higher order derivatives and give greater
only the function values at some selected points. These methods agree with
where
10.4) gives
100000
(, )
yyhfxyyhy
,
y
)]
UMERIC AL
OLUTION
OF
RDINARY
IFFERENTIAL
QUATIONS
441
10000
()
h
yyxhyhyy
It follows that the Euler™s method agrees with the Taylor™s series solu-
Hence,
10001
(, )(, )
yyfxyfxhy
(1)
Substituting
y
0
hf
100000
(),
yyf fxhyhf
where
,
y
) (2)
23
100000
2!3!
hh
yyxhyhyyy
(3)
Expanding
0
hf
2**
1000000
(,)()
ff
yyffxy hhf Oh
xy
23
000
ff
yhfhfhOh
xy
2
000
yhffOh
dfxy
ff
dxxy
000
2!
yhyyOh
(4)
Comparing (3) and (4), it follows that the modified Euler™s method
agrees with the Taylor™s series solution upto the term in
second order.
**
fl and is read as
order of h
442
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
1012
yykk
Where
hf
,
y
) and
hf
iii
As such,
10123
yykkk
Where
1002001
11
(,), ,
22
khfxykhfxhyk
And
300
,,
khfxhyk
where
3001
(,)
kkhfxhyk
iv
Runge-Kutta method
only.
Working rule
(,),()
dy
fxyyx
dx
is as follows
:
Calculate successively
hf
),
2001
3002
11
22
11
22
khfxhy k
khfxhyk
and
4003
khfxhyk
Finally compute
1234
22
kkkkk
k
1
,k
,k
, and
).
Obs.
or non-linear.
NOTE
UMERIC AL
OLUTION
OF
RDINARY
IFFERENTIAL
E
QUATIONS
443
EXAMPLE 10.15
value of
when
given that
dy
dx
and
y
1
when
Solution:
Here
0,
1,
0.2,
y
0
100
(,)0.21= 0.2000
khfxy
2001
11
0.2400
,0.20.1,1.1
22
khfxhy kf
3002
11
,0.20.1,1.12
22
0.2440
khfxhykf
and
4003
,0.20.2,0.288
1.248
khfxhykf
1234
22
0.20000.48000.48800.2888
1.45680.2428
kkkkk
is 1.2428.
EXAMPLE 10.16
22
dyy x
dx
yx
with
(0)
at
4.
Solution:
We have
22
22
(,)
yx
fxy
yx
To find
(0.2)
Hence
0,
1,
0.2
100
(,)0.20,10.2000
khfxyf
2001
11
,0.20.1,1.1
22
0.19672
khfxhy kf
444
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
3002
0.1967
11
,0.20.1,1.09836
22
khfxhyk f
4003
,0.20.2,1.0.1
198
6791
khfxhykf
1234
22
kkkkk
91
6
Hence
(0.2)
1.196.
To find
(0
4):
Here
0.2,
1.196,
0.2.
111
(,0.1891
khfxy
2111
0.1795
11
,0.20.3,1.2906
22
khfxhykf
3112
0.1793
11
,0.20.3,1.2858
22
khfxhyk f
4113
,0.20.4,1.0.1
376
5388
khfxhykf
1234
22
kkkkk
.79
Hence
(0.4)
1.196
0.1792
1.3752.
EXAMPLE 10.17
for
in steps of
1, if
dy
dx
,y
1
where
0.
Solution:
Given
x, y
Here we take
Step I
.x
0,
y
0
1,
0.1
100
(,)0.10,10.1000
khfxyf
UMERIC AL
OLUTION
OF
RDINARY
IFFERENTIAL
QUATIONS
445
2001
11
,0.10.05,1.1
22
0.1152
khfxhy kf
3002
0.1168
11
,0.10.05,1.1152
22
khfxhykf
4003
,0.10.1,1.0.1
113
6847
khfxhykf
1234
22
6
kkkkk
0.10000.23040.23360.13470 1
.1 65
giving
(0.1)1.1165
yyk
Step II. x
0.1,
1
1.1165,
0.1
111
(,)0.10.1,1.11650.1347
khfxyf
2111
0.1551
11
,0.10.15,1.1838
22
khfxhykf
3112
0.1576
11
,0.10.15,1.194
22
khfxhykf
4123
( ,)0.10.2,1.0.1823
1576
khfxhykf
1234
0.15
221
kkkkk
Hence
(0.2)1.2736
yyk
EXAMPLE 10.18
at
2
,
From
dyxye
dx
xxe
given
,y
Solution:
We have
(,)
xye
fxy
xxe
To find
(1
2)
446
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
Here
,y
,h
100
(,)0.20.1462
khfxy
e
10.1
200
10.1
21 0.100.073
,0.2
22
1 0.11 0.1
0.1402
he
khfxy
1.1
3002
2
1.1
1 121 0.100.07
,0.2
22
1 0.11 0.1
0.1399
khfxhyk
1.2
4003
1.2
21.2 0.1399
,0.2
1.21.2
0.1348
khfxhyk
e
and
1234
11
220.14620.28040.27980.1348
66
0.1402
kkkkk
Hence
(1.2)
0.1402
0.1402.
To find
(1
4)
Here
11
1.2,0.1402,0.2
xyh
111
(,)0.21.2,00.1348
khfxyf
2111
/2,/20.21.3,0.20760.1303
khfxhykf
3112
/2,/20.21.3,0.20530.1301
khfxhyk f
4113
( ,)0.21.3,0.27030.1260
khfxhykf
1234
1
22
0.13480.26060.26020.1260
0.1303
kkkkk
Hence
(1.4)0.14020.13030.2705.
yyk
UMERIC AL
OLUTION
OF
RDINARY
D
IFFERENTIAL
QUATIONS
447
Exercises 10.3
1.
when
1.2
when
1 and
dy
dx
y
2
2.
dy
dx
(0)
1 taking
0.1.
3.
(0.2) and
y
(0.4)
from 10
22
dy
xy
dx
(0)
1, taking
0.1.
4.
when
that
dy
dx
2
y
and
(1)
1.5.
5.
Given
dy
dx
(0)
2. Compute
(0.2),
y
(0.4), and
(0.6) by the
6.
Find
(0.1) and
given that
and
(0)
1.
7.
h
0.1, given
(0)
3.
dy
dx
(4
xy
). Calculate
for
8.
for
0.6,
given that
y
0.41 when
0.4 and
dydxxy
9.
dyyx
dxyx
(0)
1. Take
0.2.
10.
32
Œ212Œ208.5,
yxxx
1 at
0.
11.
at
dy
dx
(0)
0 and
0.1.
12.
Given that
dy
dx
Œ2
)/(
) and
1 at
0, find
for
0.1,
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
If
Œ1
and
i
are two consecutive mesh points, we have
Œ1
. In
-10-1
(-1,);1,2,3
iii
yyhfxihyi
(1)
-1-1-1
(,)(,)
iiiiii
h
yyfxyfxy
The value of
. This value of
. This step
agree.
predictor-corrector method.
called the
predictor
corrector
of
the predictor-corrector methods, four prior values are needed for finding
the value of
at
i
.
Adams-Bashforth method.
Given
dy
dx
x, y
and
,x
for
x
x
nh
The value y
h
),
),
),
),
y
1
),
),
0
3
Then to find
tion formula
23
0000
(1)(1)(2)
(,)
26
nnnnn
fxyf nfff
UMERIC AL
OLUTION
OF
RDINARY
IFFERENTIAL
QUATIONS
449
In the relation
40
(,)
xh
yyfxydx
40000
...
xh
nn
yyfnf fdx
[Put
0
nh
dx
hdn
0000
...
nn
yfnffdn
0000
20
48 ...
yhfff
Neglecting fourth and higher order differences and expressing
23
000
,and
ff f
()
40123
22
yyff f
which is called a
predictor
Having found
404
(4,)
ffx hy
42234
yyfff
which is called a
corrector
y
4
remains
unchanged. Once
and
predictor
as
()
51234
4
22
yyfff
and
of
5
is obtained from the
corrector
as
()
53345
yyfff
calculate
as before.
450
N
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
This is
we must first improve the accuracy of the starting values and then sub-
EXAMPLE 10.19
yxy
in the range
0
x
at
0.
Solution:
0(,),
yyfxydx
where
(,)
fxyxy
y
0 in
),
Giving
yxdx
Giving
425
4220
yxd
xx
x
252581
2202201604400
yxd
xxxxxx
Now let us determine the starting values of the Milne™s method from
), by choosing
0.2.
x
0.0,
0.0000,
0.0000
0.2,
0.020,
0.1996
x
0.4,
0.0795
0.3937
0.5,
0.1762,
0.5689
40123
22
yyff f
0.8
()
0.3049,
0.7070
()
42 234
4,
3
yyfff
yields
()
0.3046
0.7072 (
ii
UMERIC AL
OLUTION
OF
O
RDINARY
IFFERENTIAL
QUATIONS
451
corrector
()
0.3046,
()
41234
22
3
yyfff
0.1,
()
0.4554
0.7926
()
53345
yyfff
gives
()
0.4555
0.7925
()
0.4555,
Hence
(1)
0.4555.
EXAMPLE 10.20
(4
5)
given
xy
0 given
(4)
(4
.
1)
0049
,y
(4
2)
0097
,y
(4
3)
0143
;y
(4
.
4)
0187
Solution
We have
(2Œ )/5()
yyxfx
[say]
0,
0
1,
212
0.05
54
4.1,
1.0049,
0.0485
4.2,
2
1.0097,
0.0467
4.3,
1.0143,
0.0452
4.4,
4
1.0187,
0.0437
Since
()
51234
22
yyfff
0.1)
4.5,
()
4 0.1
1.004922.04670.045220.04371.023
452
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
2
21.023
0.0424
554.5
()
53345
yyfff
, we get
()
5
0.1
1.01430.045240.04370.04241.023
Hence
(4.5)
1.023
EXAMPLE 10.21
Given
Ðx
,y
(0)
1
find
at
2,
and
by Taylor™s
(0
.
4)
by Milne™s method.
Solution:
Given
(0)
1 and
0.1
We have
22
()( )
yxxxye
00
32 22
()()()(3(2))
xx
yxxxyexyxyye
3222
32
exxyxy xyy
01
32222
()3262 2'2
02
y xexxyxy xyyxyyxyxyy
23
()0000
1!2!3!
xx x
yxyyyy
23
11
(0.1)1(0.1)0(0.1)1 (0.1)2
26
0.005 Œ 0.0003
1.0047,
i.e.,
1.005
Now taking
0.1,
(0.1)
1.005,
0.1
0.10.092,0.10.849,0.11.247
yy y
Substituting these values in the Taylor™s series about
0.1,
23
0.1 0.10.1
(0.2)0.10.10.10.1
1!2!3!
yyyyy
23
(0.1)(0.1)
1.005(0.1)0.0920.8491247
26
=1.018
UMERIC AL
OLUTION
OF
O
RDINARY
IFFERENTIAL
QUATIONS
453
Now taking
0.2,
(0.2)
1.018,
0.1
0.20.176,0.20.77,0.20.819
yyy
23
0.10.10.1
(0.2)0.20.2 0.20.2
1!2!3!
yyyyy
1.018
0.0176
0.0039
0.0001
1.04
0.1 are
0.0,
0
y
0.1,
1.005
0.092
0.2,
2
1.018
0.176
0.3,
1.04
0.26
()
40123
22
h
yyff f
2 0.0920.1
4 0.1
1[76]
2 0.2
1.09.
0.4
()
1.09,
0.40.362
fy
()
42 234
4,
yyfff
yields
()
0.1
Hence
(0.4)
1.071
EXAMPLE 10.22
find
y
for
given that
dy
dx
xy
,y
(0)
1. Continue the solution at
using
Milne™s method.
Solution:
We have
xy
To find
y
(0
1)
Here
0,
1,
0.1.
100
(,)0.1 0,0.10
100
khfxyf
454
•
N
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
2001
11
,0.1 0.0.1155
5,1.05
22
khfxhy kf
3002
0.1172
11
,0.1 0.05,1.0577
22
khfxhykf
4003
1.1172
khfxhykf
1234
22
kkkkk
0.1 0.2310.23430.13590.1 6 7
818
Thus
10
(0.1)1.1169
yyyk
To find
(0
2)
Here
,y
1169
,h
1
111
,0.1 0.1,1.1160 13 9
9.5
khfxyf
2111
0.1581
11
,0.1 0.15,1.1848
22
khfxhykf
3112
0.1609
11
,0.1 0.15,1.1959
22
khfxhykf
4113
,0.1 0.20.1888
,1.2778
khfxhykf
1234
0.16
225
kkkkk
Thus
(0.2)
1.2773.
To find
y
(0
3)
Here
0.2,
1.2773,
0.1.
122
1.27 37
khfxyf
2221
0.2224
11
,0.1 0.25,1.3716
22
khfxhy kf
3222
0.2275
11
,0.10.25,1.3885
22
khfxhykf
4223
,0.10.3,1.0.2
507
4816
khfxhykf
UMERIC AL
OLUTION
OF
RDINARY
IFFERENTIAL
QUATIONS
455
1234
0.22
227
kkkkk
32
(0.3)1.504
yyyk
0.0
1.0000
1.0000
0.1
1.1169
1.3591
2
0.2
1.2773
1.8869
0.3
1.5049
2.7132
Using the
predictor
()
40123
22
yyff f
()
444
0.41.83444.0988
xyf
and the
corrector
()
42 234
yyfff
()
0.1
1.27731.88694 2.71324.098
1.8397
4.1159.
corrector
()
0.1
1.27731.88694 2.71324.1159
c
y
1.8391
4.1182 (i)
corrector
()
0.1
1.27731.88694 2.71324.1182
Hence
(0.4)
1.8392.
Exercises 10.4
1.
Given
dy
xy
dx
(0)
2. The values of
(0.2)
2.073,
(0.4)
2.452,
and
(0.6)
0.2
456
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
2.
Given 2
dy
dx
(1
2
)
and
(0)
1,
(0.1)
1.06,
(0.2)
1.12,
(0.3)
1.21, evaluate
3.
1,(0)1
dy
xyy
dx
for
4.
at
corrector formula:
dy
dx
/2:
x
1
5.
dy
xyx
dx
(0)
1; at
0.1,
method.
6.
If
2
e
(0)
2,
(0.1)
2.01,
(0.2)
2.04, and
2.09, find
7.
(0.1),
(0.2), and
(0.3)
given that
1.
dyxy
dx
(0)
ues, find
Given
(,)
dy
fxy
dx
and
0
y
), we compute
102030
(),(2),(3)
yyxhyyxhyyxh
Next we calculate
10 120230 3
(,), (2,),(3,)
ffxhyffxhyffxhy
Then to find
23
0000
(1)(1)(2
(,)
26
nnnnn
fxyf nfff
UMERIC AL
OLUTION
OF
RDINARY
IFFERENTIAL
QUATIONS
457
in
0
0
10
(,)
xh
yy fxy
(1)
1000 0
(1)
nn
yyfnffdx
[Put
0
nh
dx
hdn
0000
(1)
nn
yhfnffdn
23
00 0 00
153
2128
yhffff
23
00 0
, and
fff
100123
55 5937 9
24
yyff ff
(2)
Having found
, we find
f
(
).
1, we derive a
corrector formula
by sub-
1,
i.e.,
23
1111
(1)(1)(2
(,)
26
nnnnn
fxyfnfff
in
(1)
10111
(1)
nn
yy fnffdx
[Put
1
nh
dx
h dn
0111
(1)
nn
yfnffdn
23
01101
111
21224
yhf fff
23
111
, and
fff
()
101012
91959
24
yy ffff
458
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
remains
as above.
Obs.
(2) and (3) above together with the fourth order Runge-Kutta
EXAMPLE 10.23
Given
dy
xy
dx
and
(1)
,y
(1
1)
1
.
233
,y
(1
2)
548
(1
3)
979, evaluate
(1
Solution:
Here
(1
0.1 are
1.0,
Œ3
1.000,
Œ3
(1.0)
(1
1.000)
2.000
1.1,
Œ2
1.233,
Œ2
2.702
1.2,
Œ1
1.548,
Œ1
3.669
x
1.3,
1.979,
5.035
Using the
predictor,
()
100123
55 5937 9
24
yyffff
411
1.4,2.5737.004
xyf
Using the
corrector
()
101012
9195
24
yy ffff
()
0.1
1.97997.00419 5.03553.6692.7022.575
24
Hence
(1
4)
2
.
575
NOTE
UMERIC AL
OLUTION
OF
RDINARY
IFFERENTIAL
QUATIONS
459
EXAMPLE 10.24
If
2,
dy
ey
dx
(0)
find
formula by calculating
(1),
(2), and
Solution
We have
x, y
e
x
yMean slope
Oldy
mean slop
new y
04
0.1(4)
2.4
12
0.1
(2.4) = 5.305
2
45.3054.6524
0.1 (4.6524)
2.465
12
0.1
(2.465) = 5.449
45.4654.7244
0.1 (4.7244)
2.472
12
0.1
(2.4724) = 5.465
45.4654.7324
2
0.1 (4.7324)
2.473
12
0.1
(2.478) = 5.467
45.467 4.7333
0.1 (4.7333)
2.473
15
467
0.1 (5.467)
3.0199
22
e
0.2
(3.0199) = 7.377
5.4677.3776.422
2.473
0.1 (6.422)
3.1155
27
611
5.4677.6116.539
2.473
0.1 (6.539)
3.127
27
639
1
2
5.4677.6396.553
2.473
0.1 (6.553)
3.129
27
643
5.4677.6436.555
2.473
0.1 (6.555)
3.129
27
463
3.129
0.1 (7.643)
3.893
0
.
32
0.3
(3.893) = 10.51
7.64310.519.076
3.129
0.1 (9.076)
4.036
310
897
7.64310.8979.266
3.129
0.1 (9.2696)
4.056
310
.
949
7.64310.9499.296
3.129
0.1 (9.296)
4.058
310
956
7.64310.9569.299
3.129
0.1 (9.299)
4.0586
To find
(0
4)
by AdamÕs method
h
0.1 are
0.0
Œ3
2.4
Œ3
0.1
Œ2
2.473
Œ2
5.467
0.2
Œ1
3.129
Œ1
7.643
0.3
4.059
10.956
460
UMERIC AL
ETHODS
IN
E
NGINEERING
AND
CIENCE
()
100123
55 5937 9
24
yyffff
0.1
4.0595510.957597.643375.4679 4
24
5.383
Now
0.4
11
0.45.38325.38316.061
xy fe
()
101012
9195
24
yy ffff
0.1
4.0586916.0611910.95657.6435.467
24
5.392
Hence
(0.4)
5.392
EXAMPLE 10.25
dy
/
dx
xÐy
,y
(0)
to find
(0
4) by
Solution:
We have
f
To find
(0
1)
Here
0,
0
1,
0.1.
100
(,)0.10, Œ0.1000
khfxyf
2001
Œ0.08525
11
,0.10.05,0.95
22
khfxhy kf
3002
11
,0.10.05,0.957Œ0.0867
22
khfxhykf
4003
,0Œ0.
.10
0.1,0.91 3
7741
khfxhykf
1234
22 00.0883
kkkkk
UMERIC AL
OLUTION
OF
RDINARY
IFFERENTIAL
E
QUATIONS
461
Thus
10
(0.1)10.0883 0.9117
yyyk
To find
(0
2)
Here x
0.1,
0.9117,
h
0.1
111
khfxyf
2111
0.0616
11
,0.10.15,0.8751
22
khfxhykf
3112
0.0626
11
,0.10.15,0.8809
22
khfxhykf
4113
,0.8491
khfxhykf
1234
0.06
223
kkkkk
Thus
(0.2)
0.8494.
To find
y
(0
3)
Here
0.2,
0.8494,
0.1.
122
(,)0.1 0.25,0.84940.0521
khfxyf
2221
0.0428
11
,0.10.25,0.8233
22
khfxhy kf
3222
0.0436
11
,0.10.25,0.828
22
khfxhykf
4223
,0.10.3,00.0349
.058
khfxhykf
1234
0.04
228
kkkkk
Thus
32
(0.3) 0.8061
yyyk
0.0
1.0000
0.0
(0.1)
1.0000
0.1
y
1
0.9117
0.1
(0.9117)
0.7312
0.2
0.8494
0.2
(0.8494)
2
0.5215
0.3
0.8061
0.3
(0.8061)
0.3498
462
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
()
100123
55 5937 9
24
yyffff
0.4
()
1
0.1
0.8061550.3498590.5215370.731291
24
0.77890.2.67
Using the
corrector,
()
101012
9195
24
yy ffff
()
0.1
24
0.7785
c
Hence
(0.4)
0.7785
Exercises 10.5
1.
dy
dx
at
: 0 0.20.40.6
: 00.0200 0.07950.1762
2.
Using the Adams-Bashforth formulae, determine
ferential equation
dydxxy
: 00.10.2 0.3
3.
Given
(0)
(0.1)
0.90516,
(0.2)
0.82127,
(0.3)
0.74918, evaluate
Bashforth method.
4.
(4.4) given 5
xy
2,
(4)
1,
y
(4.1)
1.0049,
(4.2)
1.0097 and
(4.3)
1.0143.
5.
dy
dx
: 11.2331.548488 1.978921
determine
UMERIC AL
OLUTION
OF
RDINARY
IFFERENTIAL
QUATIONS
463
6.
(1.4); if
satisfies
dy
dx
1/
and
(1)
1,
(1.1)
0.996,
(1.2)
0.986,
(1.3)
0.972.
dy
fxyz
dx
(1)
and
(,, )
dz
xyz
dx
(2)
and
)
z
methods.
10001000
20 112011
30223022
(, ,), (, ,)
(,,),(,,)
(, ,),(, ,)
yyfxyzdxzzxyzdx
yyfxyzdxzzxyzdx
yyfxyzdxzzxyzdx
and so on.
ii
)
is used as follows:
If
be the step-size,
) and
0
h
23
1000 0
'
2!3!
hh
yyhyyy
(3)
23
1000 0
2! 3!
hh
zzhzzz
(4)
y
,
000
,,
yyy
and
000
,,
zzz
obtain
23
21111
2!3!
hh
yyhyyy
(5)
464
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
23
21111
2!3!
hh
zzhzzz
(6)
Since
and
11
,,
yy
and
11
,,
zz
. Sub-
and
z
2
and
step
by step.
iii
Runge-Kutta method
is applied as follows:
Starting at (
y
,
to be
1000
(,,)
khfxyz
1000
(,,)
lhxyz
200101
111
,,
222
khfxhy kzl
200101
111
,,
222
lhxhykzl
300202
111
,,
222
khfxhykzl
300202
111
,,
222
lhxhykzl
400303
111
,,
222
khfxhykzl
400303
111
,,
222
lhxhykzl
Hence
101234
22
yykkkk
and
101234
22
zyllll
To compute
and
z
2
, we simply replace
by
in the
above formulae.
EXAMPLE 10.26
and
z
correspond-
ing to
1, given that
(0)
,z
(0)
and
dy
dx
,
dz
dx
UMERIC AL
OLUTION
OF
RDINARY
IFFERENTIAL
QUATIONS
465
Solution:
Here
0,
2,
1,
and
(,, )
dy
fxyzxz
dx
(,, )
dz
xyzxy
dx
0
(,, )
yyfxyzdx
and
(,, )
zz xyzdx
First approximations
00
1000
(, ,)2( 1)2
xx
xx
yyfxyzdxx dxxx
00
10 00
(, ,)1 (4)14
xx
xx
zzxyzdxxdxxx
Second approximations
2011
(,,)2 (14)
xx
yyfxyzdxxx dx
3
26
xx
00
2011
(,,)12
xx
xx
zzxyzdxxxxdx
45
23
14
2420
xx
xxx
Third approximations
23456
3022
3111 1
(, ,)2
2 2 4 20120
yyfxyzdxxxxxxx
3022
(, ,)
zzxyzdx
234 567
357 3111
14
2312 6012 252
xxxxxxx
and so on.
When
0.1
2.105,
2.08517,
2.08447
0.605,
2
0.58397,
0.58672.
466
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
Hence
(0.1)
2.0845,
z
(0.1)
0.5867
EXAMPLE 10.27
dx
dt
xy
t, dy
dt
ty
,y
1
,
0.
Solution:
and
and
23
000 0
23
0000
()
2!3!
()
2!3!
tt
xtxtxxx
tt
ytytyyy
(
xxy t
ii
ytyx
iii
w.r.t.
, we get
xxyxy
xxyxyxyxy
22
222
ytyyx
ytyyyx
(iv)
Putting
1,
Œ 1,
0
0 in (
ii
), (
iii
), and (
iv
), we obtain
00000
Œ 120Œ1
1.1 Œ 1 Œ 124
Œ3Œ 114Œ1Œ1Œ9
xxyxy
0
000
02
2Œ1Œ1Œ3
2248 etc
yyx
), we get
23
23
()14912
2!3!2
tt
xttttt
23
23
34
()1381
2!3!2 3
tt
xttttt
UMERIC AL
OLUTION
OF
RDINARY
IFFERENTIAL
QUATIONS
467
EXAMPLE 10.28
Solve the differential equations
1,
dy
dz
xzxy
dxdx
for
0.3
,z
Solution:
Here
(, , )1 , (, , )
0,
0,
1. Let us take
0.3.
hf
(
x
0.3
(0, 0, 1)
0.3 (1
0)
0.3.
1000
,,0.3Œ0 00
()
lhxyz
200101
111
,,
222
0.30.15,0.15,10.31 0.150.345
khfxhy kzl
200101
111
,,
222
0.30.150.150.00675
lhxhykzl
22
3000
,,
222
0.30.15,0.1725,0.996625
kl
khfxhyz
f
22
3000
,,
222
0.30.150.17250.007762
kl
lhxhyz
400303
,,
0.30.3,0.34485,0.992240.3893
khfxhykzl
400303
,,
0.30.30.344850.03104
lhxhykzl
Hence
001234
22
yxhykkkk
468
UMERIC AL
ETHODS
IN
NGINEERING
AND
S
CIENCE
i.e.,
(0.3)0 0.32(0.345)2(0.34485)0.38930.34483
and
01234
22
zxhyllll
i.e.
(0.3)1020.006752(0.0077625)(0.03104)
0.98999
,,
dydy
fxy
dx dx
By writing
dy
dx
differential Equations
,f(x, y, z)
dy
dz
dxdx
EXAMPLE 10.29
(1
.
1)
and
(1
2)
from
;y
(1)
,y
(1)
1
,
Solution:
Let
so that
z
x
Ðy
such that
(1)
1,
(1)
1,
0.1. (
ii
,,
yzy zyz
iii
)
32222
222
223
,32
6(2)2
6(2)22
zxyzzxyzyzyz
zxyzyyzyzyzz
xyzyzzyzz
iv
UMERIC AL
OLUTION
OF
RDINARY
IFFERENTIAL
QUATIONS
469
(1.1) is
23
(1.1) (1)(1)11....
2!3!
hh
yyhyyy
Also
(1)1,(1)1,(1)(1)0,(1)(1)1
yyyz yz
23
0.10.1
(1.1)(1)0.1(1)0 01.1002.
26
(1.1) is
23
2!3!
hh
zzhzzz
Here
(1)1,(1) 0,(1)1,(1) 3
zzzz
23
0.10.1
(1.1)(1)0.1(0)131.0055
26
Hence
(1.1)
1.1002 and
(1.1)
1.0055.
EXAMPLE 10.30
xy
for
x
0
correct
,y
,y
0.
Solution:
Let
dy
dx
(
x
Then
22
Œ(,,)
dy
xzyxyz
dx
We have
0,
1,
0,
h
0.2
hf
0.2(0)
20101
111
,,
222
khfxhy kzl
30202
111
,,
222
khfxhykzl
40303
0.2Œ 0.1958 Œ 0 92
0. 3
khfxhykzl
470
N
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
1234
220.0199
kkkkk
hf
0
,
0)
0.2(Œ 1)
Œ 0.2
200101
111
,,
222
0.2(0.999)0.1998
lhxhykzl
300202
111
,,
0.2Œ
222
0.9791Œ0.1958
lhxhykzl
400303
,,
0.2 0.9527Œ0.1905
lhxhykzl
1234
220.1970
lllll
Hence at
0.2,
1 Œ 0.0199
0.9801
and
y
0 Œ 0.1970
Œ 0.1970.
EXAMPLE 10.31
Given
xy
,y
(0)
1
,y
(0)
obtain
for
0(0
1)
3 by
(0
4).
Solution:
Putting
tions
xz
0,
(1)
times, we get
y
n+
ny
At
0, (
0
Œ(
1)(
(0)
1, gives
(0)
Œ 1,
(0)
3,
(0)
Œ 5 × 3, ......
and
y
(0)
0 yields
(0)
(0)
......
0.
UMERIC AL
OLUTION
OF
RDINARY
IFFERENTIAL
QUATIONS
•
471
Expanding
23
123
()(0)(0)(0)(0)
2!3!
xx
yxyxyyy
46
353
()1
2!4!6!
yxxx
(2)
and
35
11
()(),
28
zxyxxxxxy
(3)
24
246
0.11
0.110.10.995
28
0.20.2
0.21 0.9802
28
0.30.30.3
0.310.956
2848
y
y
(0.1)
Œ 0.0995,
(0.2)
Œ 0.196,
(0.3)
Œ 0.2863.
Œ(
xz
)
z
(0.1)
0.985,
(0.2)
Œ 0.941,
(0.3)
Œ 0.87.
and then to
, we obtain
0.4
0.400.120.1Œ 0.220.3
Œ 1.79 0.941Œ1.74Œ0.3692
zzzzz
and
0.4
0.400.120.1Œ0.220.3
0Œ 0.1990.196Œ0.5736 0.9231
yyyyy
Also
(0.4)
Œ{
(0.4)
z
(0.4)
(0.4)}
Œ {0.4(Œ 0.3692)
0.9231}
Œ 0.7754.
0.40.20.240.30.4
Œ0.196Œ0.941Œ3.48Œ0.7754Œ0.3692
0.1
zzzzz
472
•
N
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
and
0.40.20.240.30.4
0.9802Œ0.196Œ1.1452Œ0.3692 0.923
.1
yyyyy
Hence
(0.4)
0.9232 and
(0.4)
Œ 0.3692.
Exercises 10.6
1.
and
, given that
dy
dx
dz
dx
3
(
), given
1,
1/2 when
0.
2.
and
for
0.4,
dx
dt
x
y
dt
0,
1,
dy
dt
Œ 1 at
0.
3.
1;;01.
dy
dz
xzxyy
dxdy
4.
Find
(0.1),
(0.1),
(0.2), and
x
z
given
(0)
0,
(0)
fourth order.
5.
of
33
dydy
xxy
dx
dx
so that
01.0.
yy
6.
when
220
dydydy
xxy
dxdx
dx
and
0.5,
0.1
dy
dx
when
0.
7.
Find
xy
Œ6
0 where
(0)
1,
(0)
xy
(0)
1,
(0)
0 to find
(0.2) and
(0.2).
UMERIC AL
OLUTION
OF
O
RDINARY
IFFERENTIAL
QUATIONS
473
9.
Œ2
sin
with
y
(0)
Œ 0.4 and
(0)
method, find
(0.2).
10.
tion
sin0
dt
where
98 cm and
g
980 cm/sec
. If
0 and
dt
4.472 at
0,
and
dt
when
0.2 sec.
11.
In a
L-R-C
t
) across the capacitor is given by the
equation
dvdv
LCRCv
dt
dt
0,
dv
dt
0.
Taking
and
dv
dt
when
10 volts,
0.1 farad,
0.5 henry
and
10 ohms.
true value y
xi
)
total error.
truncation error
and
round-off error.
errors and obtain the solutions with the least errors. It is usually not pos-
sible to follow error development quite closely. We can make only rough
somewhat intuitive.
computer used has the double precision arithmetic facility. In fact, this er-
,
2
hyn
i.e., of (
) while
hy
.i.e., of (
474
UMERIC AL
M
ETHODS
IN
NGINEERING
AND
CIENCE
tion error is of
).
14
45
yh
90
yh
i.e.,
).
19
T
P
Œ 251
The
relative error
if the true value becomes larger, then a larger error may be acceptable. If
the true value diminishes, then the error must also diminish otherwise the
EXAMPLE 10.32
dy
dx
x, y
)
,y
When
x, y
Ð y, y
(0)
error.
Solution:
We know that Euler™s solution of the given differential equation is
n+
hf
) where
0
nh
i.e., y
n+
hy
(1)
by
) and
expanding
() ()(),,1
2!
nnnnnnn
yxyxhyxyxx
(2)
(
x
)Œ
(1/2)
) as
0.
N
UMERIC AL
OLUTION
OF
RDINARY
IFFERENTIAL
QUATIONS
475
proximation
round-off error.
11
nn nnn
yyhfxyR
(3)
111
()Œ
nnn
Eyx
[(2) Œ (3)]
11
()()(,)
2!
()()(,)
nnnnnn
nnnnnn
n
h
yxhyxyyhfxyR
yxy hhxfxyTR
(4)
Assuming continuity of
)] Œ
n
,
)Œ
fy
), where
lies between
(
x
and
111
()Œ1
[,
nnynnnn
EyxhfxTR
or
n
[1
hf
)]
n+
(5)
This is the
recurrence formula
to
) We have
dy
dx
(0)
1.
Taking
(0.01)
0.01(Œ 1)
0.99
(0.02)
0.99
0.01 (Œ 0.99)
0.9801
(0.03)
0.9703,
(0.04)
0.9606
(1/2)
(
)
0.00005
5 × 10
Œ5
)[
dy
dx
is Œ ve]
i.e., T
5 × 10
Œ5
(0)
5 × 10
Œ5
5 × 10
Œ5
(0.01)
5 × 10
Œ5
5 × 10
Œ5
(0.02)
5 × 10
Œ5
4
5 ×10
Œ5
(0.03)
5 × 10
Œ5
476
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
Also 1
hf
0.01(Œ 1)
0.99.
Neglecting the round-off error and using the above results, (5) gives
0,
0(0.99)
T
5 × 10
Œ5
0.00005
(0.99)
< 5 × 10Œ5
5 × 10
Œ5
0.0001
3
E
(0.99)
< 10Œ4
5 × 10
Œ5
0.00015
(0.99)
5 × 10
Œ5
0.0002 etc.
Obs.
Ðx
Ð0.03
Ð 0.9703
0.00014
Ð0.04
Ð 0.9606
0.00019.
(0
04).
Any
n
approaches the exact solution
as h tends to zero provided the rounding errors arise from the initial
) possesses enough
,
y
satisfies the
(,)Œ ,
|()|
Œ,
fxyfxy kyy
will result in
the increase of round-off error and hence increase in the total error. This
UMERIC AL
OLUTION
OF
RDINARY
IFFERENTIAL
QUATIONS
477
A method is said to be
stable
unstable.
If a method
absolutely
or
uncon-
ditionally stable
be
conditionally stable
tively stable. Euler™s method and the Runge-Kutta method are condition-
negative, each of the errors is magnified while the exact solution decays.
Total error
Truncatio
error
Round-off error
Optimum,
Error
FIGURE 10.3
EXAMPLE 10.33
Does
dx
y, given y
determine its stability zone? What would be the range of stability when
Œ 1?
Solution:
We have
x
0
(1)
By Euler™s method,
Œ1
hy
Œ1
Œ1
hy
Œ1
(1
Œ1
[by (1)
478
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
Œ1
(1
Œ2
.......................................
(1
1
y
(1
(1
(2)
ce
Using
y
ce
xÐx
0)
) is
00
xn xnh
yyeye
nh
]
or
00
()1
hn
yyeyh
(3)
Œ2
h)
h)
Unstable
Stable
Œ1
FIGURE 10.4
Clearly the numerical solution (2) agrees with exact solution (3) for
small values of
| > 1.
Hence |1
When
is real
|<1
i.e.
Œ2<
<0
When
is complex
ib
), then it is stable if
|1
ib
|<1
i.e.
(1
ah
bh
2
<1
i.e.,
1)2
< 1, [where
ah
bh
.]
i.e.,
When
is imaginary
ib
), |1
1, then we have a
periodic-stability
UMERIC AL
OLUTION
OF
RDINARY
IFFERENTIAL
QUATIONS
479
(
i
) real
:Œ2<
0.
ii
) complex
i.e.,
Euler™s
When
<0
i.e.
0<
< 2.
Exercises 10.7
1.
, obtained from
with
(0)
tending to
zero.
2.
3.
4.
Apply the fourth order Runge-Kutta method to the equation
dy
dx
Œ 2.78 <
< 0.
5.
10
0,
y
(0)
1, using
) Euler™s method, (
) Runge-Kutta method.
6.
Show that the local truncation errors in the Milne™s predictor and cor-
14
45
hy
and
90
hy
respectively.
. Practical
dydy
xxyx
dx
dx
)
a
480
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
b
.
ii
dy
xyx
dx
and
y
There exist two numerical methods for solving such boundary value
which
called the
shooting method
proximations and the resulting linear system of equations are solved by any
standard procedure. These roots are the values of the required solution at
The
derived as under:
If
23
2!3!
hh
yxhyxhyxyxyx
(1)
and
23
2!3!
hh
yxhyxhyxyxyx
(2)
yxyxhyxy x
i.e.,
()
yxyxhyx Oh
h
which is the
order
()
yxyxyxhOh
UMERIC AL
OLUTION
OF
RDINARY
D
IFFERENTIAL
QUATIONS
481
which is the
) with an error of
the order
()
ŒŒ()
yyxhy
xx
h
hOh
which is the
central-difference approximation of y
order
) is better than
preferred.
()()
Œ2(Œ) ()
yyxhyyx
hOh
xx
which is the
Hence
are as under
1Œ1
()
iii
h
yyy
(3)
1Œ1
iiii
yyyy
(4)
21Œ1
Œ2
Œ2Œ
iiiii
yyyyy
(5)
2
1Œ1Œ2
Œ46Œ4
iv
iiiiii
yyyyyy
(6)
Obs.
EXAMPLE 10.34
(0)
(1)
0.
Solution:
1/4 and
0,
1/4,
2
1/2,
3/4, and
1.
NOTE
482
UMERIC AL
ETHODS
IN
NGINEERING
AND
S
CIENCE
11
Œ2
iiiii
yyyxy
or 16
Œ 33
16
Œ1
x
i
1, 2, 3.
Using
2132132
13
16Œ3316Œ3316 ;Œ 3316
24
yyyyyyy
1
Œ 0.03488,
Œ 0.05632,
Œ 0.05003.
Obs.
sinh
(),
sinh1
yxx
the error at
xComputed value y
Exact value y
)
Error
EXAMPLE 10.35
(0
25)
,y
(0
5),
and
(0
75)
sat-
2
,
dy
yx
dx
tions
(0)
,y
(1)
Solution:
0.25 and
0
0,
0.25,
0.5,
0.75, and
1.
x
)
, is approximated as
11
Œ2
iiiii
yyyyx
or 16
Œ 31
16
Œ1
x
Using
0 and
2, (
1) 16
Œ 31
1
0.25; (
ii
2) 16
Œ 31
16
0.5 (
iii
3) 32 Œ 31
3
16
0.75,
i.e.,
Œ 31
16
Œ 31.25 (
iv
NOTE
UMERIC AL
OLUTION
OF
O
RDINARY
IFFERENTIAL
QUATIONS
483
ii
), (
iii
), and (
iv
), we get
0.5443,
1.0701,
3
1.5604
Hence
(0.25)
0.5443,
(0.5)
1.0701,
(0.75)
1.5604
EXAMPLE 10.36
Determine values of
(0
1)
if
iv
81
81
,y
(0)
(1)
(0)
(1)
(Take
n
3).
Solution:
Here
0,
1/3,
2/3,
1.
The corresponding
-values are
y
0),
0).
Replacing
iv
equation becomes
21Œ1Œ2
Œ46
1
Œ48181
iiiiiii
yyyyyyx
or
Œ4
Œ4
Œ1
i
Œ2
1, 2
At
1,
Œ4
Œ4
0
y
Œ1
1/9
At
2,
Œ4
Œ4
4/9
Using
y
0
0, we get Œ 4
Œ1
1/9 (
2
Œ4
4/9 (
ii
0, we know that
Œ1
(Œ)
iii
yiyyy
h
At
0,
9(
Œ2
Œ1) or
Œ1
0
y
0] (
iii
At
3,
9(
Œ2
) or
y
4
0] (
iv
Using (
iii
), the equation (
) becomes
Œ 4
2
6
1/9 (
Using (
iv
), the equation (
ii
) reduces to
Œ4
4/9 (
vi
Solving (
) and (
vi
), we obtain
11/90 and
7/45.
Hence
(1/3)
0.1222 and
(2/3)
0.1556.
484
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
EXAMPLE 10.37
81(),
dy
yx
dx
where
1/3 2/3 1
x
)
81 162 243
(0)
(0)
(1)
(1)
Solution:
Here
x
0
0,
1/3,
2/3,
1.
The corresponding
-values are
0),
2
,
21Œ1Œ
Œ46Œ4
81
iiiiiii
yyyyyyx
At
1,
Œ4
7
y
Œ4
Œ1
1(
At
2,
Œ4
Œ4
y
1
2(
ii
At
3,
Œ4
Œ4
2
y
3(
iii
We have
0(
iv
Since
1Œ1
ii
yi
yy
for
0,
01 1
0 ŒŒ1i.e., Œ1
yyyy
Since
Œ1
Œ2
iii
yiyy
for
i
3,
2432
343
0Œ2,i.e., 2Œ
yyyyyy
vi
Also
21Œ1
Œ2
Œ2Œ
iiiii
yyyyy
for
3,
354
21
ŒŒ
022
yyyyy
i.e., y
Œ2
2
y
vii
Using (
iv
) and (
), the equation (
) reduces to
Œ4
1(
viii
)
N
UMERIC AL
OLUTION
OF
RDINARY
IFFERENTIAL
QUATIONS
485
Using (
iv
) and (
vi
), the equation (
ii
) becomes
3
3
Œ2
1(
ix
Using (
vi
) and (
vii
), the equation (
iii
) reduces to
Œ4
2
y
3(
Solving (
viii
), (
ix
), and (
), we get
8/13,
22/13,
37/13.
Hence
y
(1/3)
0.6154,
(2/3)
1.6923,
(1)
2.8462.
to an initial value problem. Then this initial value problem is solved by Tay-
lor™s series method or Runge-Kutta method, etc. Finally the given bound-
ary value problem is solved. The approach in this method is quite simple.
),
y
A, y
(1)
One condition is
m
which rep-
responding value of
are
,
b
) and
and
) are lin-
for
10
21
10
,
,,
mm
mm
ybymb
ymbym b
This gives
2110
10
,,
ymbyb
mmmm
ymbym b
(2)
),
y
(
A, y
).
for
)] and [
the value of
,
b
) agrees with
) to desired accuracy.
486
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
(x)
0
x
=a
=b
(y
(a) = m
= y(m
,b)
2
= y(m
,b)
B=y(b)
=y(m
,b)
o
t
(y
(a) = m
FIGURE 10.5
Obs.
EXAMPLE 10.38
x
)
,y
(0)
and
(1)
17
Solution:
(0)
m
be
0.8 and
0.9.
Then
),
(0)
0 gives
(0)
m y
(0)
(0)
(0)
(0)
iv
(0)
(0)
yv
(0)
y
(0)
yvi
(0)
yiv
(0)
and so on.
23
357
()0000
2!3!
61205040
xx
yxyxyyy
xxx
mx
NOTE
UMERIC AL
OLUTION
OF
RDINARY
IFFERENTIAL
QUATIONS
487
(1)
(1
0.1667
0.0083
0.0002
(1.175)
For
0.8,
, 1)
0.8 × 1.175
0.94
For
0.9,
(
m
, 1)
0.9 × 1.175
1.057
, i.e.,
is given by
2110
10
,11
,1,1
ym y
mmmm
ym ym
1.0571.175
0.90.1 0.90.100851.00085
1.0570.94
which is closer to the exact value of
(0)
0.996
),
(0)
0,
(0)
(
m
, 1)
(1.175)
1.1759
1 is
of
(1)
1.17.
Exercises 10.8
1.
0.5:
2
10,0 10.
dy
yyy
dx
(Take
4)
2.
8(sin
0, 0
1,
(0)
y
(1)
1. (Take
4)
3.
xy
0,
(1)
1,
(2)
2. (Take
4)
4.
Œ4
4
y
(0)
0,
(1)
Œ 2, taking
4.
5.
Œ 64
10
0 with
(0)
(1)
0
488
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
6.
y
xy
2,
(0)
0,
(1)
1.
7.
12
24,00330.
93
dy
yx xyyyy
dx
right end (
3).
Determine
1 and
2.
8.
81729001 10.Us e3
dy
yxyyyyn
dx
9.
iv
(0)
(0)
0 and
y
(1)
2,
(1)
0. (Take
5).
10.
,00andy11.1752.
dy
yy
dx
11.
6,01,0.50.44
2
dy
yyy
dx
Exercises 10.9
Select the correct answer or fill up the blanks in the following questions:
1.
) Taylor™s (
) Adams-Bashforth
) Picard™s (
) None.
2.
5 is ...... .
3.
If
(0)
1 and
(1)
value of
(2)
(
x
) is ......
UMERIC AL
OLUTION
OF
RDINARY
IFFERENTIAL
QUATIONS
489
4.
(
x
) with
, is ....... .
5.
is ......... .
6.
7.
Given
,
y
for
dy
dx
), is ...... .
8.
9.
y
f
x, y
), given
is .... .
10.
The
...... .
11.
12.
xy
0,
(0)
1 upto
is ...... .
13.
If
dy
dx
is a function of
reduces to .......
14.
15.
16.
dy
/
dx
Œ2
)/
(0)
1; gives
(0.1)
..... .
17.
dydy
yy
dx
dx
18.
19.
method.
20.
) given
are ...... .
21.
490
UMERIC AL
ETHODS
IN
NGINEERING
AND
CIENCE
22.
If
x
Œ
(0)
(1)
(1) is ...... .
) 0.915 (
) 0.905 (
) 1.091 (
) none.
23.
) and
(
x
) are ...... .
24.
If
(0)
(1) is
) 0.99 (
) 0.999 (
) 0.981 (
) none.
25.
Write down the difference between initial value problem and boundary
Which of the following methods is the best for solving initial value prob-
lems:
) Euler™s method
27.
0 is
.....
28.
(0.1) for
,01
dy
xyy
dx
is
) 0.809 (
) 0.909 (
) 0.0809 (
) none.
29.
30.
(0.1) for
y
x
Œ2
(0)
1, taking
0.1, is ......
) 0.813 (
) 0.825 (
) 0.0825 (
) none.
31.
In Euler™s method, if
is large, it
gives inaccurate value. (True or False)
32.
33.