0 ratings0% found this document useful (0 votes) 917 views16 pagesNST Numerical Differentiation
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
rr 1
El NUMERICAL METHODS IN ENGINEERING AND SCIENCE]
10.3. TAYLOR'S SERIES METHOD
dy
Consider the first order equation 4° = fx, y) (1)
Differentiating (1), we have
d*y _of , of dy .
x thax "= ol2)
Ge as de BO MARS )
Differentiating this successively, we can get y”, y® ete. Putting x =
values of (py (YJ, (9””)p can be obtained. Hence the Taylor's series
) and y = 0, the
y
+(x x9))g + =~ (yg AAO (yg 4, (3)
9% 3!
gives the values of y for every value of x for which (3) converges.
On finding the value y, for x = x, from (3), y’, y” ete. can be evaluated at x = x, by
means of (1), (2) ete. Then y can be expanded about x = x,. In this way, the solution can be
extended beyond the range of convergence of series (3)
Obs. This is a single step method and works well so long as the succes
calculated easily. If (x, y) is somewhat com
becomes tedious, then Taylor's met
method and therefore, has little
finding starting
e derivatives can be
plicated and the calculation of higher order derivatives
thod cannot be used gainfully. This is the main drawback of this
application for computer programmes. However, it is useful for
ues for the application of powerful methods like Runga-Kutta, Milne
Bashforth which will be described in the subsequent sections.
and Adams-
WExample 10.3. Solve y
values of y at x = 0.1 and x =0.2.
Sol. Differentiating successively, we get
* +9, (0) = 1 by Taylor's series method. Hence find the
(Anna, B. Tech., 2005)
ylexty y=
te y=
y(0)=2
vy")
yO) = 2, ete,
ny xo
Yor (=x) "+ VOM Gyn,
’
yelexD+ Qs TOs
3
Thus WO.1)=140.1+(0.1)2 4 OD" |
= 1.1103
2)" (oa)
and 0.2) = 140.2 +(0,2)2 4 02" (2)
3 6
= 1.2427—
Tne
Ee
TAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS Ka
g Example 10.4. Find by Taylor's series method, the values of y at x
O.1and x= 0.2 to
of decimals from dy/dx =
~1,y(0) = 1. \V.T.U., B. Tech., 2012)
fire Pool. Differentiating successively, we get
y=xy-1, Og=-1 \s yoy =
y” = Oxy + x2y, (y= 0
) ny + Axy’ + x2y”, ("y= 2
yil = Gy’ + Gxy” + x2y", (yy =—6, ete.
Putting these values in the Taylor's series, we have
2 x3 xt
yelex- D+ TO+ D+ Teor...
4
+...
3 4
Hence y(0.1) = 0.90033 and y(0.2) = 0.80227.
@ Example 10.5. Employ Taylor’s method to obtain approximate value of y at
the disferential equation dy/ dx = 2y + 3e*, y(0) = 0. Compare the numerical soluti
with the exact solution. W.T.)
Sol. (a) We have y’ = 2y + 8e* ; y'(0) = 2y(0) + 3e9 = 3.
Differentiating successively and substituting x = 0, y = 0 we get
y” = 2y’ + 8e7, yO) = 2y'0)+3=9
y" = 2y” + 3e%, yO) = 2y"(0) +3 = 21
yr? = 2y’” + 3e*, yO) = y’ "(O) + 3 = 45 ete.
Putting these values in the Tavlore coriac wa hava
Bl-x+FIGAL METHODS IN ENGINE
dy
ir the equation ©
mExample 10.6. Solve by Taylor series method of third order the oa PP
yO tforsatx= 01,2202 0nds = 04 '
2d + xyes xo
Sol. We have Y=
Differentiating su
yr a +g) Cet) + Oe +
ay? + Be? + yt + BET
24 art ty? + Bow) ee
pstituting
yree Bye ye
yO
ccessively and sul
|
(| C8
m2 (x89
meer, ex? tyy Ne
in the Testor series,
2
0) + Ly Orgy
Substituting these values 0
yl) = (0) + 2
2 3
a 14x) + O47
Hence
uation 2 = log (xy) for y(1-1) and
dx
0.7. Solve by Taylor's series method the eq
2009)
B Example 10.
‘y(12), given y() = 2- (Hazaribagh, BE
Sol. We have y’ = log x + log y 5 (A) = log 2
Differentiating w-r.t. x and substituting x= ly =2,weget
a y= 1+ flog 2
ee 1
Hy syd y sya) = 142 (142k 2 og 2°
7 7)" 2 atta 2) 5 log 2
= 1, we have
‘Substituting these values in the Taylor's series about
(x1?
a Y
dc) = (A) +e Dy
yl) = 9 ya) + y(tnena
Example 10.6. Solve by Taylor series method of third order the equation
NUMERICAL METHODS M ENGINEERING A ci
dy
dx 7
(0) =1 for yatx=0.1,x=0.2and x =0.3
Sol. We have y’= (x + xy*)e*; yO) = 0.
Differentiating successively and substituting x=O,y
¥” = (x9 + xy®) (—e*) + (Bx? +y? +x. 2y Ie*
=(-x3— xy? + Br? + y2 + Qeyye*; YO =1
y= (— x3 — xy? + Bx? + y? + Qeyy’) (0) + [- Bx? — (9? +. By.) + Br + Dy
+2 by’ +x (y? + yy] e* y"(0)=-2
Substituting these values in the Taylor's series, we have
2 3
ylx) = y(0) + xy(0) + aoe ao Fesecee
x? x?
= 14 (0) + D4 ODF vee
=1+ +
2 3
Hence (0.1) = 1+ 7 (0.0 - 4 (0.09 = 1.005
lo? lao
y(0.2) = 1+5 (02) +3 0m = 1.017
192 10.98
y(0.3) = t+ “3 (0.3)" = 1.036.
Example 10.7. Solve by Taylor's series method the equation & = log (xy) for y(1.1) and
hc
given y(L) = 2. (Hazaribagh, B.E., 2009)
Sol. We have y’ = log x + logy; yD = log 2
Differentiating w.r.t. x and substituting x=1,y = 2, we get
1
3 (1) = 1+Slog 2
yD) 8
“ey
1,1, f_ 1 1 a 1 2
” ve yin = (log 2)
yr a-—atTy r ay 397") = -1+ (1 log2) is
whetituting these values in the Tavlor’s series about x = 1. we haveyd
+(0.1) log 2 + 00%
2
= 2.036
y(1.2) = 24 (0.2) log 2 + (0.2
= 2.081,
OBLEMS 10.1
1. Using Picard’s method, solve dy/dx
xy with x) = 0, y9 = 1 upto third approximation
; (Mumbai, B. Tech., 2005)
2, Employ Picard’s method to obtain, correct to four places of decimal, solution of the
differential equation dy/dx = x? + y? for x = 0.4, given that y = 0 when
: (I.N.T.U,, B. Tech., 2009)
3% Obtain Picard’s second approximate solution of the initial value problem
y¥ = xy? + 1), y(0) = 0.
4. Find an approximate value of y when x=0.1, if dyldx =x—
(a) Picard’s method, (b) Taylor's series.
and y = 1atx=0, using
W.T.U., B.E., 2012)
). Find y(1.1) and y(1.2) by Taylor’s method. Compare the
(Anna, B. Tech., 2013)
5 Solve y’ =x +y given y(1) =
result with its exact value.
6. Using Taylor's series method, compute (0.2) to three places of decimal from i
1-22
given that y(0) = 0.
|," Evaluate y(0.1) correct to six places of decimals by Taylor's series method ify(x) satisfies
y =xy+1,y0)=1
Solve y’ = y? + x, (0) = 1 using Taylor's series method and compute y(0.1) and y(0.2).
(Mumbai, B. Tech., 2007)
& ‘Evaluate y(0.1) correct to four decimal places using Taylor's series methods if
Pec 4 dyldx = x* + y?, y(0) = 1. (V.T.U., B.E., 2006)
hho, Using Taylor series method, find (0.1) correct to 3-decimal places given that
Ciatinsw > dyldx =e - y*, y(0) = 1.
10.4. EULER'S METHOD
. a
Consider the equation = = flx, ») (a)
given that y(x9) = yo. Its curve of solution through P(x,, Yo) is shown dotted in Fig. 10.1. Now
we have to find the ordinate of any other point Q on this curve
‘aan esaters
So ath ayt2h xy tinh
Fig, 1041
Let us divide LAY into n subintervals each of wit
small.
hh at Ly, Ly. 80 that h is quite
Let P,Q, be the curve of solution of (1) through P, and let its tangent at P, meet the
ordinate through L, in Pyxy + 2h, y,). Then
32291 + hflxy +h yy) a
Repeating this process n times, we finally reach on an approximation MP, of MQ
given by
Jn 2Iya + hflty + ADIL)
This is Euler's method of finding an approximate solution of (1),
ob:
by a sequence of si
Tines may also deviate con
hence the
in Euler's method, we approni
nes. U
und tobe i at. Th
ferably from the curve of solution. As such, the method is very
® modification ofthis method which is
in the next section,
Example 10.8. Using Euler's method, find an approximate value ofy corresponding t
1 given that dylds =+y and y= Lwhen x =0 (Anna, B. Tech, 2008)
Sol. We take n = 10 and h = 0.1 which is sufficiently small. The various calculations
are arranged aSCLUTION GE ORDWAY BF FERENTA
f x
L vo ; = ty =dyidx Old y +01 (dy/de = new y
on aa o 1.00 + 0.11.00) = 1.10
na ate 1.10 + 0.11.20) = 1.22
wn es re 1.22 + 0.1(1.42) = 1.36
ws Any a 1.36 + 0.1 (1.66) = 1.53
fe on _ 1.53 + 0.1 (1.93) = 1.72
i Los 1.72 40.1 (2.22) = 1.94
ra oo oo 1.94 + 0.1 (2.54) = 2.19
; a3 a aoe 2.19 + 0.1 (2.89) = 2.48
be oo 3:28-9:28 2.48 + 0.1 (3.29) = 2.81
3.71 2.81 + 0.1 (3.71) = 3.18
10 3.18
Thus the required approximate value of y = 3.18.
Obs. In example 10.1 (Obs.), we obi
ereas by Euler's method y = 3.18 and by
reined the true values of y from its exact solution to be 3.44
y Picard’s method y = 3.434. In above solution, had we chosen n
20, the accuracy would have been considerably increased but at the expense of double the labour of
computation. Euler’s method is no doubt very simple but cannot be considered as one of the best.
mExample 10.9. Given ©
dx.
by Euler's method.
Sol. We divide the interval (0, 0.1) into five steps i.e, we take n = 5 and h = 0.02. The
various calculations are arranged as follows
ytx
with initial condition
=1atx=0; find y for x -0.1
(Anna, B. Tech., 2013)
y dylds Old y + 0.02 (dy/dx) = new y
1.0000 1.0000 1.0000 + 0.02(1.0000) = 1.0200
1.0200 0.9615 1.0200 + 0,02(0.9615) = 1.0392
1,0392 0.926 1.0392 + 0.02(0.926) = 1.0577
1.0577 0.893 1.057 + 0.020.893) = 1.0756
1.0756 0.862, 1.0756 + 0.02(0,862) = 1.0928
* 1.0928
Hence the required approximate value of y = 1.0928.
10.5. MODIFIED EULER'S METHOD
In the Euler’s method, the curve of solution in the interval LL, is approximated by the
tangent at P (Fig. 10.1) such that at P,, we have
1 = Yo + hf» Yo)
‘Then the slope of the curve of solution through P,
Wee. (dy/dx)P, = fix, +h, y))
eter}{ WuMeRICAL SOLUTION rr
7 [Bee so ot toners aaa
Eien nein mse] “aa
10
04 0.5068 + <4
| = 20887 = 9.6028
| | on 0.5025 «004 0.2468 + 024179128)
| 0.0030 {
0.2468 + 0.241.785)
= 0.5001
0.2668 +024.7815)
= 0.5001
(Anna, B.Tech. 2012)
Sol. The various calculations are arranged as fllows
re Hanne | Oy +03 hon sie -mny —]
wo . 030001) = 20602 oz | 026 1am!
|, 02 | tagio2+20602) | 1 ost0-o3540 2+0.2(0:276) = 2.0688, . 212954 |
| @ | tpio2+00 | t0201 +035 o2 | or ca
cry 0.3552 = dase
ed | togioayziz6s | t0sss2 + 04002) 7 oa | one | imam
oa | taeoaszias) | t03sse 04051) 219004
on 0405 - 02 1.3004 |
06 | tags 22006) | 04051 + 0.4506)
06 | tmioss2z77 | Hounsossi | 21418+02.0409< 22002
fo] «my | | anne on abies aun *
22072 +03 TaD Me 32
aaa 0g \0sr=7 pbsa RE
a
Ea NUMERAL METHODS IN ENGINEERING ANO SCIENGE ]
Toa | oie ST SS VET F 15059402 0.699) 7
= 1.8523 |
06 | 06+ | /iia523)| | 311.635 + 1.961) 1.5253 + 0.2 (1.798) |
= 1.9610 = 1.798 = 1.8849 |
06 | 06+ | Jitasia| | 71.635 + 1.9729) 1.5253 + 0.2 (1.804)
= 19729 = 1.8040 = 1.8861
06 | 06+ | Jisa6| | 3 (1.635 + 1.9734) 1.5253 + 0.2 (1.8042)
= 19734 = 1.8042 = 1.8861
Hence y(0.6) = 1.8861 approximately.
Apply Buler’s method to solve y’ =x +y, (0) = 0,
choosing the step length = 0.2. (Carry out 6 steps). (Kottayam, B.E., 2005)
2. Using Euler's method, find approximate value of y when x = 0.6 of dy/dx = 1 — 2xy, given '
that y = 0 when x = 0 (take h = 0.2).
3. Using simple Euler’s method solve for y at x = 0.1 from
dyldx =x + y + xy, y(0) = 1, taking step size h = 0.025.
4. Solve y= 1-y, 0
by modified Euler's method and obtain y at x = 0.1, 0.2, 0.3. (Anna, B. Tech., 2005)
5. Given that dy/dx =x? + y and y(0) = 1, Find an approximate value of y(0.1), taking h = 0.05
by modified Euler's method. .T.U., B.E., 2010)
6. Given y’ =x + sin y,y(0) = 1. Compute (0.2) and y(0.4) with h = 0.2 using Euler's modified
method. GN.T.U., B. Tech., 2007)
even DIE,
7. Given Gr" yy with boundary conditions y=1 when x0, find approximately y for
x= 0.1, by Euler's modified method (5 steps). (V.T.U., B. Tech., 2007)
8. Given that dy/dx = 2+ /() andy = 1 when x= 1. Find approximate value of y at x= 2 in
steps of 0.2, using Euler's modified method. ‘Anna, B. Tech., 2004)
10.6. RUNGE’S METHOD”
. : . dy
Consider the differential equation, $° = fx, y),y(%y) = yp AQ)
Clearly the slope of the curve through Pix, ¥5
Integrating both sides of (1) from (x,,
sork peek
Po a= f" pana
hs
I
+2)
) is Alxy, yp) (Fig. 10.2).
Yo) to (xy +h, yy +k), we have “
Called after the German mathematician Carl Runge (1856—1927) .ae
Fig. 10.2
‘To evaluate the integral on the right, we take Nas the mid-point of LM and find the
values of ft, 9) (ie. dy dx) at the points x a9 + Al2, x5 +h For this purpose, we first deter-
ine the values of y at these points,
‘Lat the ordinate through N cut the curve PQ in $ and the tangent PT in S,. The value
ofygisgiven by the point S,.
yg=NS,=LP +HS,=y,+ PH .tan@
a yq 4h dlda)p=9y+ 4 Flee) (8)
‘Also qe MT = LP + RP = y+ PR tan 8 =o + hilt 90)
‘Now the value of yg atx + is given by the point 7” where the line through P draw
vith slope at Thx, + h,y_) meets MQ.
Slope at T= tan ¥ =flxat hy =flvy+ hig + Mx IL
jy PR tan =yq+ fly + yyo+ hilt Io (4
‘Thus the value of fx, 9) at P = flty 0
the value offix,y) at S=fixy+ hy)
and the value offix,y) at Q=flty+ hy)
where yg and y gare given by (8) and (8).
‘ence from (2), we obtain
sark h
ne [i fea nde = Bir fo fel by Simpsons rte (p19)
k
\ = eg) + Aig + HI 96) + G9 By) 18)
wich gives a sufficiently accurate value of k and also ofy = yy
\ “The repeated application of (5) gives the values ofy for equi-spaced pointsPr
NUMERICAL METHODS IN ENGINEERING AND SCIENCE
Working rule to solve (1) by Runge’s method
Calculate successively
hy = hflxy, Yo
1 1
hy= he (xy +h 304 2h}
W = hf, +h, yo + hy)
and by = hflxy + hy yo +k’)
1
Finally compute, k = & (hy + 4h + hy).
which gives the required approximate value as y, = yo + k.
(Note that b is the weighted mean of ky ky and ky).
W Example 10.14. Apply Runge’s method to find an approximate value of y when x = 0.2,
given that dyldx =x + y and y = 1 when x = 0.
Sol. Here we have x, = 0, yy = 0.2, fx, Yo) = 1
hy, = hflay, Yo) = 0.2) = 0.200
hy= Mt (x0+4tyo +3h,) =02 0.1, 1.0 = 0.240
hf, +h, yo + ky) = 0.2 A0.2, 1.2) 0.280
and hflxy + hy yg +k’) = 0.2 f0.1, 1.28) = 0.296
1
= Flky + 4h, + hy) = 210.200 + 0.960 + 0.296) = 0.2426
Hence the required approximate value of y is 1.2426.
10.7. RUNGE-KUTTA METHOD"
The Taylor's series method of solving differential equations numerically is restrictec
by the labour involved in finding the higher order derivatives. However there is a class 0
methods known as Runge-Kutta methods which do not require the calculations of highe:
order derivatives and give greater accuracy. The Runge-Kutta formulae possess the advan
tage of requiring only the function values at some selected points, These methods agree witt
Taylor's series solution upto the term in h’ where r differs from method to method and i:
called the order of that method.
(i) First order R-K method. We have seen that Euler’s method (§ 10.4) gives
V1 = Io + Aiko, Iq) = Yo + hyo” ey
Expanding by Taylor's series
Ya Vy t hd = yy + hy + Yo
It follows that the Euler's method agrees with the Taylor's series solution upto the
term inh.
Hence, Euler's method is the Runge-Kutta method of the first order.
ii) Second order R-K method, The modified Euler's method gives
hy.
9 BY tg Hon 90) + fla + hy] me)|
FuweRICAL SOLUTION OF ORD!
[Fence SouuON oF onowany DFFERENTAL EaUATONS
Substituting y, = ¥9 + hflxy, v9) on the right hand side of (1), we obtain
h
N=Yot got fl +h, Yo + hf where fy = Axo Yo) (2)
Expanding L.H.S. by Taylor's series, we get
‘is (3)
Y= Yay +A) = yo + hy! +
Expanding fixy +f, Yo + hf) by Taylor's series for a function of two variables, (2) gives
h
Nats [he {pen mrea(%), 0 (3) -ow}]
1 a c
=yot 3m + hfy +h? (2, +(20)| +00]
= ’ 3 of of
= 9+ hfy + fo’ + OH) x |
w
= qt hyg’ + gy 20” +OCh") (4)
Comparing (3) and (4), it follows that the modified Buler’s method agrees with the
Taylor's series solution upto the term in h®.
Hence the modified Euler's method is the Runge-Kutta method of the seco
“= The second order Runge-Kutta formula is
nd order.
y=%ot 3, +h)
where fey = hflxyy 9g) and y= fifo + hoo + hy
(iii) Third order R-K method. Similarly, it can be seen that
agrees with the Taylor's series solution upto the term inh’,
As such, Runge’s method is tl of the third order.
The third order Runge-Kutta formula is
Runge’s method ($10.6)
he Runge-Kutta method
1
y= 90% gtr t Ake t he)
1 1
ke, = hflag, Yor feo = ifs toh +34)
+h), where R= hflty + hy yo + hy)-
is method is most commonly used and is often re-
where
and key = hfixy +h Yo
(iv) Fourth order R-K method. Thi
ferred to as Runge-Kutta method only.
rms containing secon
*Ouh?) means dd and higher powers of h’ and is read as order of h*
\
a"
eLovo="/ “gror 0 =
spy thn ete ste fe “aopiess
oxoy'0 =" eroco= si FO
e+ Toy £06 = th caoponpaad a4) Bo
esor0="/ ‘couro= yo =!
ze6e'0= 4 “eeu010= &
geet o= ‘ozoo='« wore
00000 =" “00000 = ‘oo=®
_y Sussooup A) tou pounour sau amp Jo sana RUHHEDE SA aurwuavap sn 29] 0
7
eae
seal
sf = cand on ‘won eunrxoadde puor2s otf PUY OL,
Easpe Jooe'é
surg = nd on wood 519 9 98 2
eeay at ah
“
eeaecenjonan nen] +0
sao anyon se OR
weak
vympard
200