Solution of Ordinary Differential Equations
N u m e r i c a l
395
ty+X y(0)=-1.
d dy
given
(0-1) given
y(0-1) 2x +y,
25. Find x(01),y dt dt X-given x (0)=0, y(0) =0-5,
26. Solve
-x+y" =0 using R.K. method forz=0:
()=0, taking h = 02. given
(0)=1,y
yFind v(0-1) given y"=y', y (0) =10,y (0)=5 by R.K. method,
27.
28. Find y (0-1), y (0-2) given y-xy-2xy=1, y (0)=1 y (0)=0.
29. Find y(0-1) given +21ry'-4y=0, y (0) = 0:2, y (0) = 0-5.
30. Obtain the value of x
(0 1) given
_ 4x, x (0) = 3,x (0) = 0.
dt
d
value of y (0-2) given
31. Compute the
y - y.y 0) = 1,y (0) =0.
11-16. Predictor-Corrector methods
The methods which we have discussed so far are called
methods because they use only the information from the_ingle-step
last step
computed. The methods of Milne's predictor-corrector,
predictor corrector formulae are multi-step methods. Adams-Bashforth
In solving the equation dy f ( y), y Fo) o
=
dr we used Euler's
formula
Di++h y), i=0, 1,2,
We improved this value
1)
by Improved Euler method
2)
In the equation (2), to
get the value of yi+1 We require
R.H.S. To overcome this difficulty, we calculate yi usingyi+1 on the
Euler's
formula (1) and then we use it
the R.H.S. of (2), to get the L..H.S. of
on
(2). This Yi+1 canbe used further to get refined
yi4 on the L.HS. Here,
we
predict a value of yi+ from the rough tormula (1) and use in (2) to
correct the value. Every time, we improve using (2). Hence equation (1)
uler's formula is a predictor and (2) is a corrector. A predictor ronud
used to predict the value of y at X41 and a corrector formula is used
to correct the error and to improve that value of yi+
I117. Milne's Predictor Corrector Formulae
1)
Suppose our aim is to solve=f, y). y )=Yo
numerically.
396
have to estimate successively
Starting from yo=y (g), we
=y(o+ h) =y (x,). y =y (fo+
2h) =y (). ys=y (To+ 3h) =y)
y
suitable accepted spacing, which is very small.
where h is a
forward interpolation formula, we have,
By Newton's
y=otuAyo+
u(4-2yot
2!
u(u-i)3! (a-2) yot
"(u-i)(u-2)
.
where u = *h , i.e., x=X0= uh. Changing yto y,
y=o+usyo'+- u(u-1) (u-2) *+ .(2)
21 3!
Integrating both sides from x to X4
o +usyo+ u(u-
2!
yd+d
since x = 0 t uh and dx = hdu
y4-oh ou+Ayo
+
= 4+8 Ayo+ 8 y+a'y (64-64+ 16)+
=h 4+8 y+yAy A
'=h 4 +8(E-1)>+E-1?'yd+E-1 v
=h 4y+86'-%)+0-2+o)+0-3y+3
14 ay
Numeru
4h (2y-+2ys)+ Ay+ (3)
T a k i nign to
in to acc account only upto the third order
equation, (3) gives
(neglecting A"yo etc..)
y =o(2»1-»'+2y 4)
4h
The error committed in (4) is Ay+ and this can be proved
to be y (E) where o<<, since A=E-1 =0-1=hD for
small values of h.
. The error = y" ()
(3) becomes,
y = Y o + ( 2 - + 2 y , ) +1 4 h E)
5)
In general,
4h
Yn+1a-3t -2 -Ya-1 +2y,)+* G) ..(6)
where-3< +
is called Milne's predictor formula.
Equation (6)
To get Milne's corrector formula, integrate equation (2) betwéen the
limits x to o+ 2h.
Therefore
o+ 2h o t 2h/
o +u Ayo+
uu-
y dx= 2
YtuAy+ ldu
-Yo=hJ
a + 2 - + - 2 J a - v " ' i
398
+ 2 0 - % ) + 0 - 2 ' + ) 0
4
=h 2yo 7)
bo +4+y1-4
third order,
account only upto
Taking into 8)
y=oto+4+1
=-04o+
in (8) is
and the error
5
where x<<2
be proved to be =-n
90
" G),
and this can
(7) becomes,
= o t + 4 y ' + ) - 0 )
9
In general,
E) .(10)
ya t - +4 +ya1)a
where -1<2K+l formula.
called Milne's corrector
Equation (10) is
from
Hence we predict
4h -y-1 +2y (11)
Ya 1.p Ya-3t(2-2
i.e., 4h
Yap =Ya-3t(21,-2-f-1+2)
and correct using
Yn+1.c-1t0-1 +4y, +yh+1) (12)
i.e., n+1,eY-1t-1+4,+fa+1
Note: Knowing 4 consecutive values of y namely, yn-3» Y-2» Yn-1 a
Yn We calculate yn+1 using predictor formula. Use this yn+1 on the
R.H.S. of corrector formula to get yn +1 after correction. To refine the
value further, we can use this latest yn+1 On the R.H.S. of (12) and ger
a better Yn+1
Bxample 1. Find y (2) ify (x) dy
of=;«+) 8
is the solution
dx
y (0)=2, y(0-5) =2636, y ()=3:595 and y (15)=4968.
Solution. Here, x=0,x =05, z=10,x= 1-5,x = 20, h 05,
Yo 2,2636, y, =3.595, y =4.968.
Ordinary
of Ordinary
of
D 399
Solution
Numerical
s 6 ) = j a + )= y
.(1)
predictor
formula,
M i l n e ' s
By 4h
3 - 2 -y-1 +2y)
Y,l.p-Yn-3t
4h ( 2 - + 2 y , )
YaYot3 (2)
From (1),
y- +y)=5 (05 +2636) =15680
=at)=$(1+3.595)=2-2975
=+)-505+4968=32340
By (2),
4.p2+12(1-5680)-
3
(2-2975)+2 (3-2340)]
68710
Using Milne's corrector formula,
n1.Yn-1t0n-1 +4y, +y+1)
h
i.e., Ys,Yht0 +4y +y4) 3)
v=td=52+68710)=44355
Using (3), we get
YA=3-595+22975+4 (3-2340)+443551
= 6-8732
. Corrected value of y at x = 2 is 6-8732.
Example 2. Using Milne's method find y (4-4) given 5 xy+Ý-2=0
8ven y (4) =/, y (4-1) =1-0049, y (42) =1-0097 and y(43)=10143.
(Anna Nov 2004)
=43
Solution. y =
Sx
=4, x, =4-1, =42, I
10145.
1-0049, y, =1-0097, y3
=
X444, Yo= 1, y, =
2- 2-(1-0049) = 00493
5 (4-1)
00
2-(1097
2-(109=00467
5x2 5(4-2)
2-2-(1:0143 = 00452
5 (43)
By Milne's predictor formula,
4h
= 1+-
4 2(0-0493)-00467+2
(0-1) (0-0452)]
= 1-01897
2-2-(101897)00437
y5 (x 544)
using
YaY»+ +4 +«) 2)
0.1
= 1-0097+0-0467+4 (0-0452) +0-0437)
Ya,101874.
Note: Use this corrected ya,c and find y4,c and again use (2)
2-_2-(1-018742
0-043735
Y4,c5) 5(44)
Now using (2),
=1-0097 +0-0467+4(0-0452) +0-043735]
= 1-01874
Since two consecutive values of Y4.c are equal, we take
y4=1-01874 (correct to 5 decimals).
Example 3. Determine the value of y (0-4) using Milne's method
given yxy +y, y (0) 1; =
use Taylor series to get the values of
y (0 1). y (02) and y{03). (MS. Ap. 1989)
Solution. Here x=0, Yo= 1,x =0 1,x=0-2,x =03,x4=04
y=xy+
=xy+y+ 2yy'
YoAa+Yo+2yo =3
y"=x+y'+y+2yy"+20| "=Xo"+2yo'+2y0 "+20%)
= xy+2y+2yy" +2 0 10
=othy +o+"+
3!0
Ordinary
of Ord
hution of Diferential
Numerical
S o l u t i o n
Equations
401
0-001
I+(01)(1)+(3)+ x I0+.
=1+0:1 +0-015 +0-001666
= 1-1167
y(0-1)=11167.
'=ap +yi=(0-1) (1-1167)+(1-1167'=13587
V,+2y/' = 1) (13587)+11167+2(1.1167) (1:3587)
= 4-2871
Xy+ 2y +2y1y+20
= 16-4131
=1-1167+(13587)+(4-2871)+ 6
(16-4131
y (0-2) =1-2767
x+y=(0-2) (1-2767)+(1-2767 = 1-8853
y" x+2+2)>)2 =(02) (1-8853) +1-2767 +2(12767) (1-8853)
= 6-4677
=x+2+2y"+0,1=28-6875
0-01
=
1-2767+(01) (1-8853) + (6-4677) +0-001(28-6875)
6
= 15023
y (0:3)=15023.
Now, knowing yo» Y1» 2» Y3 we will find y4
By Milne's predictor formula,
4,pYo+ 4h3 2->+2y1 .(1)
+f=(0-1) (11167) +(1-1167)=13587
*+y=(02) (1-2767)+(12767)?=1s83
s y +y= (0:3) (1:5023) + (1-5023) =2-7076
Using (1),
Y4,=1+4 (01)2(13587)-1-853+2(27079)
3
= 1-83297
(1-83297)+(1-83297) =409296
Nov
"E; Numerical
e's
orrector formula,
h
Methods
ya,Y+'+4)3' +y.,
1-2767+18853+4 (2.-7076) +4-09296
= 1-83698
y (0-4)=183698.
Note: We can use
this y (0-4) on the R.H.S. of (2) and
of y4 get an
improved yalvaly
Example 4. Given
y (0-2) 1-12, y
=
51+r)y
(0-3) /21, evaluate y (0-4) by Milne's
=
and
y()=1,y (0-1)=1
tor method. predictor corte
Solution. X =0, x1 (Nov. 199
=01,x^=02, x =03, x4=04
Yo1,y =1-06, y2 =112,y =
1-21, h =01
y-fa,y)=1+)
=1+pi=;0+0)1=1/2
=14 þi-50+°1 1-06=05674
-1+-1+(02112/-06522
-1+)-;u+osh02=07979
By Milne's method,
Ys,p ot 4h 2-+21
=1+ 2[2 (0-5674)-06522+2(07979)]
12771
-1+10
=1 +016] [12771=0-9460
By corrector method,
..(2)
Y4,eY2t »+4s'+Y,
=1-12+[0-6522+4 (0-7979) +09460]
Solution of Ordinary Differential Equations
ul
Numeri 403
12797
the R.H.S. of (2) and get
Now use ya,.e
vh + 016] (12797)=09498
Again using (2),
112+106522 +4 (0.7979 +0.9498] =12798
y (0-4)= 12798.
Example 5. Givenyy=l-y, and y(0) =0, find
a v(0) by Euler method Using that value obtai
Euler method.
() y (02) by modified
(i) Obtain y(0-3) by umproved Euler method and find
(v) y (0-4) by Milne's method.
Solution. By Euler method,
y =yothf(To Yo) =0+(0-1) (1 -)=0-1
By modified Euler method:
= 01+(0-1)
=0-1)+(0-1 1-01+-01)||
0-1855
By improved Euler method:
=0-1855+1-+1-»-hfl»)1
0-1
=0-1855+2-2-h(1->)1
=0-1855+1-2-h)
0-2629
Now knowing yo» Y1» Y2» Y3, we will find y4
By Milne's method:
404
2Unod
4 (01)
= 0+
3
[2 (1-)-(1-) +2(1-y)]
13-2y,
3
+y2-2sl
3 - 2 (0-1) + (0-1855) -2 (0-2629) ]
3
= 0-3280
ya=1-y4=1 -0-3280=06720
Y4 2t y+4y++Yp
0-1
= 0-1855+[1-y+4
3 (1 -y)+1-Ya,pl
=0-1855+6-2-4y -Va,pl
y(0-4)=03333.