You are on page 1of 53
Numerical Solution of Ordinary Differential Equations INTRODUCTION The methods of solution so far presented are applicable to a limited class of differential equations. Fre- quently differential equations appearing in physical problems do not belong to any of these familiar types and ‘one is obliged to resort to numerical methods. These methods are of even greater importance when we realise that computing machines are now available which reduce numerical work considerably. A number of numerical methods are available for the solution of first order differential equations of the form : d) Se = Fey) given 04) =¥% A) ‘These methods yield solutions either as a power series in x from which the values of y can be found by direct substitution, or as a set of values of x and y. The methods of Picard and Taylor series belong to the former class of solutions whereas those of Euler, Runge-Kutta, Milne, Adams-Bashforth etc. belong to the latter class. In these later methods, the values of y are calculated in short steps for equal intervals of x and are therefore, termed as step-by-step methods. Euler and Runge-Kutta methods are used for computing y over a limited range of x-values whereas Milne and Adams-Bashforth methods may be applied for findingy over a wider range of x-values. These later methods require starting values which are found by Picard’s or Taylor series or Runge-Kutta methods. ‘The initial condition in (1) is specified at the point x5. Such problems in which all the initial conditions are given at the initial point only are called initial value problems. But there are problems involving second and higher order differential equations in which the conditions may be given at two or more points. These are known as boundary value problems. In this chapter, we shall first explain methods for solving initial value problems and then give a method of solving boundary value problems. PICARD’S METHOD* Consider the first order equation dyldx = f(x, y) ol) led after the French mathematician Emile Picard (1856—1941) who was professor in Paris since 1881 and is famous for his researches in the theory of functions. 1008 |INGNERICNY SOLUTION GF OntiRARY DirFeReWiaL Eouarions It is required to find that particular solution of (1) which assumes the value y, when x = x,, Integrating (1) between limits, we get L dy= i P(x, y)dx or y=yo+ C (x,y) dx 2) This is an integral equation equivalent to (1), for it contains the unknown y under the integral sign. As a first approximation y, to the solution, we put-y = yo in f(x, y) and integrate (2), giving = 90+ [flere de = Io f 1% Yo) For «second approximation y,, we puty =y, in f(x, y) and integrate (2), giving meet fl Peon) de Similarly, « third approximation is y,=Ye+ [° f(s») dx. so Continuing this process, a sequence of functions of x, +1vJo Yo ~ is obtained each giving a better approximation of the desired solution than the preceding one. Obs. Picard’s method is of considerable theoretical value, but can be applied only to a limited class of equations in “which the successive integrations can be performed easily. The method can be extended to simultaneous equations and ‘equations of higher order (See § $2.11 and 82.12). Example 32.1, Using Picard’s process of successive approximation, obtain a solution upto the fifth approximation of the equation dy / dx =y +x, such that y= 1 when x = 0. Check your answer by finding the exact particular solution. Solution, (a) We havey = 14 [° (y+) dx. First approximation, Puty = 1, iny +x, giving - +x) de= . ” 1s fia 2) dua 14x42. Second approximation. Puty = 1+x+/2iny +2, giving elt fj Gt eerst/) d= +x tat +26, Third approximation. Put y = 1+ +x?+ 246 iny +x, giving * 4 yg= 14 +23? 29/6) de=lextats 2 Fourth approximation. Put y = y, in y + x, giving . 3 =1 1+2r¢x7 42 yale Cf terres Fifth approximation. Puty =, iny + x, giving wets ff (tears Stig) a teseste S fi) (6) Given equation : & ~y = xis a Leibnitz’s linear in x. Its LF. being e~*, the solution is ye fom dx to=—xe* Joendere “*-e74¢ [Integrate by parts] if yrece—x—1. Since y =1,whenx=0, -. c=2. ‘Thus the desired particular solution is y = 2e"—a—1 lit) iii) Solution. We have y = 1+ f= dx yee First approximation. Put y = 1 in the integrand, giving 2 yale a * de= ref (- vas cys baveatedl'-t-ainuamnse oD Second approximation. Puty = 1—x + 2 log (1 +x) in the integrand, giving x 1ax42log(l+x)—x 1. pr Be fl 1s2 Malt | Toga deg (len)ee 1 Ty Bleg 5) which is very difficult to integrate. Hence we use the first approximation and taking x = 0.1 in (@) we obtain 0.1) = 1—(.1) + 2 log 1.1 = 0.9828. [EEE tavior’s series METHOD* Consider the first order equation dy/dx = fix, y) el) Differentiating (1), we have ite, S=hthf (2) Differentiating this successively, we can get y, »"° etc. Putting x =x, and y = 0, the values of ()"),, (¥. (9); can be obtained. Hence the Taylor's series G@e- toa (w= Sonal 4+ 8) WE)=Yy +(e -— XQ) OIg + Sp Wo + gives the values of y for every value of x for we (8) converges. On finding the valuey, for x =, from (3),9’, y” can be evaluated atx =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). Solution. Here (9) = Ly’ =2%y-1,6))=-1 Differentiating successively and substituting, we get y= Bry + xy, 7 = By + day’ 42°", y= Gy" + Gay” + xty”, *See footnote p. 145. "Nuwericnt Soutien oF Ononiaey Dierenenmal EQuarions ho Putting these values in the Taylor's series, a) = yy +290) + =r + yore FO + we have ya)= Lea FF “0 Fae Hence y(0.1 .90088 and, 02 0.80227. Solution. (a) We have y' = 2y + 3e* ¥'(0) = 2y(0) + Be Differentiating successively and substituting x = 0,y = 0, we get y= By" + Be, 90) = 20) +3=9 2" + Ber, (0) = 20) + 3= 21. Dy" + Ber, (0) = 2y°"(0) +8 = 45 ete. ye Putting these values in the Taylor’s series, we have 2 2 # vx) = (0) + xy"(0) + a yO) + oO + a (0) +... ordre 224 yey My aes Sate Late Baty. 2 6 24 2 2 8 Hence (0.2) = 3(0.2) + 4.5(0.2)? + 3.5(0.2)* + 1.875 (0.4) + .. = 0.8110 Ai) Now ~ 2y = Se" is a Leibnitz’s linear in x. Its LF. being e~, the solution is yet fae -e%dete=—Se%4e or y=—Ber+co™ Sincey=Owhenx=0, +. ¢=3. Thus the exact solution is y = 3(e® —e*) y= 8 (e402) = 0.8112 enlii) Solution. Weave y’=log-+ ly: y(Q) = log 2 Differentiating w.r.t. x and substituting x = 1, y = 2, we get yehely mers Flog 2 wad Pe Leyey(-3 4} syr@ante dred tog 2) dog 2 ‘Substituting these values in the Taylor's series about x = 1, we have yd = 91) +(e= Dy + SS ear y+ Se DP rade ae — 24d iog 2-1 dog 2) | = 2.036 2°4 4 =24+(e-1)log2+ = ie- vein y(t) = 2+ (0.1) log 2+ 22 if Hicies Enaiveerine MaTHEManics: 2 y(L.2)=2 + (0.2) log 2-+ 22) (1+ toe 2) et [ 141 hog 2 F dog aF| = 2.081. 2 2 6 | 2°4 ; ‘1. Using Picard’s method, solve dy/ds =~ xy with xy ‘upto third approximation. (Mumbei, 2005) 2. Employ Picard's method to obtain, correct to four places of decimal, solution of the differential equation dy/de = x° "+ forx= 0.4, given thet y = 0 when x = 0. (N-EU., 2009) ba Picard’s second approximate solution of the initial value problem : »’ =2%y?+ 1), 9(0)=0. Pr t eh) 4, Find an approximate value of y when x = 0.1, ifdy/de=x-y? and y=1 atx =0, using (@) Picard’s method (6) Taylor’s series. WU. ‘2010; Madras, 2006) B. Solve y’ =x + y given y(1) = 0. Find y(1.1) and »(1.2) by Taylor's method. Compare the result with its exuct value. (N.T.W,, 2008 ; Anna, 2005) 6. Evaluate y(0.1) correct to six places of decimals by Tuylor’s series method if yx) satisfies ¥say+ Ly) = 7. Solve »’= 8x + y2, y(0) = 1 using’Paylor’s series method and computer (0.1). (Mumbai, 2007) 8. Using Taylor series method, find y(0.1) correct to 3-decimal places given that dyldx =e —y2,y(0) = 1 EULER’S METHOD*. Consider the equation 2 2 =f,y) a) ¥4 ‘True value of y given that y(xq) = yo. Its curve a solution through Px, ¥q) is shown dotted in Fig. 32.1. Now we have to find the ordinate of any other point Q on this curve. Let us divide LM into n sub-intervals each of width A. at Ly, L», .. 80 that h is quite small. In the interval LL, we approximate the curve by the tangent at P. If the ordinate through L, meets this tangent in P,(xq + h,y,), then y= LyP,=LP +R,P, ol —— + = 7+ PR tan d=95+h (2) oth xt 2h xenh dz}p Fig. 32.1 = Yq th fixe, Yo) Let P,Q, be the curve of solution of (1) through P, and let its tangent at P, meet the ordinate through Ly in Play + 2h, y,). Then Y= Iy +h fleg+ hy y,) (2) Repeating this process n times, we finally reach an approximation MP, of M@ given by Yn =Mnar thf lxgt n—Lh.y, 9) ‘This is Euler's method of finding an approximate solution of (1) ‘Obs. In Euler's method, we approximate the curve of solution by the tangent in each interval, ic. 0 short lines. Unless # is small, the error is bound to be quite significant, This sequence of lines may also dev ably from the curve of solution. Hence there is a modification of this method which is given in the next section. Example 32.6. Using Euler's method, find an approximate vatue of y corresponding to x = 1, given that dyldx =x +y and y= 1 when x= 0. (Mumbai, 2005 ; Rohtak, 2003) "See footnote p. 302. | Nuvenicat SoLution oF Onomany Dirrenenrian Eauanions TE] Solution. We taken = 10 and h = 0.1 which is sufficiently small. The various calculations are arranged as follows : +. ER aaa tts 0.0 1.00 O1 1.20 02 ; 142 03 1.66 04 1.93 O5 2.22 06 2.54 on 289 08 3.89 09 am ee) ‘Thus the required approximate value of y = 3.18. Obs. In example 32.1, the true value of y from its exact solution atx = Lis 3.44 whereas by Euler's method y = 3.18 and by Picard’s method y = 3.434. In the above solution, had we chosen ri = 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 best. Example 32.7. Given oy oe with tnitial condition y = 1 at 4 = 0; find y forx = 0.0 by Rulers method. ! i : C2, 2001) Solution. We divide the interval (0, 0.1) into five steps ie. we take n = 5 and h = 0.02. The various calculations are arranged as follows : Hence the required approximate value of y = 1.0928. MODIFIED EULER’S METHOD In the Euler’s method, the curve of solution in the interval LL, is approximated by the tangent at P (Pig. 82.1) such that at P,, we have V1 =Io + hh ¥%0) (1) ‘Then the slope of the curve of solution through P, lie. (dy/dz)p, = f(x, + h, y,)] is computed and the tangent at P, to P,Q, is drawn meeting the ordinate through L, in P,(x, + 2h, 4). Now we find a better approximation y,'” of y(x9 + h) by taking the slope of the curve as the mean of the slopes of the tangents at P and Py, i. WY =I + fa [flxqr9q) + fle + hol wn(2) Asthe slope ofthe tangent at , is not known, we take, as found in (1 by Buler's method and insert it on R.HLS, of (2) to obtain the first modified value y,(”. The equation (1) is therefore, called the predictor while (2) serves as the corrector of y- ‘Again the corrector is applied and we find a still better value y,'® corresponding to L, as yi 99+ A Mg) + Meg + heh We repeat this step, till two consecutive values of y agree. This is then taken as the starting point for the next interval LL. Once y, is obtained to desired degree of accuracy, y corresponding to L, is found from the predictor Be =I th Xt hsy) and a better approximation y,{"is obtained from the corrector yay + dre +h, y,) + fl%ig + 2h, yo). We repeat this step until », becomes stationary. Then we proceed to calculate y, as above and so on. hla ir herandife Rulere mata whic = poate sorecbocanthed, Solution. Taking =| 0.1, the various calculations are arranged as follows : ll Seer 0 ean aires = ‘Solution. We have y' =y +e"= fix, 9); =0,y =Oandh =0.2 ‘The various calculations are arranged as under ‘To calculate y(0.2) : ‘Since the last two values of y are equal, we take y(0.2) = ‘To calculate y(0.4). Since the last two value of y are equal, we take (0.4) = 0. Hence y(0.2) = 0.2468 and y(0.4) = 0.6031 approximately. ‘Solution. The various caleulations are arranged as follows : Hence y(1.2) = 2.5351 and y(1.4) = 2.6531 approximately. ‘Mean slepe Old y +.2 (mean slope) = new y = 1.5253 + 0.2 (1.635) = 1.8528 06 — 06+ | J@8523)|= 1.9610 Ao + 1.961) = 1.798 1.5253 + 0.2(1.798) = 1.8849 06 - 06+ | Y@l8eID)| = 1.9729 (2.635 + 1.9729) = 1.6040 1.5269 + 0.2 (1.804) = 1.8861 06 06+ | Vase] =1.9784 2 (1.6954 1.9734) = 1.8042 1.5253 4 0.2 (1.8042) = 1.8861 Hence y(0.6) = 1.8861 approximately. Gira er 1. Apply Euler's method to solve y/ =x + y, 9(0) = 0, chéosing the step length = 0.2. (Carry out 6 steps). (Kottayam, 2005) 2 Using simple Buler’s method solve for y at x =0.1 from dyldx =x + +xy,y(0) = 1, taking step size h =0.025. 3. Using Euler’s method, find the approximate value of y when dy/dx = x + y? and.y(0) = 1 in five steps (i.e. h = 0.2). (Mumbai, 2006) 4, Solve y’ = 1~y,9(0) = 0 by modified Ruler’s method and obtain y atx = 0.1, 0.2, 0.3, (Anna, 2005) 5. Given y' =x + sin y,9(0)= 1. Compute y(0.2) and y(0.4) with h = 0.2 using Euler's modified methed. (IN.TU,, 2007) 6. Given that dyide = x° + y and (0) = 1, Find an approximate value of (0.1) taking h = 0.05 by modified Euler's method. WLU, 2010) 1 a ree with boundaty conditions y/2 1!when x= 0:ind approximately y for x'= 0.1)by Eoler’s moditied ‘method (5 steps). WLU. 2007) 8. Given that dyhdx=2+ JGy) andy =1 when. = 1. Pind approximate value ofy at x =2 in steps of 0.2, usingBuler’s sodified method. nna, 2004) [EEG unce’s metHop* Consider the differential equation, 2 = fix, yyhey) =p .) Clearly the slope of the curve through Porgy ¥9) is Flt, yo) (Pig. 32.2). Integrate both sides of (1) from (xo, ¥) to (y+ hy Yoh), we have PO a= 0" Fea ae (2) a hs ‘To evaluate the integral on the right, we take N as the mid-point of LM and find the values of f(x, y) (i.e. dylds) at the points xq, + h/2,%, + h. Por this purpose, we first determine the values of y at these points. Let the ordinate through WN cut the curve PQ in $ and the tangent PT in S,. The value of y, is given by the point S,. ¥=NS=LP+HS, =y,+PH tan 0 “* Called after the German mathematician Carl Runge (1856-1927) who was professor at Gottingen. ‘Hicher Excincerma MarHemencs =39+ Baldy = %5 + E flea) (3) Also Yp=MT=LP + RT =y, + PR tan 0 = yo hf lps ¥o)- Now the value of yg at x, +h is given by the point 7” where the line through P drawn with slope at Tay +h, ¥7) meets MQ. +: Slope at T= tan 6’ = f(x, +h, ¥7) = flay +h, ¥9 + Mf, Yo Y= MR+ RT = yy+ PT tan © = 34 + lifley + hyip + WC. %p)) (A) ‘Thos the value of fx, st P = fley. 49) the value of f(x, y) at $ = fle, +h/2,y,) and the value of f(x, y) at @ = fy +h, ¥Q) where yi, and yg are given by (3) and (4). Hence from (2), we obtain ath k= f f(x, 9) de -2 Ufp+ fe + fel {By Simpsons’ rule (p. 1106)] = 2 tfey9) + Aflxy+ RI2, yg) + Fx) +h, yell wB) which gives a sufficiently accurate value of k and also of y = yy + hk. ‘The repeated application of (5) gives the values of y for equispaced points. Working rule to solve (1) by Runge’s method : Caleulate successively hy = hho, ¥0) = Wf (x0 + 2h 90 + Ti) Ke = hflayt heyy hy) and hey = hf ag + hy yt RY Finally compute, ke i + dig + hy). vote that h isthe weighted mean of ky ke and h) pera ia piepaspaale He slits dy fe Ss i re ft a ict ara ee a Solution. Here we have x, = 0, y, 1, h=0.2, flo 9, Yq) =1 hy = hf oy Yo) = 0.2.1) = 0.200 hy =hf (x 44h, y +4) =0.2F0.1, 11) = 0.240 B= hf y+ fy yp + Ry) = 0.2 (0.2, 1.2) = 0.280 and keg = hf lag + hy Yot R’) = 0.2 f(0.1, 1.28) = 0.296 k= Lh, + Akg hs) = $(0.200 + 0.960 + 0.296) = 0.2426 Hence the required approximate value of y is 1.2426. RUNGE-KUTTA METHOD* ‘The Taylor’s series method of solving differential equations numerically is restricted by the labour involved in finding the higher order derivatives. However there is a class of methods known as Runge-Kutta methods which do not require the calculations of higher order derivatives. These methods agree with Taylor's series solution upto the terms in h’, where r differs from method to method and is called the order of that method. Euler's method, Modified Euler’s method and Runge’s method are the Runge-Kutta methods of the first, second and third order respectively. * See footnote p. 1017. Named after Wilhelm Kutta (1867—1944), ~Nuweficat SouuTion oF Orowar Dirrenenmal EoUATIONS L019] The fourth-order Runge-Kutta method is most commonly used and is often referred to as ‘Runge-Kutta method! only. Working rule for finding the increment k of y corresponding to an increment h of x by Runge-Kutta ‘method from 2 = fix, yt) = Yo i8 as follows : Cateulate successively ky = hfGy¥) ky = Mf (x0 +h, 0+ 3h) y= If (xp +4h, y+ 4h2) and Rg = hf ig + By Yo + hes) Finally compute he= Mh, + 2h, + Bk, + hy) which gives the required approximate value y, = yy +k. (Note that k is the weighted mean of hy, hy, kyand k,) Solution. Here X% be hy = hf Go, ¥o) = 0.2 x1 = 0.2000 by = hf (xy + 4h, yo + 4h) =0.2% (0.1, 1.1) = 0.2400 hg = hf (xo Zh. Yo + Eke) = 0.2 x (0.1, 1.12) = 0.2440 and keg = hf gt h, yo + hy) = 0.2 x ((0.2, 1.244) = 0.2888 b= M(hy + 2h, + 2k, +h,) = § (0.2000 + 0.4800 + 0.4880 + 0.2888) = 2 x (1.4568) = 0.2468. Hence the required approximate value of y is 1.2428. 2_ 42 Solution. We have f(x,y) = ed ¥ To find (0.2) Here x, = 0,¥)=1,h = 0.2 by = h flag, 9p) = 0.2 (10, 0) = 0.2000 hyo M504 2h + 5h) = 0.2/0.1, 1D. = 0.19672 hey = hf (* +h, Yo +t4) = 0.2/(0.1, 1.09836) = 0.1967 Be, = hf Got hy Yq + hy) = 0.2 (0.2, 1.1967) = 0.1891 1 [0.2 + 2(0.19672) + 2(0.1967) + 0.1891] = 0.19599 = EOhy + hy + 2h + hy ‘Hence (0.2) = yq +k = 1.196. Hichen ENciNcerING MamienaTics: To find (0.4): Here x, = 0.2, = 1196, 4 =0.2 Ry = hfe) = 0.1891 ke (a sino 34) =02/(0.8,1.2906) = 0.1795 ge to + 3h nt 3h) = 0.2 f(0.3, 1.2858) = 0.1793 hy = hfe, + h,y, + hs) = 0.2 (0.4, 1.8753) = 0.1688 1 = pita + Bhp + By thy) = jlo.s91 + 2(0.1795) + 2(0.1798) + 0.1688] = 0.1792 Hence MOA) =y, +h = 1.196 + 0.1792 = 1.3752. Example $2.15. Apply Runge-Kutta method to find an approximate value of y for x = 0.2 in steps of 0.1, iftdy/dx =x +y°, given that y = 1, where x = 0. (W.2.U,, 2009 ; Osmania, 2007 ; Madras, 2000) Solution. Here we take h = 0.1 and carry out the calculations in two steps. Step L x, =0,y)=1,h=0.1 z hy = hf leg ¥9) = 0-1 FO, 1) = 0.1000 hey = hf (x + His 0 + 444) = 0.1 (10.05, 1.1) = 0.1152 bey = hf (x9 + Bs Yo + bha) = 0-1 ((0.05, 1.1152) = 0.1168 Ae = hf eg + h, 9 + by) = 0.1 (0.1, 1.1168) = 0.1347 B= Uh, + 2k, + hy + hy) £ (0.1000 + 0.2304 + 0.2336 + 0.1347) = 0.1165 giving 0.1) = yy + k= 1.1165. Step IL. x, = x5 +h = 0.1, y, = 1.1165, h = 0.1 @ by = hfly, y,) = 0.1 f(0.1, 1.1165) = 0.1347 hy = hf (x + 4h, 91 +44) = 0.1 (00.15, 1.1838) = 0.1551 hea = hf (x +44, 1 + hy) = 0.1 F(0.15, 1.194) = 0.1576 hy = hfe, + h, yo+ hy) = 0.1 f(0.2, 1.1576) = 0.1823 * d= Lb, + 2k, + ky + hy) = 0.1571 Hence 0.2) =, + k= 1.2736. ‘ ‘ sn OY HE Example $2.16. Using Runge-Kutta method of fourth order, solve ory atx'=12, 1.4from © =P given x9 = 1,9) =0. (Mumbai, 2008) Solution. We have f(x,y) = 22+# + xe To find y(1.2) : Here y= 1,9) =0,h = 0.2 Ore fey = h gp Vp) = 0.2 = 0.1462 1 = hf ¥0) 18 1.1402 ages, +01? +a 40.10 ayo 4 4) =U CeCe r | ‘Nusenica. SovuTion or Onpwiany Dirrenenmiat EQuavions, i) Lt [2azcnes eit | 653808 fe ») tuls0+ 500+ (140.17 4040 2(1.2)(0.1399) + e* (1.27 +(1.2)e" Hf (p+ by Vg + hy) = 0.2 { | = 0.1348 1 and (hy + 2h + ky + h,)= g 10.1462 + 0.2804 + 0.2798 + 0.1348} = 0.1402. Hence (1.2) = yy + # = 0 + 0.1402 = 0.1402. To find y(1.4) 1402, h = 0.2 hy = hflxy, ¥;) = 0.2 f(L2, 0) = 0.1348 by = hf (ry + h/2, 9, + hy/2) = 0.2 (1.8, 0.2076) = 0.1303 ey = hf + W/2, yy + hy/2) = 0.2 f(1.8, 0.2053) = 0.1301 ke, = hf Gry + hy y, + ke) = 0.2 (1.3, 0.2703) = 0.1260 Here x, = ke ea, 4+ Dy + Dk + hy) z 10.1348 + 0.2606 + 0.2602 + 0.12601 = 0.1303 Hence y(1.4)=y, +k = 0.1402 + 0.1303 = 0.2705. 4. Use Runge’s method to approximate y when x = 1.1, given that. a pital a aaede ax ty? i 2 Using Runge-Kutta method of order 4, find (0.2) given that dy/dx = 8x + 2y,y(0)=1,takingh=O.1. (V.T.U., 2004) 3. Using Runge-Kutta method of order 4, compute 1.2) and (4) trom 102 =? +y%,y (0)=1, taking =0.1, (Rohtak, 2008 : Bhopal, 2002) 4. Use Runge-Kutta method to find y when x= 1.2 in steps of 0.1, given that : dyldx =x? + 9 and y(1) = (Mumbai, 2007) 5. Find (0.1) and,y(0.2) using Runge-Kutta 4th order formula, given that y’=2*—y and y(0)=1. W.N.T.U, 2006) 6. Using 4th order Runge-Kutta method, solve the following equation, taking each step of h = 0.1, given y(0) = 8, dy/dx = (Ax/y 29). Calculate y for x =0.1and 0.2. (Anna, 2007) “7. Use fourth order Runge-Kutta method to find y at x = 0.1, given that 2 Bet + 2y,9(0) = Oand h = 0.1. (V.2.0,, 2006) 8. Find by Runge-Kutta method an approximate value of y for x = 0.8, given that y =0.41 when x = 0.4 end dy/ds = ary. (S.V.7.0, 2007 8) 9. Using Runge-Kutta method of order 4, find (0.2) for the equation as rae 2S (0) = 1. Take h = 02. (W.7.0, 2011 8) 10. Given that dy/dx = (?— 2g? +x) andy = Latx= 05 find y forx = 0.1, 0.2, 0.3,0.4 and 0.5. (Delhi, 2002) PREDICTOR-CORRECTOR METHODS Ifx;_,and.x, be two consecutive mesh points, we have x, EI 1+ Mgt Fh, y,_ i= _1 +h. In the Euler’s method (§ 32.4), we have 1 BB a ) Hicer Enomcerine Manieuanics, ‘The modified Euler's method (§ 32.5), gives A WAI ort MR 9) + AI (2) ‘The value of y, is first estimated by using (1), then this value is inserted on the right side of (2), giving a better approximation of y,. This value of y; is again substituted in (2) to find a still better approximation of ¥, This step is repeated till two consecutive values of y; agree. This technique of refining an initially crude estimate of y, by means of a more accurate formula is known as predictor-corrector method. The equation (1) is there- fore called the predictor while (2) serves as a corrector of y;. In the methods so far explained, to solve a differential equation over an interval (x,,¥,, ,)only the value of yat the beginning of the interval was required. In the predictor-corrector methods, four prior values are required for finding the value of y atx; , . A predictor formula is used to predict the value ofy at-x,, , and then a corrector formula is applied to improve this value. We now describe two such methods, namely : Milne’s method and Adams-Bashforth method. MILNE’S METHOD Given dy/ dx= f(x,y) andy = yy, x we proceed as { ‘The value ¥, = y(x,) being given, we compute 9, = Hy + WI, p= Hg + A), Yg = yey + Bh), by Picard’s or Taylor's series method. Next we calculate, f= Flay Yoh = Fy + hs a f= Fig + enn) fy = Fig + 3h 99) Then to find y, = y(x + 4h), we substitute Newton's forward interpolation formula ‘9 to find an approximate value of y for x =x, + nh by Milne’s method, Pouy)=frndyy + MOD gop, me +8 in the relationy,=y,+ [°"" fx, yrax ne & vane fo (formas Paty + Jax [Putx = x9 + nh, de = han} no “ =Joth f (f+ ma% 4 f 20 8 =ygth [Af +84 +4" +34'f +] Neglecting fourth and higher order differences and expressing Af,, 4°f, and A*f, in terms of the function values, we get 8 4h seh ‘i AP = 99+ GA fe + Mf) which is called a predictor. Having found y,, we obtain a first approximation tof, = f(x, + 4h, 94). Then a better value of y, is found hy Simpson's rule (p. 1106) as of = 9+ Pet ah fw ‘ch is called a corrector. Then an improved value of f, is computed and again the corrector is applied to find a still better value of _yq We repeat this step until y, remains unchanged. Once y, and f, are obtained to desired degree of accuracy, 9, = y(x, + 5h) is found from the predictor as ” 4h WY = +S Ch fat 2) and f= f(t, + 5h, ¥,) is calculated. Then a better approximation to the value of y, is obtained from the corrector a8 of = 95+ Fs thy + fy. ‘We repeat this step till y, becomes stationary and we, then proceed to calculate y,, as before. This is Milne’s predictor-correetor method. To ensure greater accuracy, we must first improve the accu- racy of the starting valties and then sub-divide the intervals. Example 32.17. Ap Apply Milne’s method, to find @ solution of the differential equation ¥ —y? in the range 0 AG + 4f, +f,), gives yf = 0.4555, f= 0.7925 Again using the corrector, yf = 0.4555, a value which is the same as before. Hence, mi 0.4556. Example $2.18: Given y’ =x(2? +92) 4, 9(0)= L findy ats =04 fi mana a ethio Sees eee feahe * renee | BRE Vik ae Solution. Given yO)=1 and h=01 We have YO=x G2 ye 9G) = G8 + ay?) (— 7) + Bx? + y? xB) y'LO* * [at ay? + Br? + 94 Day's MC) = — €-* [a ay? + Be + 9? 4 Dayy’ + Be? + 9? + Qeyy’ — Ge — yy’ — Bay’? — eyy'] Substitute these values in the Taylor's series, 2 a ya) = 10) 4 yO) + Fy(0) + Fy) + 0.1) = 1 + (0.10) + Form + Lovie 2+. = 1+ 0.005 - 0.0003 = 1.0047 ie, 1.005 ‘Now taking x= 0.1, (0.1) = 1.005, h = 0.1 y'O.1) = 0.092, (0.1) = 0.849, (0.1) =— 1.247 Substituting these values in the Taylor’s series about x = 0.1, Ayors OF yon Ox ya +. (0.2) = y(O.1) + a = 1.005 + (0.140.092) + Me (0.849) + ae 1.247)+ 018 Now taking 2, (0.2) = 1.018, h = 0.1 y'(O.2) = 0.176, y"(0.2) = 0.77, (0.2) = 0.819 Substituting these values in the Taylor’s series (0.8) = (0.2) + F902) + ' 3! = 1.018 + 0.0176 + 0.0039 + 0,0001 = 1.04 ‘Thus the starting values of the Milne’s method with h = 0.1 are Yo=1 4 = 1.005 ¥q= 1.018 a= 1.04 4h Using the predictor, ff” = 99+ Jf -f, +2f)) sit sep [2(0.092) ~ (0.176) + 2(0.26)] = 1.09 x= 04 gif) = 1.09 f, = y'(.4) = 0.362 h Using the corrector, yf =9,+ 5 + 4s +f) VP = 0.018 + ot (0.176 + 4(0.26) + 0.362) = 1.071 Hence OA) = 1.071. Example $2.19. Using Runge-Kutta method of order 4, find y for x =0.1, 0: 9%, (0) = 1. Continue the solution at x = 0.4 using Milne’s method. q W.T.U,, 2008; S.V.7.U,, 2007 ; Madras, Solution. We have f(x,y) = ay +9% To find (0.1): Here = 0,99 = 1,h=0.1. ee a ky =h flay yo) =O. FO.D = 0.1000 y= it (a0 Fh 90 +44) = (0.1) (00.05, 1.05) = 0.1155 ky= i ( + 3h, aot 3) = (0.1) f(0.05, 1.0577) = 0.1172 keg = hf Gey hy q+ hy) = (0-1) (0.1, 1.1172) = 0.13598 ke ia, + Dy + Dk + hy) = doa + 0.231 + 0.2348 + 0.13598) = 0.11687 ‘Thus y(0.1) =y, =yo + = 1.1169. To find 02 Here x, = 0.1, y; = 1.1169, 4 = 0.1. hy =h f,9,) = (0.1) f(0.1, 1.1169) = 0.1359 ag=ht(n + 5h 9 +44) = (0.1) f(0.15, 1.1848) = 0.1581 Iy= na( tht 34) = (0.1) f(0.15, 1.1959) = 0.1609 eg = hf (ry +h 94 + beg) = (0.1) f(0.2, 1.2778) = 0.1888 fee Eh, + hy + Dy thy) = 0.1605 Thus (0.2) =y,=y, +4 = 1.2773. To find y(03): Here x = 0.2, y, = 1.2773, h = 0.1. hy = hf (x 9) = (0.1) (0.2, 1.2773) = 0.1887 hye hf (= rt 3h, wat 3h) = (0.1) f(0.25, 1.3716) = 0.2224 kg = ie + da, Yat 34) = (0.1) (0.25, 1.3885) = 0.2275 hh, = hf Gig + hh ¥o-+ hy) = (0.1) ((0.3, 1.6048) = 02716 bea Eh, + Bhp + Bhy hy) = 0.2267 Ja=Yo +h = 1.504. ‘Now the starting values of the Milne’s method are : y= 0.0 .0000 1169 Jp = 1.2778 . 5049 Using the predictor, 4h HP =%o+ yh - het Hy) *,=04 yp = 1.8844 and the corrector, yP m+ 3 dort iis yi =12773 + 2 11.8869 + 4 (2.7132) + 4.098] = 1.8386 f,= 4.1159 [1026 | Hicven ENGINcERING MATHEMATICS Again using the corrector, of = 1.2773 +S (1.8960. 4 (2.7192) + 4.1160) = 1.8391 f= 4.2182 ff) Again using the corrector ca = 1.2773 + o {1.8869 + 4 (2.7132) + 4.1182] = 1.8392 which is same as (i). Hence y (0.4) = 1.8392. Eee ase 1. Given “ =25 + y,y(0) =2. The value of 5(0.2) = 2.073, 9(0.4) = 2.452, and y(0.6) = 3.023 are got by RK. Method of 4th order. Find (0.8) by Milne’s prediictor-corrector method taking h = 0.2. (Anna, 2004) 2 Given 2 dy/ds: = (1 + x2¥y2and y(0) = 1, (0.1) = 1.06, (0.2) = 1.12, (0.3) = 1.21, evaluate y(0.4) by Milne’s predictor- corrector method. (VLU, 2017S; Madras, 2003) 3, From the data given below, findy atx = 1.4, using Milne’s predictor-corrector formula : 1 1d 12 13 2 22156 24549 2.7514 (V..U, 2007) 4. Using Milne’s method, find (4.5) given Sxy’ +9? ~ 2 = 0 given y(4) = 1, y(4.1) = 1.0049, y(4.2)'= 1.0097, 944.3) 0148, y(4.4) = 1.0187. (Anna, 2007) & It 2 = 2e*=y, (0) =2, 9(0-1) = 2.010, (0.2) = 2.04 and y(0-3) = 2.09 ; find y(0.4) using Mine's predictor-corrector ‘method. (V.7.U,, 2010) 6. Using Runge-Kutta method, calculate’(0.1), y(0.2), and (0.8) given that 2.23, =1,(0) = 0. Taking these. values as starting values, find (0.4) by Milne’s method. [E223 apams-BASHFORTH METHOD Given * =f (x,y) and y, = y(,), we compute 91 = VEy—h),¥ 9 = Wey 2h), y_4=HEq— 3h) by Taylor's series of Euler's method or Runge-Kutta method. Next we calculate (_,=flx)—h,y yf 2=O- 28,9 gf. g=fl%y-Shy ‘Then to find y,, we substitute Newton’s backward interpolation formula fo. )=f+n Vf + _ Harbin Vif bo in nave [rena Al) MY + L(6 + nV fo + meen Wifes) ae [Put x =x, + nh, dx =hdn] ath E(t +nVfo+ ne » Vhs) da ) 1 5 3 =nth (f +3M% +h +3 hot Neglecting fourth and higher order differences and expressing V/,,V"/, and y*f, in terms of function values, we get i =yo+ & oof, - 59f_, + 87f_»—9f_s) (2) ‘This is called Adams-Bashforth preitor formula. Having found y,, we find f, = f (x, + hy,,)- Then to find a better value of y,, we derive a corrector formula by substituting Newton's backward formula at f, ie, nine a sMeniesd f,¢--in FG, 9) =f, + 2Vf + MAM + [la + np + Meee =yot fifa +nYf, BD veg, Ju dn =n th(a-20h- 5A - EVA -) eS Wf t-| de [Putx =x, +nh, dx =hdn) Noglecting fourth and higher order differences and expressing Vf,, Vf, and V°f, in terms of function values, we obtain. yO aye h £m +19f-5f 1 +f.) (8) which is called a Adams-Moulton sree formula. ‘Then an improved value of, is calculated and again the corrector (3) is applied to find a still better value of y,. This step is repeated till y, remains unchanged and then proceed to calculate y, as above. Solution. Here f(x, y) =x? (1 +5). Starting values of the Adams-Bashforth method with h = 0.1, are = 18,94 = 1.979, fy Using th "(ify -59f_. + 377.4 9f.s) 78, fy = 7.004 U: Witte 19 x 5.035 — 5 x 8.669 + 2.702) = 2.575 Hence, 5 Solution. We have f (x, y) = 2e'y. To find 0.1: To find (0.4) by Adam’s method, the starting values with h = 0.1 are yg= 2d 9 = 2.478 y= 8.129 £=03 = 4.059 Using the predictor formula fg fig = 8.467 f= 7.643 f= 10.956 WO =H+ é (55f,— 59f, + 37f)—9f5) = 4.059 + # (55 x 10.957 ~ 59 x 7.643 + 37 x 5.467-9 x 4) 5.383 5.383 f, = 2e* (5.383) = 16.061 Using the corrector formula, h WP = 90+ 2 OA + 19,5, +s) = 4.0586 + e (9 x 6.061 + 19 x 10.956 — 5 x 7.643 + 5.467) = 5.392 Hence (0.4) = 5.392. ‘Bei pn: see iy Siting eoaton retin ? teatired ane toe ob Solution. We have f(x, 9). To find y (0.1): Here xy= 0,99 Lh=0.1 hy = hf (Yq) = (0.1) FO, 1) — 0.1000 he=tt (xy +E hi sta) =(0.1)/(0.05,095) = -0.08525 y= tt (aq+ Zhao +5 he} =O £0.06, 09570 =~ 0.0867 keg = hf (a + fs ¥p + hg) = 0.1) F (0.1, 0.9187) =~ 0.07341 ba Eh, + 2p + by +h) == 0.0883 Thus (0.1) =», =p + = 1 - 0.0883 = 09117 To find y(0.2) : Here x, =0.1,9, = 0.9117, k= 0.1. : ky = hf ey.) =O. F0.1, 0.9117) =~ 0.0731 hy=hf (x z $h, n+ 3 4) = (0.1) (0.15, 0.8751) =- 0.0616 y= Ot (5,4 $4.9 +4 hy) = (02 £0.16, 0.8800) =~ 0.0626 fag = hf le + yyy + hy) = 0.1) F0.2, 0.8491) =~ 0.0521 b= 2 (hy + 2h, + 2g +h) =~ 0.0628 Thus 0.2) =y, =, +h = 0.8494. To find y (0.3): Here x, = 0.2, = 0.8494, 9 = 0.1 hy =f (.¥q) = (0.1) f (0.2, 0.8494) =~ 0.0521 y= Mt (n+ Eh 90+ Eh) =(0.1 710.25, 0.8938) =~ 0.0428 y= ( +Fhorthe] = (0.1) (0.25, 0.828) = 0.0436 Key = hf (x, + hy yy + ky) = 0.1) f 0.3, 0.8058) =~ 0.0349 = 2k + 294 Bk thy) =~0.0438 ‘Thus ¥(0.3)=y, = yy + k= 0.8061 Now the starting values of Adam's method with h = 0.1 are : x=0.0 = 1.0000 [.5=0.0~(1.0)2 =~ 1.0000 ot 0.9117 fg=0.1-(0.9117)? = 1.7312 2 8404 0.2 (0.8494 ~ 0.5215 x=03 9 = 0.8081 .3 — 0.8061) ~0,3498 i Hionen Enomesrane Maren) Using the predictor, AP =96% Be Gof, 59.1 +97F2=9F 9) x=04 9{” = 0.8061 + oe [55 (— 0.8498) — 59 (— 0.5215) + 37 (- 0.7312) - 9 (- 1)] = 0.7789 f= ~ 0.2067 Using the corrector, a? =95+ A Oh +18 +hD) {0 = {? = 0.8061 + Pa [9 (0.2067) + 19 (— 0.8498) — 5 (0.5215) ~ 0.7312] = 0.7785 Hence ‘y (0.4) = 0.7785. ay 1. Using Adams‘Bashforth method, obtain the solution of dy/dx = x - 3? atx= 08, given the values x: 0 02 04 06 oh 0 0.0200 0.0795 0.1762 (Bhopal, 2, Using Adams-Bashforth formulae, determine y(0, 4) given the differential equation dy las = ay and Le) Ot oz 03 oa) Ee 2.0025 1.0101. 1.0228 3. Giveny* =. a2 ~y, (0) =1 and the noe -values (0-1) = 0.90516, (0.2) = 0.82127, (0.3) = 0.74918, eval using Adams-Bashforth method. SVLU. 4. LW Ey ROET ie We te given Sxy’ +? = 2,914) = 1, y(4, 1) = 1.0049, 9(4, 2) = 1.0097 1.0143, 5. Given the differential equation dy/dx = x¥y + x* and the data : ae 1 LL 12 13 ye: 1 1.233 1.548488 1.978921 Undore, 6. Using Adams-Bashforth method, evaluate (1.4), ify satisfies dy/ de +y/x = Ux? and y(1) = 1,9:(1.1) 1.986, y (1.3) = 0.972, [EGS SIMULTANEOUS FIRST ORDER DIFFERENTIAL EQUATIONS ‘The simultaneous differential equations of the type & =fay2) a) and 2 = 9,2) (2) with initial conditions y(x,) = y, and 2(xq) = z, can be solved by the methods discussed in the preceding sections, especially by Picard’s or Runge-Kutta methods. (i) Picard’s method gives Y=Ior ff G20 20) dx, 24 = 2+ Jo, 99,29) de ¥o=%or Jie xedez a+ fanaa Ys=Yo* Jf 90520) dx, 25 =29 # Joy. 29) de and s0 on. (i) Taylor's series method is used as follows If h be the step-size, y, = y (xy +h) and 2, (q+ &). Then Taylor's algorithm for (1) and (2) gives (3) ofA) Differentiating (1) and (2) successively, we get y”, 2”, etc. So the values ¥p’,.¥p", Yo" ANd 2’, 2", Z9""--- AFC known, Substituting these in (3) and (4), we obtain y,, z, for the next step. Similarly, we have the algorithms 2 Benth’ + See 5) iP, Batt (6) Since y, and z, are known, we can calculate y,’,9,”,...and2,’,2,”.... Substituting these in (5) and (6), we gety, and 25. Proceeding further, we can calculate the other values of y and z step by step. (iii) Runge-Kutta method is applied as follows : Starting at (x,,,,2,) and taking the step-sizes for x,y,z to be h, k, | respectively, the Runge-Kutta method gives, hy = HE Yo 20) 1, = hG Yo 20) y= Mt (x0 +5 90+ 5 het +2) 1 1 1 = (sob ato +b Pato + 5h] 1 1 1 1 1 1 By = M1 (40 +5 Ivo +5 tar t0 +5 le} = (5) +2436 %,2 +21) hey Hf (ag + ha yg + hy 2 + Ls) 1, = 18 (xg + hy ¥o + gy 29 #13) Hence M1 =Hot Ry + hy + hy + hy) and 2229+ 20,42, +2, +l) To compute», and 2,, we simply replace x9, Yos 2p BY X11» 2 in the above formulae, as dy de Sy =f ley 224425 and Gr Mendax-y Solution. Here x, = 0,99 = 2,29 = 1, YEH [fase and z=ayt Joes yerdx First approximations y,=y9+ [6 (x, yo.) dx=2+ fiernae-2erehe sy 2 x 1 + Goce ro,a0dde=1+ fie-Mac-1-aee de® Second approximations y, = Jo + [ifesmaddenas [f [x+1-4e+ de) ae , nto $2 4e y= 2y+ [oer arde sit ff. -( +] de 8 at ase Te -2a Bit. Third approximations y,=3o+ [Fs Jn 20d sore Sela te tet: waex Sets ists tas ayn 29+ [ln 9 Ide a ee oo* 2” ae and so on. Solution. Here fix, y,2)= 1422, 6 (x, 9, 2) 1. Let us take h = 0.3. .3 AO, 0, 1)= 0.3 (1 +0)= 0.3 T,=h Cp ¥qp20) = 0.30 x 0) =0 = 1 A J, b= ht (a0 +d haan +i 3h) = (0.3) 0.15, 0.15, 1) = 0.3 (1 + 0.15) = 0.345 1 1 1 T= ho (+ tym tg hn +hn) = 0.3 L (0.15) (0.15)] = - 0.00675, h ky= rs 45% +B +4) = (0.3) 0.15, 0.1725, 0.996625) = 0.8 [1 + 0.996625 x 0.15] = 0.84485 L=he (0+ B.ve+ 8,29 +4) = 0.8 [- (0.15) (0.1725)] = — 0.007762 y= Fly + hy Yip + bys 29 +l) (0.3) f (0.3, 0.34485, 0.99224) = 0.3893 L,=h Ct + hs dg + egy 29 +5) = 0.3 (0.3) (0.34485)] =— 0.03104 1 Hence vag + A) = Ip + 5 (hy + Bky + Bky + hy) ie, 03) = 0+ F [0.3 +2(0.945) + 2(0.84485) + 0.9809] = 0.94488, and 2liyth)=z9+ Ey +2 421,41) ey 2(0.3)=1+ zt 10 + 2 + (0.00675) + 2 (— 0.077625) + (— 0.03104)] = 0.98999 SECOND ORDER DIFFERENTIAL EQUATIONS Consider the second order differential equation 2 ls » 2) By writing dy/dx =2, it can be reduced to two first order simultaneous differential equations de & =fx,y.2) ra fx, 9, ‘These equations can be solved as explained above. for flx, y,2) and 1,, ly. ... for $(x;,y, 2), Runge-Kutta formulae became Plgn Yor Z0) 1, = AOC Yq %9) .2 (0) = 0 0.2(-1)=-0.2 b= Migs Yh yy + Bly 29% FL) Ly=hilay+ 3 yo Phy 29+ HD ).2 (- 0.1) = — 0.02 0.2(— 0.999) = — 0.1998 hg= Msg + F304 Hinze Hh) I= holes + B90 + Blas 29 + 3) = 0.2 (— 0.0999) 0.02 = 0.2(- 0.9791) = — 0.1958 hg = lifts + hig + hy 29 +15) 0.2 (- 0.1958) = — 0.0392 ke= Lhe + Dig + Deg + hey) =- 0.0199 Hence at x = 0.2, Hla +h, Yo + hee 29 +L) 0.2(0.9827) = - 0.1905 EL, + Qly + 2, + 21,) 0.1970 yrath= 1- 0.0199 = 0.9801 Solution. Putting.y = , the given equation reduces tothe simultaneous equations Zexety=0,ys2 fi) We employ Taylor's series method to find y. Differentiating the given equation n times, we get Yneat Mngt Yn + In =O At £=0, 0p ao =— H+ DO y * (0) = 1, gives y,(0) =~ 1,94(0 and y(0) = 0 yields y,(0) = y, (0) = Expanding y(x) by Taylor's series, we have # Z Ce) = 910) + ay (0) + Fy 9460) + 27 (0) + oe 2, yg (0) =-5 x 3... =0. y@)= xt Oe a) 2 and 2G) aye) =-24 9 * From (ii), we have @. ae (0.1) =1- £0. It 2 Higher Enciniceriis Mamenarics 7 " (0.2? , 0.2" _ (0.2) = 1- 2 8 (0.3? | 0.3) 30.3) = 1 5+ From (iii), we have 2(0.1) = - 0.0995, 2(0.2) = — 0.196, z (0.3) = - 0.2863. Also from (i), 2'(x)=— (xz +y) =. 2'(0.1) = 0.985, 2.2) = - 0.941, 2(0.3) = Applying Milne’s predictor formula, first to z and then to y, we obtain 0.87. 2(0.4) = 2(0) + Fone.» = 2'(0.2) + 22"(0.3)} 0.3692 =0+ (# Je 1.79 + 0.941 ~ 1.74} and (0.4) = ¥(0) + 0. 1) (2y” (0.1) — 90.2) + 29" (0.3)) =0+ (4). 199 + 0.196 — 0.5736) = 0.9231 Also 2'(0.4) = — 2(0.4)2 (0.4) + y (0.4)} = {0.4(—0.3692) + 0.9231} = - 0.7754. Now applying Milne’s corrector formula, we get 2(0.4) = 2 (0.2) + g fe’ (0.2) + 42’ (0.3) + 2’ (0.4)) =-0.196 + (ca )-ooa~ ~ 3.48 — 0.7754} = — 0.3692 and OA) =y (0.24 £ Y'(02)4y' (0.8) +10.) = 0.9802 + (Z 2)\-0. 196 ~ 1.1452 ~ 0.3692} = 0.9232 Hence (0.4) = 0.9232 and 2(0.4) = ~ 0.3692. eee a 1. Apply Picard's method to find the third approximation to the values of y and 2, given that dyldx = 2, dzldy 1 =32Q/+2), giveny =1,2 = 5 whenx=0. % Solve the following differential equations using Taylor series method of the 4th order, for x = 0.1 and 02, Dae 9, 0)= = ene LE =~ 29 590) =0 and 2(0)= 1. 4 3. Find »(0.1), 2(0.1), (0.2) and 2(0.2) from the system of equations y’ =x +z,2"=x-9* given y(0) =0, 2(0) = L-using. Runge-Kutta of 4th order. (.N.T.U,, 2008), 4. Using Picard’s method, obtain the second approximation to the selution of ay ay 3 ms ae a ae +x¥y sothat (0) = 1,90) = 5- 5) Use Picard’s method to approximate y when'x = 0.1, given that fy a 4y<0andy = 0.8; 2 £50. 6 Using Runge-Kutta method of order four, solve y” =» + 29", (0) = 1, 90) = 0 to find (0.2) and y'0.2). 7 7. Consider the second order value problem y” — 2y' + 2y = e¥ sint with (0) =~ 0.4 and 3/(0) =—0.6, Using the fourth order Runge-Kutta method, find 9(0.2). (nna, 2003), ‘Noniéhica SoLUTION OF Oroinany DirrenentiaL Equations ety 8. The angular displacement 0 of a simple pendulum is given by the equation where / = 98 em and g = 980 cm/see®, If = 0 and dB/dt = 4.472 at t= 0, use Runge-Kutta method to find 6 and d0ldt when t= 0.2 sec, BOUNDARY VALUE PROBLEMS Such a problem requires the solution of a differential equation in a region R subject to the various condi- tions on the boundary of R. Practical applications give rise to many such problems. We shall discuss two-point linear boundary value problems of the following types : 2 @ es + 1a) + ularly = 2) with the conditions yxy) = a, y(x,) = b. iq Gi 2 + Aely = Ce) with the conditions y(x,) = ’(¢,) = a and y(x,) = y'(x,) =. While there exist many numerical methods for solving such boundary value problems, the method of finite-differences is most commonly used. We shall explain this method in the next section. FINITE-DIFFERENCE METHOD In this method, the derivatives appearing in the differential equation and the boundary conditions are replaced by their finite-difference approximations and the resulting linear system of equations are solved by any standard procedure. These roots are the values of the required solution at the pivotal points. The finite-difference approximations to the various derivatives are derived as under Ify(x) and its derivatives are single-valued continuous functions of x then by Taylor’s expansion, we have we Ww yore h) = yx) + hy’ Ge) + Soy" (a) + Ey") + AD tid he and yer) = yx) — hy") + 57) STI) + a (2) Equation (1) gives y'(x) = ; [yGe +h) yo) - Ayre - 7 1 ie, YG) = 5, Lee +) ya] + O01) which is the forward difference approximation of (x) with an error of the order h. i D(x) —y(ar— Ay) + O(h) which is the backward difference approximation of y'(x) with an error of the order h. Subtracting (2) from (1), we obtain Similarly (2) gives y'(x) YO) = Zee + h) xe hl) + 00%) which is the central-difference approximation of y'(x) with an error of the order h2, Clearly this central difference approximation to y’G) is better than the forward or backward difference approximations and hence should be preferred. Adding (1) and (2), we get 1 d= Fa DEE +h) — Dye) + yee — hy] + OCH) which is the central difference approximation of"). Similarly we can derive central difference approximations to higher derivatives. | 1036] i ES TES) Hence the working expressions for the central difference approximations to the first four derivatives of y, areas under : Y= BiH oe 1 Y= FEMA BWAHD & Giga Dir + M%-1- Hd 1 HE = pO. Miv rt Y~Mor tH) 6) Solution. We divide the interval (0, 1) into four sub-intervals so that h = 1/4 and the pivot points are 0.x; = V4, x = U2, x, = 8/4 and x, = 1. The differential equation is approximated as 1 qe i TY or 16y; , 1 ~ 33y; + 16y;_, Using y, =, = 0, we get the system of equations 16y,- 3), = oy ~Biyg + 16y, = 2 = Bay + 16y, = 3 Their solution gives Solution. Here h = 1/3 and the pivotal points are x, 13, sy = 2/3, xy = 1. The corresponding y- values are yo(= 0), ¥y» ¥os¥s (= 0). Replacing y* by its central difference approximation, the differential equation becomes Oia ier BM 5 HI; 9) + By, = BLP or Vigo- Wisi tT, - 914% 22 i= 1,2 Ati=1, Yg~A¥9 + Ty — 49 +91 = V9 Ati=2, Ye V9+ Wa AY, + Yq= 9 Using y, = 3 = 0, we get —4y, + Typ +y_,= V9 M+ 1-49, = 419 | Niiienicat'Soiron OF Omonity Direrevnat Eovenons ‘Regarding the conditions y", = y”, = 0, we know that 1 =F Oi tH) Ati=0, 9, — By +91) or yaa Ati=3, a >a 2g +90) Using (iii), the equation a becomes = Ay, + 6y, = VO Using (iv), the equation (ii) reduces to Gy, —4y, = 4/9 Solving (v) and (vi), we obtain v1 = 11/90 and y, = 7/45. Hence y(1/3) = 0.1222 and y(2/3) = 0.1566. Solution. Here h = 1/3 and the pivotal points are x, = 0,2, = 1/3, x, = 2/3, x, = 1. The corresponding y-values are yo(= 0), ¥4+ Yoo ¥g- ‘The given differential equation is approximated to FeO a iar tO Mia Hi 2) + 81H, = HH) Ya~ 4¥2* TY, M9 Y= 1 = dys + Tyg 47, + % Ye Me +5491 = = fori =0, Since rel ; 2. fori=3, O= Y= FeO 25 +92) be Y4= By Ye alae: prions 01 M17 Nia) for i= 3, o= waa 1 O5- 2yq + B_—I) I5= 74 — +9, Using (iv) and (v), the equation (i) reduces to Ay, + 8,21 Using (iv) and (vi), the equation (ii) becomes: =Ya* Be- Dye 1 wo) oui) -(vii) viii) oobi) iz Hioser Enoncsrine MarieManics Using (vi) and (vii), the equation (iii) reduces to By 40/p +29, =3 ent) Solving (viii), (ix) and (x), we get ¥; = 8/13, yp = 22/13, 94 = 37/13, Hence y(/3) = 0.6154, y (2/3) = 1.6923, y(1) = 2.6462. ee Solve the boundary value problem for x = 0.5 wy Be 17+ 1= 0,10) = 1) =0. (Take n= 4) Find an approximate solution of the boundary value proble: 9" +8 (sin? nyly = 0, 05x51, (0) = (1) =1, (Taken =4) Solve the boundary value problem ay" +9 = 0,y(1) = 1, (2) = 2. (ake n = 4) Solve the equation yy” ~4y' + 4y = e%, with the conditions »(0) = 0, (1) ‘Solve the boundary value problem y" —64y + 10 = 0 with y(0) = 9 yalue of (0.5) and compare with the true value, Solve the boundary value problem Y" tay +y = 32? + 2, (0) = 0, Y The boundary value problem governing the deflection of a beam of length 3 metres is given by fy say $742 ert, x0= y'(0) =9(3) = 98) =0. i ‘The beam is built-in at the left end (x = 0) and simply supported at the right end (x = 3). Determine y at the, all points x = Landx=2. Solve the boundary value problem, | A. SF + Bly = 72022, (0) = (0) = yA) = 2, taking n = 4. by the finite difference method. Compute the (Usen = 3) Solve the equation y" (0) (FEZEE OBIECTIVE TYPE OF QUESTIONS Select the correct answer or fill up the blanks in the following questions : 4. Which of the following is a step by step method : ARR e e 8 9. 10, ve 12, Gaeraoes (@) Taylor’ s (®) Adams-Bashforth _ (¢) Picard’s (a) None. ‘The finite difference scheme for the equation 2y” + y = 5is Ify/’ =x + y.(0) = 1 andy"%x) = 1 +x + 242, then by Piard’s method, the value of 2) is 1... ‘The iterative formula of Buler’s method for solving y’ = /lx, y) with yxy) ~Yoy is. ‘Taylor's series for solution of first order ordinary differential equations is, Using Runge-Kutta method of order four, the value of y(0.1) fory’ =+ — 2y, 9(0)= 1 taking h = 0.1 is (a) 0.813, () 0.825 (©) 0.0825 (a) none. Given yo, 94,92, ¥y» Milne’s corrector formula to find ». for dyldx = fx, 9), ‘The second order Runge-Kutta fornmul ‘Aidsixe-Bashforth prodictor fordiola to solve, = ls, 7) giveni7g aap Ise = ‘The multi-step methods available for solving ordinary differential equations are ‘To predict Adam’s method atleast ..... values of y, prior to the desired value, are required. Taylor's series solution of y’ =—ay,)(0) = 1 upto xis... Numerical Solution of Partial Differential Equations INTRODUCTION ‘There are many boundary value problems which involve partial differential equations. Only a few of these equations can be solved by analytical methods. In most cases, we depend on the numerical solution of such partial differential equations. Of the various numerical methods available for solving these equations, the method of finite differences is most. commonly used. In this method, the derivatives appearing in the equation and the boundary conditions are replaced by their finite-difference approximations. Then the given equation is changed to a difference equation which is solved by iterative procedures. This process is slow but gives good results of boundary value problems. An added advantage of this method is that the computation can be done by electronic computer. Here we shall apply this method to the solution of important applied partial differential equations. For a detailed study, the reader should refer to author's book ‘Numerical Methods in Engineering and Science’. CLASSIFICATION OF SECOND ORDER EQUATIONS ‘The general linear partial differential equation of the second order in two independent variables is of the form. Pu eu a Als, ») ar Bix, y) aay? Cx, y) Such a partial differential equation is said to be () elliptic, if B? - 4AC < 0, Gi) parabolic, if B® - 4AC = 0, and (iii) hyperbolic, ifB*— 4AC > 0. Nea Rte pe i ee fin ine Mot) 2 * sents = a 1040 ‘Nuvericat Souinion oF Parma, Dirrenenma, Eouancns 1041 Solution. @ Comparing this equation with (1) above, we find that A=1,B=4,C=4 “ —4AC = (4-4 x 1x4=0 Bo the equation is parabolic, (ii) Here A=a?,B=0,C=1-y? fi BP—4AC = 0 ~ 4x? (1 ~y2) = 4x? Q?- For all x between — 0 and «, x” is positive For all y between —1and1,y2<1 2. B’—4AC<0 Hence the equation is elliptic. aD Hersh eas B=5+22,0=44x% = AAC = (6 + 2x? 4 (1 +29) (4 +22) = 86 the equation is hyperbolic. PROBLEMS 33.1 1. What is the classification of the equation f+ 2f,, + fy =0. 2, Determine whether the following equation is elliptic or hyperbolic ? G4 Dr 2 e+ 2h, + +9), =0. 8, Classify the equations ()y?u,,- 20 u,, +2*u,, + 21, (Madras, 2000 S) j) x20e 20% eu ew @) cits ag oy i (@.7-U,, 2009 8) Gi ee ey (Anna, 2008) 4. In tes parts of the (x, y) plane is the following equation elliptic ? ul ax” + 9ulaxdy +(x? +4y)0°u/ a? =2 sin Gy). [EBRD] FINITE-DIFFERENCE APPROXIMATIONS TO DERIVATIVES Consider a rectangular region R in the x-y plane. Divide this region into a rectangular network of sides Ax = hand Ay = k as shown in Fig. 33.1. The points of intersection of the dividing lines are called mesh points, nodal points or grid points. 4 . hy) jw») +h») GLa GAT +L a) ty -h) 7 @i-9) 4 | ® Axah x Fig. 38. Then we have the finite difference approximations for the partial derivatives in x-direction (§ 32.12) : du _ ule +h, y)— ule, y) = + 0th) Hoven Enanecrine Marienarics] ux + h, y) wx ~h, y). ux, y) ule —h, y) = RE + Oh) = + O(n?) and ee a +00) Writing u(x, y) = u(ih, jk) as simply w, » the above approximations become ~l) (2) --@) Ad) (5) (6) TD) wail Bj 26 FMI, OCR (8) e Replacing the derivatives in any partial differential equation by their corresponding difference approxi- mations (1) to (8), we obtain the finite-difference analogues of'the given equations. ELLIPTIC EQUATIONS _ ‘The Laplace's equation y au du Vues Pde Boundary conditions sribed Closed at each region point of C u shaded) get yt oie * are examples of elliptic partial differential equations. Laplace’s equation arises in steady-state flow and potential problems. Poisson's equation 0 arises in fluid mechanics, electricity and magnetism and torsion Fig. 38.2 problems. The solution of these equations is a function u (x,y) which is satisfied at every point of a region R subject to certain boundary conditions specified on the closed curve C (Fig, 33.2). Ingeneral, problems concerning steady viscous flow, equilibrium stresses in elastic structures etc., lead to lliptic type of equations. SOLUTION OF LAPLACE’S EQUATION* 0 fl) * See p. 619 04: Consider a rectangular region R for which u (x,y) is known at the boundary. Divide this region into a network of square mesh of side h, as shown in Fig, 33.3 (assuming that an exact sub-divi- sion of R is possible). Replacing the derivatives in (1) by their difference approximations, we have 1 Be pcg 2 gt oad Z 2u, o ae Mag yt Mage or = 2 Wag Mpa yt Mape rt Mey ad ag Mins Mien Hager Miya (2) This shows that the value of u, , at any interior mesh point is the average of its values at four neighbouring points to the left, right, above and below. (2) is called the standard 5-point formula which is exhibited in Fig. 33.4. Wag Mes tint Fig. 33.4 Fig. 33.5 Sometimes a formula similar to (2) is used which is given by i Mg FOtaseat Meas at Mingo teased 8) ‘This shows that the value of v, ;is the average of ts values at the four neighbouring diagonal mesh points. (3) is called the diagonal 5-point formula which is represented in Fig. 33.5. Although (3) is less accurate than (2), yet it serves as a reasonably good approximation for obtaining the starting values at the mesh points. Now to find the initial values of u at the interior mesh points, we first use diagonal five point formula (3) and compute ts sy Uo, 4 ts, My, 9 ANA Up, , in this order. Thus we get, 1 1 Maa Oi 5t Be # B55 Bi adit4= Fst ty s+ ba, 5+ by, 9) 1 a Uy a= ls, 5 be, 2 tbe, 5# ta, ty, a= 7 Ug,9 +b 5,1 #05,1 40s, 9) 1 tga 5 Org + ba, 14 ty ahs, 2) ‘The values at the remaining interior points i.e. Uz, gy Us, 4» Uy, aNd Us, » are computed by the standard five- point formula (2). Thus, we obtain 1 1 Mag Ora ta, Mana + Mead ta = (ant Mat B55 + s,s) 1 1 Myst baat Past Meat Maadtlga® 2 laet tae t Mya Hg) ‘Having found all the nine values of u, ; once, their accuracy is improved by repeated application of (2) in the form janet = Lpyined in) n+) in) ge ee ig HE Page This formula utilises the latest iterative value available and scans the mesh points symmetrically from left to right along successive rows. This process is repeated till the difference of values in one round and the next becomes negligible. This is known as Liebmann’s iteration process. Solution. Let u, ug .y Ug be the values of u at the interior mesh-points. Since the boundary values of u are symmatiieal about AB. Uy = yy Ug = Upp Ug = Uae Also the values of w being symmetrical about OD, u, = uy, Ug = My Ug = Uy ‘Thus it is sufficient to find the values w,, tug, u, and ‘Now we find their initial value in the following order : u, $2000 + 2000 + 1000 + 1000) = 1500 (Std. formula) (0 + 1500 + 1000 + 2000) = 1125 (Diag. formula) Ug = ja + 1125 + 1000 + 1500)= 1188 (Std. formula) ig = 42000 + 1500 + 1125 + 1125) = 1438 (Std. formula) We carry out the iteration process using the formulae : i wi" = 11000 + ug" + 600 + u,) 1 gD Fay 4 1+ 1000 + ug) 1 ug *P = 512000 + ug) + ef? + uy) lnm eel gD oa First iteration : (put n = 0) uP= $1000 + 1188 + 500 + 1438) = 1032 “= Fase + 1032 + 1000 + 1500) = 1141 ue $2000 + 1500 + 1032 + 1032) = 1391 in faso1 4139141141 + 1141) = 1266 Second iteration : (put n = 1) wis $2000 + 1141 + 500 + 1391) = 1008 uf = £1008 + 1008 + 1000 + 1266) = 1069 uf" (2000 + 1266-+ 1008 + 1008) = 1921 ug? = sat + 1321 + 1069 + 1069) = 1195 Third iteration : 4{9= 11000 + 1069 + 600 + 1921) = 973 uss! = 4 (973 +978 + 1000 + 1195) = 1035 (2) 4 (2000 + 1196 + 973 + 978) = 1288 uf) = 4 (1988 + 1288 + 1095 + 1035) = 1162 Fourth iteration : uf = F000 + 1135 + 500 + 1288) = 956 use) 1 (956 + 956 + 1000 + 1162) = 1019 ug = $2000 + 1162 + 956 + 956) = 1269 ug = Fa2e0 + 1269 + 1019 + 1019) = 1144 Fifth iteration : uy = $2000 + 1019 + 500 + 1269) = 947 24g = foe +947 + 1000 + 1144) = 1010 f= 4 (2000 + 1144 + 947 + 947) ~ 1260 us®)= 1 (1260 + 1260 + 1010 + 1010) = 1188 Similarly, 1, = 942, us = 1005, uJ = 1255, u, = 1180 u,? = 940, uy” = 1008, uw, = 1258, ug” = 1128 u,® = 989, us 1002, uw, = 1252, u®) = 1127 u,® = 939, u,® = 1001, u,® = 1251, u,® = 1126 ‘Thus there is negligible difference between the values obtained in the eighth and ninth iterations. Hence w, = 939, u, = 1001, u, = 1251 and u, = 1126. Solution. To get the initial values of u,, up, us, uy, We assume u, = 0. Then $1000 +0 +1000 + 2000) = 1000 (Diag. formula) (1000+ 500+ 1000+0)=625 (Std. formula) (2000+0+ 1000+ 500)=875 (Std. formula) (875 + 0 + 625 + 0)= 375 (Std. formula) We carry out the successive iterations, using the formulae wntDs + 12000 + 1") + 1000 + us aire De ; lu," * +500 + 1000+ uw, un De } [2000 + 4,44, + 5001 ures F tugs De 0eu"*? 40) First iteration : (put n= 0) 1009 uv= 2000 + 625 + 1000 + 875) = 1125 1000__1000_1000 uu{®= 7 (1126 + 500 + 1000 + 975) = 760 ug= 4 (2000 + 876 + 1126 + 500) = 1000 206 uW= 4 (1000 + 0 + 750 + 0) = 438 Second iteration : (put n = 1) 1000 —— lo ua{®"= £2000 + 750 + 1000+ 1000) = 1188 uj®= FCL188 + 600 + 1000 + 498) ~ 72 u{2!= 7 (2000 + 498 + 1188 + 500)= 1082 a= F032 +0 + 782 + 0)=454 Third iteration : (put n = 2) uP= $2000 + 782 + 1000 + 1032) = 1204 u{8!= 2 (1204 + 500 + 1000 + 454) = 788 i u,® = + (2000 + 454+ 1204 + 500) = 1040 uf= $1040 + 0+ 789+ 0) 458 Similarly, —u = 1207, u,l = 791, uj? = 1041, u = 458 and u,® = 1208, u,® = 791.5, ug® = 1041.5, u, = 458.25 ‘Thus there is no significant difference between the fourth and fifth iteration values. Hence u = 1208, uy = 792, ug = 1042 and u, = 458. Solution. We first find the initial values in the following order : u= to +174 214121) = 12.5 (Std. formula) i w= to +12.540417)=74 (Diag. formula) 21.9 uy = 102.5 + 18.6 +17 +21) = 17.28 (Diag. formula) 4 das +0404 12.1) =6.15 (Diag. formula) y= 102.6494 214 12:1)= 13.65 (Diag. formula) uy = far +125 +74 +17.) = 13.55 (Std. formula) u,= joa +6.2+0+4 12.5) =6.52 (Std. formula) ‘Nunca SoLUTION oF Pasa. DirFenenTiaL EQUATIONS: (17.3 + 18.7 + 12.5 + 21) = 16.12 (Std. formula) ug= puzs 412,146.24 13.7)= 11.12 (Std. formula) Now we carry out the iteration process using the Standard formula : ae = AG +1 + uy? +uf?)] ured = ilu” +17 ug? +uf")] ue? 5 ta se? 419.7 +ug? +21.9)] nf a 1 Taine” $19.7 +f? +uf?)] ae? Flue ull? sult ef] upd = Lage? ale + ng 207] wee ad 4 fo +(e? 48.7 +ug)] pt = alot ule 910.1 ul) use? = Teg? uf 4128419] First iteration (put n = 0, in the above results) 1 ~ (0+ 11.1 + 6.52 + 13.55) = 7.79 =F (ors say? +l”) 4 wp = ; (7.79 +17 + 12.5 + 17.28) = 13.64 1 ws ‘ (13.64 + 19.7 + 16.12 + 21.9) = 12.84 uP =) (047.79 +615 + 12.5) =661 (6.61 + 13.64 + 11.12 + 16.12) = 11.68 & eli Dee Pen ec (11.88 + 17.84 + 13.65 + 21) = 6.09 (0 +6.61 + 8.7 + 11.12) = 6.61 fe (6.61 + 11.88 + 12.1 + 13.65) = 11.06 H uy) == (11.06 + 16.09 + 12.8 + 17) = 12.238 a Second iteration (put n = 1) 1 uy =7 (0+ 11.1 + 6.61 + 13.64) 7.84 ale al uP = 4 (7.84 +17 411.88 + 17.84) = 16.64 i uP = 7 (18.64 + 19.7 + 16.09 + 21.9) = 17.83 uf = 3 (0+ 7.84 + 6.61 + 11.88) = 6.58 i ae (6.58 + 13.64 + 11.06 + 16.09) = 11.84 (11.84 + 17.83 + 14.24 + 21) = 16.23 (0 + 6.58 + 8.7 + 11.06) = 6.58 (6.58 + 11.84 + 12.1 + 14.24) = 11.19 up =} (11,19 + 16,23 + 12.8 + 17) = 14.30 Third iteration (put n = 2) (0+ 11.1 + 6.58 + 13.64) = 7.83 1 uP = 7 (7.8 +17 + 11.84 + 17.83) = 13.637 (11.90 + 17.86 + 14.30 + 21) = 16.27 (0 + 6.56 + 8.7 + 11.19) = 61 Similarly, ul? = 7.82, us? = 13.65, uf? = 17.88, uf? = 6.58, us” =11.94, uf? =16.28, uf” = 6.63, uf? =11.25, uf = 14.33 ul) = 7.83, uf = 13.66, uf = 17.89, ul? = 6.50, uf = 11.95, uP = 16.29, ui?) = 6.64, up) =11.25, uy? = 14.34 SOLUTION OF POISSON'S EQUATION* eu ou St gt HY =) This is an elliptic equation which can be solved numerically at the interior mesh points of a square net- work when the boundary values are known. The standard 5-point formula for (1) takes the form Uy ag t Me agg tM jot Me, jaa 40 j= RP, JA) of) By applying (2) at each mesh-point, we arrive at linear equations in the pivotal values i, j. These equa- tions can be solved by Gauss-Seidal iteration method (p. 938). de ern Sool age TOTNES HY en Solution. Hereh= U3 u, ;_,u,; (Fig. 38.9) * See p. 882. | Nowericnt Souunion oF Patria. DierenennaL Eouwnions ‘The standard 5-point formula for the given equation is Up aj ti tag t Maj nt Mig 1-4 Mi j= A? FU, jh) = h? | B1 Gh jh) =A 8D =i For u, (i= 1,j = 2), @ gives 0+ ug + u, + 100—4u,=-2 Au, + Uy + Uy =— 102 fii) For us (i = 2,j = 2), @) gives u, + 100 + u, + 100-4u, =-4 100 u = 100 te, Uy — Ally + Uy =~ 204 For us (= 1,j = 1), @) gives 0+ u, + 0+, —4ug=—1 ie, ty ~ Aug tu, =—1 snlév) For u, (i = 2,j = 1), gives us +100 + uy —4u,=-2 Uy + Ug ~ 4u, =~ 102 enle) Subtracting (v) from (ii), —4u, + 4u,=Oie. uy =u, ‘Then (iii) becomes 2u, — 4u, 204 and (jv) becomes 21, ~ 4tig = 1 ‘Now (4) x (ii) + (vi) gives —14u, + 4u, = - 612 ie, (ii) + (Wild) gives ~ 121, = 613 pa Thus u, = 613/12 = 51.0833 = u,. From (vi), ; (u, + 102) = 76.5477 1 plas Solution. Here h = 1 (Fig. 33.10). ‘The standard 5-point formula for the given equation is Uae Megas tM get Mi ja Med ‘10(i + j? + 10) For u,(é = 1,7 = 2), @) gives 0+ +0 +us—4u, = 10(1 +4 + 10) ie, a= tuys + 150) For uslt = 2,j = 2), @) gives uy = ay +g + 180) For us(i = 1,j = 1), we have us = Fu +u, + 120) For ui =2, 1), we have wu, = Hug t ig 150) ‘Equations (ii) and (v) show that u, = u,. Thus the above equations reduce to (ug + U5 + 150) alvi) 1 tg = 5 (ut + 90) (vi) 1 ty = 5 uy + 60) ‘Now let us solve these equations by Gauss-Seidal iteration method. First iteration : Starting from the approximations u, = 0, ug = 0, we obtain 4,2 87.5, Then ug) = ors +90) = 64; ug? = 2ors+ 60)=49 11050) Hicnen Enainesrine Marnewancs: Second iteration : ue i (64 + 49 + 150) = 66 ; 14" $166 + 90) = 78440 $ (66+ 60)= 63 Third iteration : u= ; (78 + 63 +150) ~ 73; us dors +90) ~ 82 5 ug? = das +60) ~67 Fourth iteration : f= F624 67 + 160) = 75 us = 1(75 +90) = 825 us 4005 + 60) = 67.5 Fifth iteration : us i (82.5 + 67.5 + 180) = 75 ; ug = 3 (75 + 90) = 82.5 ,uj = (75 + 60) = 67.5 ‘Since these values are the same as those of fourth iteration, we have Uy = 15, ug = 82.5, ty = 67.5 and uy = 75. GE eEERE A, Solve the equation u,, + 1,, = 0 for the following square mesh with boundary values as shown in Fig. 83.11. Tterate, until the maximum difference between the successive values at any point is less than 0.001, Wethi, 2002) 2 Solve V7z =0 under the conditions (h = 1, k= 1), u(0,9)=0, ul4,y) = 124y for 0 0given that u(x, 0) =20, u(0, t) = 0, 065, t)= 100. Compute e u for the time-step with h = i by Crank-Nicholson method. vied (Anna, 2006) Solution. Here c? = 1 and h = 1. Taking oc (i.e., c®k/h) = 1, we get k=1 Also we have oa a a0 100 a - sa vn Then Crank-Nicholson formula becomes ipa Minas * Mia neat Mist Mi 4u,=042040+u, be 4ug=204+204+uy+us ice. 4uz = 20+ 204, +, ie. 20+ 10045 +100 ie. Now (1) ~ 4(2) gives 15, ~ 4u, = 180 4(8) + (A) gives 4uy— 15u, =~ 380 ‘Then 15(5) — 4(6) gives 209u, = 4220 ie. From (5), we get 4u, = 1 x 20.2180 i. From (1), 4u, = 20 + 20.2 ie, From (4), 4u,=2204+30.75 i.e. Thus the required values are 10.05, 20.2, 30.75 and 62.68. Example 33.8. Solve the boundary value problem w, = u,, under the conditions u(0, = u(t, )=0.and) uly, 0) = sin mx, 0 Sx <1 using Schmidt method (Take h = 0.2 and «= 1/2). (Rohtak, 2003), Solution. Since h=02 and a=V2 a= s gives k = 0.02 (2h eo Since o = 1/2, we use Bendre-Schmidt relation £ Gaay* Mio) of) We have (0, 0) u(0.2, 0) = sin m/5 = 0.5875 u(0.4, 0) = sin 27/5 = 0.95111, u(0.6, 0) = sin 3n/5 = 0.9511 (0.8, 0) = sin 4rd = 0.5875, u(1, 0) = sin x= 0 ‘The value of u at the mesh points can be obtained by using the recurrence relation (i) as shown in table Mijn x30 02 Fit) ao de abe Wh nant ee Bees =0,1,.2 - ; tales : Solution. Hore ¢?= 4, h= 1 and k= V8. Thon «= kik? = we have Bendre-Schmidt’s recurrence relation 1 Mi jare gina t Mea? A) u(8, t) 0 for all values of j, i.e., the entries in the first and last column are zero. Now since u(0, 0) = ay gu Oendup 7 : Since u(x, 0) =x ~ E32 tgs ), 3.5, 6, 7.5, 8, 7.5, 6, 3.5 i=0,1, 3, 4,5,6, 7att=0 ‘These are the entries of the first row. a HigHER Encineerine Mariewancs Putting j = 0in (i), we have 1 6, = Oy et Meso) 15 5-10 Men, ‘Taking: 1,2, T successively, we get 1 11> 5 ajo +go)= 2O+0=3 1 1 ga 5 ls, 0 + ta, = 5 (8.5 47.6) = 6.6 1 5,1 = 5 (a, 0* Ha,0)= $6+9)=7 U4, = 7.5, sy = Ty Ug, y= 55, Ue, ‘These are the entries in the second row. Putting j = 1 in (i), the entries of the third row are given by 1 4, a= Mina thea) Similarly putting j = 2, 3, 4 successively in (i), the entries of the fourth, fifth and sixth rows are obtained. Hence the values of u, ; are as given in the above table. Example 33.10. Solve the equation uae | ot ax? f subject to the conditions u(x, 0) = sin nx, 0 $x <1; u(O, t) = u(1, t) = 0. Carry out computations for two levels, taking h = 1/3, k = 1/36. (V.Z.U., 2005) Solution, Here ¢? = 1, h = 1/8, & = 1/36 so that a= keh? = V4, Also u;, 9 = sin W3 =J/8/2, up. = sin 20/3 = /3/2 and all other boundary values are zero as shown in Fig. 33.19. Schmidt’s formula [(2) of § 33.8] ay (= 20) w, ; + a, Uijer Hey 1 becomes Mager 7 inst Bayt Mien .2;7=0 i Uy 1 Glo, o# 2, o# Ma,gl = GO+2% Ja72 + V3/2)=0.65 eas Mg. = Eo Bigg yg = 087 +2x J572 +0)= 0.65 Fori=1,2,j yee lugs +2, 1, ’ tgs Jeg, y #2 ata = ; PROBLEMS 3: 1. Find the solution of the parabolic equation u,, = 2x, when w(0, ¢) the values upto t =5. (4,0) = Oand ulx, 0)=x(4—2), taking h = (Madras: ou 2 Solve the equation with the conditions u(0, 0 0, u(x, 0) =x(1 =x) and u(1,¢) = 0. Assume h= au ae a u for ¢ = k, 2k and 3k choosing an appropriate value of k. (Anna, NuwenicaL SoLunoN oF Parma Dirrenenmia. EQUATIONS: 1055 Given 2F_ a? ot = 0,1, j find the values of ffor.x = ih(@ = 0,1, .., 5) and 310, 0)= FG, 0) = 0, F(, 0) = 24 (2 6) with = Land k= 3 using the explicit method. 4. Solve the heat equation au/dt=2%u/ax” subject to the conditions w(0, t) = u(1,) =0 and Uy, 0) = 2s for OOund |u=Oatz=4,t>0 and initial conditions u = (4x) and du/dt = Oat t= 0, 0< Set, uation numerically for one half period of vibration, taking h= Land k= 1/2. Weta We Solution. Here, h/k = 2=c. - the difference equation for the given equation is Maj = Mi nag t Mie Mi jaa AD) which gives a convergent solution (since & < h). Nowsince uw (0, #) =u (4,£)=0, Oand w, , = 0 for all values of j jo ie nt Sn ee Tae Tua can estab, Since Ug, y= * 4-2), =i (4-1) =3,4,3 fori = "These are the entries ofthe first row. Also 1, (x, 0) = 0 becomes 4, jen — Mj 2h in @, U1 = M10 Mes 1.07 Me, Mp0 Myo 1,07 My,» USINE 1 Uj ot Mie Fret tiee 1,2,3 att=0. = Owhenj=0, givingy, ,=u, Putting j = {1058 | ‘Higten Enamecernins MATHEMATICS ‘Taking i = 1, 2, 3 successively, we obtain = Fao hy) = 25 tas = Fth,oF ts.) =3 These are the entries of the 2nd row. Putting j = Lin O, u;9= 444+ Yi 411-40 Taking i = 1, 2, 3, successively, we get Hae Ug + ty, =04+3-3=0 24+2-4=0 3+0-3=0 By ya Me 2 = Ug + Uy — Uso ‘These are the entries of the 3rd row and so on. Now the equation of the vibrating string of length Z is uy, =e? u,. Tee pariad of vibration: = ot = aie fe Teeande=9) c This shows that we have to compute t,, » upto t = 2. ie, similarly we obtain the values of u, » (4th row) and u, , (5th row). Hence the values of u, , are as shown in the table below : ' ’ {St : i” :lhlhUL 0 3 a 1 2 2 2 o oO 3 -2 -2 4 -38 -3 eu _ au Example 33.13. Find the solution of the initial boundary value problem ; — ae qe Ose: s subject to ‘the itial conditions uls 0) = sin mx, 0 Oxby using in the (a) the explicit scheme. (b) the implicit scheme. anna, 2007) Solution. (a) Explicit scheme Take h=02,k= * -02 c= ¢ We use the formula, 1, j= 4) 1+ jc j—Mjj-a fi) Since u(0, t)=0, u(1, £) = 0, ue ,= 0, u, = 0 for all values of j ie, the entries in the first and last columns are zero. Since u(x, 0) Ug = sin me 14,0 = 0, Up 9 =sin (0.2n) = 0.5878, ug. = sin (0.4n) = 0.9511, ty g = sin (0.6n) = 0.5878. ‘These are the entries of the first row. , 1 ; Since ux, 0)= Owe have F (u,;,,—M; j..=0, whenj=0 ie, alii) “1 tr1,0 + Hes a,07 Mi =1 Puttingj=Oin(®), 4, Using (ii) 3 Minot Hie Miye) Taking |, 2, 3, 4 successively, we obtain the entries of the second row. Putting j= Lin ®t 9= ty a.1# yo. Mi 0 Now taking i = 1, 2, 3, 4 successively, we get the entries of the third row. "Nottehicat SOLUTION oF Parmiac DirrenenmriaL Eouanions: Oy Similarly taking j = 2, j = 3, j = 4 successively, we obtain the entries of the fourth, fifth and sixth rows (b) Implicit scheme We have the formula UF 2A Fe) u, + OP E(u, 5 U1) — Uj Where @= h/h wi) Here = 1. Take'h = 0.28 and k= 0.8 40 that o.= hii = 2 (reduces to tpg 8, ACH, a yA Mya Since 4; 9 = sin me Ug, ) = O-TOTL, Up, ¢) = 0-5, Ug, 9 = 0.7071 There are the entre ofthe rat Since u(x 0) = 0, we have 2 Oy .44~Iy4-1 0, where j Viren sesléti) Putj= 0 and using (iii), (di) reduces to ° Mi =~ Bt, 9 2 (ty 4,0 + 2 41,0) Buy, g +2 (Ugo + Uy, o) = 01213 Buty ¢ + 2 (tty, ¢ + Ug o) = 0.1716 Bulg, g +2 (ug, y+ Uy,q) = 0.1213 Now taking ‘These are the entries of the second row. Putting, = 1, (i) reduces to 92-6, +A gt Mo) Now taking =u 9 =-6 uy 1 +4 (Ug 1 + Uy 3) = 0 $= 2, tty p= Guy +4 (uy 1 + Us y) $= 3,59 These are the entries of the third row. Putting j = 2, (ii) reduces to 6s #4 (lg Hay ty = — Bui, 9 +4 (yaa Fea) Mya Now taking B= 1, uy g=—6 Wy +4 (Ug, y + Ug) Uy, = 0.1097 E52, Uy g=— Fy o +A (tty gt gg) tg 1 = 0.1476 £= 3, Ug g=— 6 Ug g +4 (Ugg + yg) Uy 9 = 0.1097 These are the entries of the third row. Hence the value of u, , are as tabulated below : |. Solve the boundary value problem u,,=u,, with the conditions u(0,t)=u(1,t)=0, u(x, 0)= F201 -z)and uj, 0)=0, taking A =k = 0.1 for 0 <¢< 0.4. Compare your solution with the exact solution at x = 0.5 and ¢ = 0.3. (V.£.U., 2000) ‘The transverse diaplacement u ofa point ata distance x from one end and at any time fof vibrating string satisfies the equation d*u/de? = 25 °w/ax?, with the boundary conditions w (0, t) = w (5, f) = 0 and the initial conditions veo { 20x for Osxs1 [5(5—x) for I

You might also like