You are on page 1of 44
15 Numerical Techniques 15.1 INTRODUCTION In this chapter, we shall deal with tke methods for solving the equations. Sometimes, a rough approximation of a root can be found by graph and more accurate results by the following methods : (® Newton Raphson method or successive substitution method. (ii) Rule of false position (Regula falsi). (iii) eration method. 15.2 SOLUTION OF THE EQUATIONS GRAPHICALLY Step 1. Find a small interval (a, 6) between which the root of the equation lies. Let fa =0 (1) and f(a) = —ve and f(b) = +ve then the root of the equation (1) lies between a and b. For example fQ) = 2?+x-15 =0 fQ)= 8+2-15=-5=-ve £G)= 18+3-15= +6 = 4ve :. The root of the equation lies between 2 and 3. Step 2. Write the equation f (x) = 0 as (x) = w(x) Forexample 27 +x-15=0 or 2 = 15—x Step 3. Prepare two tables for y = 6 (x) and y=y (x) taking values of x between a and Step 4. Plot these points and join them to get smooth curves. Step 5. Note down the abscissa of the point of intersection of the curves y = 9 (x) and W (a). This is the required root of the equation f (x) = 0. Note, Sometimes we do not write f (x) = 0 as 6 (x) = w(x). We adopt the following method : (i) Find a small interval (a, b) between which the root lies. f (a) and f(b) are of opposite sign. (ii) Prepare a table of the different values of x between a and 6, for y = f (x). (iii) Plot these points and join them to get smooth curve. (iv) The real root of the equation f (x) = 0 is the abscissa where the curve cuts the x-axis. Note it. 982 Scanned with CamScanner Numerical Techniques 983 Example 1. Find graphically the positive root of the equation. x 6r-13 = 0. + Solution. 70 SQ) = 8-@-13 =0 (1) 60 . = = 50 ab §(Q) = 27-18-13 = -4 = ~ve oo os f(A) = 64-24-13 = 27 = +e 20 ‘The root of (1) lies between 3 and 4 as f (3) and 29 F (4) are opposite in sign. 40 i 3 = i= Lobo, (1) is wriken as 23 = 6r+13, y = x3 ° ao aa es a x and y= 6r+13 Let us draw two curves for y = 23 and y = 6x + 13. yar x 3 32 34 36 38, 40 y 27 328 393 467 549 64 y= 6r+13 x 3 32 34 3.6 38 4 y 31 322 334 346 35.8 37 Let the origin be (3, 0). The graphs of y = x3 and y = Gx + 13 are sketched in the figure. The abscissa of the point of intersection of two curves is 3.2. The root of the given equation is 3.2. Ans. Example 2. Solve graphically the equation x ~ Solution. We take two equations y =x — 1 and y = sin x. Let us find out the abscissa of the point of intersection of the line y = x — 1 and the curve y = sin x and give a rough estimate of the root. For the straight line y sin x. -lssnx 1, we have the table = x 0 1 3nd =I 0 14 For the sine curve, we have the following table = 0 mA w2 3nd yesinx 0 o71 1.00 on 0 On the same axes, and with the same scale construct the graphs of y=x—1 and y = sin x. From the graph, we get x= 1.95 radians approximately. Ans, Scanned with CamScanner 984 Numerical Techniques EXERCISE 15.1 2 and y = - 2x + 20 and find the approximate solution of the equation Draw the graph of y x84 2-20 = 0. ‘Ans, = 2.47 2. Solve graphically x° - 2x—5 Ans, 2.099 3. Solve graphically x8 —x- +2 Ans. ~ 0.2 4, Solve graphically e*—5x*=17 = ‘Ans. 1.04 5S. Draw the graph of y= e*~" and find graphically the values of the root of the equation 3— x =e. Ans. 144 15.3 NEWTON-RAPHSON METHOD OR SUCCESSIVE SUBSTITUTION METHOD By this method, we get closer approximation of the root of an equation if we already know its approximate root. Let the equation be f(x) = 0. ol) Let its approximate root be a and better approximate root be a + fh. Now we proceed to find i. Fla+h)= 0 approximately [asa + h, is the root of f(x)=0] (2) By Taylor’s theorem Fath) = f@+hf (a) Ep (a) + or flath) = f@+hf’ (a) 3) Since h is small, we neglect the 1? and higher power of h. From (2) and (3), we have _ , fla) O= fla@+hf'a) or h=~ Fe or athsa-L 24, [First approximate root = a] £@ Second approximate root a3 = a, - £4). f(a) Similarly third approximate root, ay = a; -L Ff’ (a) By repeating this operation, we get closer approximation of the root. Note, (1) In the beginning, we guess two numbers } and c such that f (b) and f (c) are of opposite sign. Then the first approximate root a lies between b and c. (2) IE f(x) is zero or nearly zero, this method fails. Example 3. Starting with xp = 3, find a root of x ~3.x-5 = 0, correct to three decimal places. Use Newton-Raphson method. Solution, f(x) = 8-3x-5 =0, f’(@) = 38-3 f@) = 27-9-5 = 13, f’(3) = 27-3 = 4 (0) £(3) 13 = %- =3- = 3-35 = 3-0.5417 = 2.4583 Me™" FG) FG) Scanned with CamScanner Numerical Techniques 985 7.4583 £24589) _ 5 4sg3_ 2.4812 id F(.4583) 7207 = 2-4583- 0.1640 = 2.2943 = (2.2943) _ _ 0.1939 _ X3 = 2.2943— F (2.2943) = 2.2943 12.7914 > 2.2791 £(2.2791) = 0.0010 Hence the required root = 2.2791 Ans. Example 4. Find the real root of the following equation, correct to three decimal places, using Newton-Raphson method. w-2x-5 Solution, 3-2-5 = 0 ol) Let fla) = 8-2x-5 fQ)=8-4-5=-1 £(2.5) = (2.5)>-2(2.5)-5 = +5.625 Since f(2) and f(2.5) are, of opposite sign, the root of (1) lies between 2 and 2.5 ; £(2) is near to zero than f(2.5), so 2 is better appropriate root than 2.5. Ff’ Q) = 37-2 f'Q) = 12-2 = 10 Let 2 be an approximate root of (1). By Newton-apson method fl _, £2), 14 L£@ Fe ) o FQA) = 2.1)-22.1)-5 = 9.261-4.2-5 = 0.061 Sf’ QU) = 3217-2 = 11.23 a = 94 -f20 _ 0.061 Z _ a Feat 7 21 tag = 21—0.00548 = 2.09457 F (2.09457) = (2.09457) — 2 (2.09457) — 5 9.1893 — 4.18914 — 5 = 0.00016 f” (2.09457, ones 2 = = 13.16167~ 2 = 11.16167 - (2.09457) 0.00016, - 4s = 2.09457 - 05 aogsyy = 20857 — a na = 2.09457 + 0.000014 = 2.09456 ‘As a3=a2 correct upto four places of decimal, hence the root of (1) is 2.0945. Ans. Example §. Find an interval of length 1, in which the root of S()=3.8 —4° —4x—7=0 lies. Take the middle point of this interval as the starting approxi- ‘mation and iterate two times, using the Newton- Raphson method. Solution. fx) = 3.8-4x2-4x-7=0 (I) fQ) = 24-16-8-7 =-7 {@) = 81-36-12-7 = +26 The root of (1) lies between 2 and 3 as f(2) and f(3) are of opposite sign. The middle point of this interval is 2.5. £ (2.5) = 46.875— 25 — 10-7 = 4.875 f/Q) = 92 -8x-4 Scanned with CamScanner 986 Numerical Techniques S25) = 56.25~ 20-4 = 32.25 By Newton-Raphson method a, =a-£2 ana S@) = 25-L£25) _ 45 4875 45 915 = a = 25—F,G gy = 25— 39 9g = 25-015 = 2.35 F (2.35) = 38.93 22.09 9.4—7 = 0.44 Sf’ (2.35) = 49.7-18.8-4 = 26.9 = 2.35 £239 _ 455 044 _ 9 55_. My = 2.35—Fy ag ~ 235—a¢9 = 235-0016 = 2.334 (2.334) = 38.14—21.79—9.34—7 = 0.01 which is nearly zero. Hence the required root is 2.334 Ans. Example 6. By using Newton-Raphson’s method, find the root of x4—x~10 = 0, which is near to x = 2 correct to three places of decimal. Solution. fi) = t-x-10 = 0, f’(x) = 48-1 fQ) = 16-2-10=4 f'Q) = 32-1531 By Newton-Raphson’s method a2 a-£. 2 £2) F@ Fe 129 = 1.871 ‘£(L871) = (1.871) 1.871 —10 = 12.25 ~ 1871-10 = 0.379 f’ (1.871) = 4(1.8793—1 = 4% 6.5497-1 = 25.1988 = a7 fs) _ 0379 _ se _ a2 = LSTA gay = EST ge ggg = 1871-00150 = 1.856 £(1.856) = (1.856}4— (1.856) — 10 = 11.8662—11.856 = 0.0102 £1856) = 4 (1.8563—1 = 4x 6.3934—1 = 24.5736 - £0856) _ 5 ge 0.0102 _ gee 4s = (1.850)- Free, = 1856- a9 755 = 1856 -0.00082 1.8556 f (1.8556) = (1.8556)* ~ (1.8556) ~ 10= 0.00038 f' (1.8559 = 4 (1.8556)"—1 = 24.5572 _ _ £08556) _ _ 0.00038 _ _ = fy = 18556-777 rs = 18556— Dg g57p = 1-8556— 0.00002 = 1.85558 = 18556 (say) As ay = a5 correct upto four places of decimals, so the correct root of the given equation is 1.8556. Ans. Example 7. Determine the root of x¢+x3—7x2—x +5 = 0 which lies between 2 and 3 correct to three decimal places. Solution. fx) = tt8-72-x45 = 0 Scanned with CamScanner Numerical Techniques 987 or fQ) = 16+8-28-2+5=-1 or £Q) = 81427-63-3+5 = +47. Root lies between 2 and 3 Taking x, = 2 as first approximate root. (a) [Abra ets ] =H Le FO o JS (2) = 32+12-28-1 = 15 or im = 2.067 = 2.067— ar = soy 2 = 2.067 +-0,0001519 = 2.0671519 Ans. Example 8. Using Newton-Raphson method evaluate to two decimal figures, the root of the equation e* = 3x lying between 0 and 1. Solution. FQ) = e&-3x=0 £O) f(l) = e!-3 = -0.2817 The middle point of the interval (0, 1) is 0.5. £(0.5) = &3—3 (0.5) = 1.649— 1.5 = 0.149 f'@) = &-3, f/(05) = OS-3 = 1.649-3 = - 1.351 By Newton-Raphson method a, fa. f'(@) = (0.5) 49 11=0.61 so a = 05-7 gy = 05 y gg = 0540.11 =06 F(0.61) = 6! —3 (0.61) = 1.84—1.83 = 0.01 Sf’ (0.61) = 84-3 = —1.16 = 0.61 £06) _ 96,29 _ 961, - a= Fan 7 O81 y ag = 061+ 0.0086 = 0.6186 £(0.6186) = 515 3 (0.6186) = 1.8563~ 1.8558 = 0.0005 x = 0.6186 Ans. Example 9. Compute the real root of xlogiox—1.2 = 0 Solution. xlogyox—1.2 = 0 Let F(a) = xlogiox—1.2 or f(3) = 3 logy 31.2 or (@) = 3x 0477112 = 1.431312 = +0.2313 and f(2) = 2x 0.3010- 1.2 = 0.6020- 1.2 = - 0.5980 £() is +ve and f(2) is -ve, so the root of the given equation lies between 3 and 2. F(x) = xlogix— 1.2 = 0.4343x log. x— 1.2 S/ () = 0.4343 log. x+ 0.4343 = logig x + 0.4343 Scanned with CamScanner 988 Numerical Techniques Taking x, = 3 as first approximation, we have x (By Newton's method) 3logio3— 1.2 =3- = = 3-0.2538 = 2.7462 a jog 304343 > 09114 ~ > 055! 2.7462 logig 2.7462 — 1.2 0048 = 2.7462 7462, — ———— = 2.74 Ans. 33 = 2.7462 TO 2.7462 + 0.4343, ‘7402 9 e739 = 27407 on 4 Example 10. Write the Newton-Raphson procedure for finding VN, where N is a real 4 number. Use it to find VIB correct to 2 decimals, assuming 2.5 as the initial approximation. Solution. Let x = VW = 8 =N orY-N=0 Let f(x) = 8-N= 0 f’(@) = 38 B _ fin) yy Newton - Raphson Method, p41 =» - 522 Sn) Spc my SN PN ga. Buy Repeat this method. Exercise 15.2 Solve the fllowing equations by Newton's method: 1 Y-2x-5=0 ‘Ans. 2.0946 2 8-2x405 = 0 Ans. 0.2578 3. 3848748245 =0 (AMLE.TE,, Summer 1995) ‘Ans. - 1.67 4, 8-5x4+3=0 Ans. 0.6565 5. x-2sinx = 0 (AMIELTE,, Winter 1997) Ans. 1.8955 6 xe'-2=0 Ans. 0853 7, 8-4sinx ‘Ans. 1.9337 8 Apply Newton-Raphson method (o find an approximate solution of the equation e*~ 3" = 0 correct upto three significant figures (assume x = 0.4 as an approximate root of the equation), Ans. 0.619 9. Determine approximately the root of the equation x + loge = 3.375 correct to two significant figures. ‘Ans. 2.911 10. Determine approximately the smallest positive root of the equation x°+2x—2 = 0, carrect to two significant figures using Newton-Raphson method. Ans. 0.7482 1. Design a Newton-Raphson iteration to compute the cube-root of a positive number, N. Perform two iterations of this method to compute (2)"° starting from x = 1. ‘Ans. 1.264 2 033 12. A root of the equation e" = 1 sete x a is close to 2.5. Find this root to three decimal places, using Newton-Raphson method. (AMLE.E., Summer 1997) Ans, 2.364 Scanned with CamScanner Numerical Techniques 989 154 RULE OF FALSE POSITION (REGULA FALS}) Let f(@y=0 =) Let f(x) be represented by the curve AB. ‘The curve AB cuts the x-axis at P. ‘The real root of (1) is OP. The false position of the curve AB is taken as the chord AB. The chord AB cuts the x-axis at Q. The approximate root 9 of f (x) = Ois 09. By this method, we find OQ. Let A [a, f(a], B [b, f(b)] be the extremities of the chord fb, (0) AB. ‘The equation of the chord AB is y-f(a) = fot) (x-a) (Two points form) ‘To find 09, put =pea) = FO=LA) (ay fO-F@ SO)-F@ += afO)=bf@) SO)-Fla) Repeat the above rule. Example 1. Find an approximate value of the root of the equation x3 +x-1 x = J, using the method of false position (regula falsi) two times. Solution. f(x) = Y+x-1=0 fdy= 141 0 near F(5) = (5) +(5)- 1 =-.375 ‘The root Sies between .5 and 1. Let x= 05 and x =1 xy = oes) gy xy = PSM —1f0.5) Fea)—FCa) = 0.51) - 160375) ~ 140.375 Now (0.6363) = ~0.1061 and f(1)=1 Root lies between .6363 and 1. 25 = 0.6363, 9 = 1 — 0.6363 f(1) ~ 1 f(0.6363) _ 0.6363 - 1 (0.1061) _ 9 6715 SO) -F(0-5) 0.6363 “ (1) — (0.6363) 1+ 0.1061 New, f (0.6712) =~ 0.0264 and f(1)=1 xg = MOTIF) 1 F(0.6712) _ 0.6712 (0.0264, F(1)— (0.6712) 10.0264) = 0.6797 Ans. Scanned with CamScanner 990 Numerical Techniques Example 12. Find the root of the equation 2x — logio x = 7 which lies between 3-5 and 4, correct to five places of decimal, using method of false position. Solution, 2x—logiox = 7 or 2x-logwx-7 = 0 FQ) = 2x—logiox—7 £(4) = 8-logig4—7 = 1- 0.60206 = 0.39794 £@.5) = 7~logi93.5~7 = - 0.54407 The root 23 lies between 3.5 and 4. By False position method nf) =m f(t) _ 3.5f(4) 4 F035) S62) Fa) F(A) -F(3.5) 3.5 (0.39794) ~4 (0.54407) _ 1.392794 2.17628 _ 3.56907 _ 5 r9699 0.39794 (~ 0.54407) 0.94201 0.94201 ‘f (3.78878) = 7.57756~0.57850-7 = — 0.00094 Again applying False position method xy = 278878((4) — 4 f G.78878) __ 3.78878x 0.397944 x (- 0.00094) ‘F(4)—£(3.78878) 0.39794— (— 0.00094 ) _ 1.50771 + 0.00376 0.39888 Example 13. Find by the method of Regula Falsi a root of the equation W422 —3x—3=0 lying between 1 and 2. Solution. f(x) = 9 +7—3x-3 = 0 f() = 141-3-3 =-4 = -ve fQ) =84+4-6-3=43=+0e The root lies between 1 and 2 as f (1) is -ve and f (2) is +ve. By Regula Falsi method: Ans. _ 1f()=2f() _ 1x3-2x- F(2)-F) 3-4) (1571 + (1.571)? 3 (1.571) -3 3.877 + 2.468 4.7133 = ~ 1.368 = -ve The root lies between 1.571 and 2 as f (1.571) is —ve and f (2) is + ve. ay = ESTFQ)—2 0.57) £2)-fASTI) = 1.571 x 3—2 x (1.368) = 4.713 + 2.736 = 1.705 3-(- 1.368) 4.368 (1.705) = (1.705)3-+ (1.705)?—3 (1.705) -3 = 4.956+2.907—5.115—3 1.252 = — ve. ‘The root lies between 1.705 and 2 as f (1.705) is —ve and f (2) is +ve. ny = 1:205f(2)~ 2.709) _ 1.705%3-2% (0.252) _ | 49g SS FQ)-F0-705 30252) 571 SST) Ans. Scanned with CamScanner Numerical Techniques 991 Example 14. Find the approximate value, correct to three places of decimals, of the real root which lies between — 2 and — 3 of the equation x’ — 3x+4 = 0, using the method of false position three times in succession. Solution. f(x) = °-3x+4 = 0 m=-2m=-3 SQ) = f(-2) = 23-3 (-2) +4 = -8 4644 = 2 (2) = f-3) = (-38-3(-3) 445-274 9445-14 = SG) eS) _ = 23) fC2) _ -2C14)- (3) 2) _ 2846 _ 34 Fo) Fea) FE 3)-FE2 14-2) “16 16 = = 2.125 (2.125) = (— 2.125)? 3 (-2.125) +4 = — 9.596 46.375 +4 = 40.779 S(-3) =—14 and f(—2.125) = +0.779 Root lies between — 2.125 and — 3. (2.125) f(—3) — (3) f(- 2.125) _ (= 2.125) (= 14) ~ (3) (0.779), f(-3)-F(H2.125) (14)- (0.779) _ 29.750+2.337 _ 32.087 _ “14.779 “14779 ~ 17! f(=21T1) = (-2.1718-3 (- 2.171) +4 = ~ 10.2246.513 +4 = +.293. f(-3) = 14 and f(-2.171) = +0.293 Root lies between — 3 and — 2.171. p= CAAT FEI) —CIFE2IM _ (2.171) © 14) 3) (293) SE3)-FE2IT 14-293 —_ 30.494+.879 31.273 =" y4293 > 14.3937 > 188 Ans. Example 15. The negative root of the equation 3x3+8x2 +8x+5 = 0 is to be deter- mined, Find the root by Regula Falsi method. Stop iteration when f(x;) <0.02 (AMLE, Summer 2001) Solution, f(x) = 3°4+8x2+8x+5=0 S(-1) = 348-845 = 42 F(- 15) = 3 (— 1.59 +8 (— 1.5) +8 (— 15) +5 =~ 10.125+ 18-12 +5 = +0875 S(C-1.6) = 3(-1.6P +8 (— 1.6)? +8 (— 1.6) +5 = — 12.288 + 20.48 —12.8+5 = + 0.392 F(-17) = 3(- 1.7948 (= 1.77 +8(- 1.9) +5 = ~ 14.7394 23.12- 13.645 = - 0.219 Since f(— 1.6) and f(—1.7) are of opposite signs so the root lies between ~1.6 and —L7. By Regula Falsi method: ay = PEGE ED (ELIS. _ =1.6(— 0.219) ~(—1.7) 0.392 ‘ F(-1.2)-f(- 1.6) — 0.219 — (0.392) 0.3504 + 0.6664 _ _ 1.0168 = — 1.664 ol SCt*C«CT SF (1.664) = 3 (— 1.664)) + 8 (— 1.664)? + 8 (— 1.664) +5 Scanned with CamScanner 992 Numerical Techniques =~ 13,822+22.151- 13.312+5 = 0.017 f(=1.664) = 0.017< 0.02 Hence the negative root of the given equation is — 1.664 Ans. Example 16. Determine the root of Mte-72-x+5=0 which lies between 2 and 3 correct to three decimal places. Solution. FQ) = t+ 8-W- x45 =0 £2) = 16+8-28-2+5 =-1 £Q) = 81427-63-345 = 447 f(Q2) = —1 isnearerto zero than +47. Root is near to 2. Let us try on 2.1. SQA) = (21+ (2.1)'-7 (2.1)? (2.1) +5 = 19.4481 + 9.261 - 30.87- 2.145 = +0.7391. Now the root lies between 2 and 2.1. By the method of False position : = Gf ()—bf a) _ 2fF(21)-2.1f(2) _ 2 (0.739) = 2.1 1) *="FO-S@ FRM -FQ) (0.739) ~ (- 1) _ 14782421 _ 3.5782 _ ~ 1.739 1.739 ~ 7-576 £ (2.0576) = (2.0576) + (2.0576) ~7 (2.0576)? — (2.0576) +5 = 17.9244+ 8.7113 — 29.6360-—2.0576+ 5 = — 0.0579 xp = 2:0576F(2.1) — 2.1 f (2.0576) __ 2.0576 (0.7391) — 2.1 (= 0.0579) = = ‘F(2.1)-F(2.0576) 0.7391 - 0.0579 ) _ 1.5208-+0.1216 _ 1.6424 _ = "0.7970 ~ 0.7979 ~ 70607 F (2.0607) = (2.0607) + (2.0607) ~7 (2.0607)? — (2.0607) +5 = 18.0326 + 8.7507 - 29.7254 - 2.0607 + 5 = — 0.0028. _ 2.0607 f (2.1) ~2.1 (2.0607) _ 2.0607 (0.7391) — 2.1 (— 0.0028 X= ‘F(2.1)—F(2.0607) 0.7391 — 0.0028) 1.5231+0.0059 _ 1.5290 = 07419 ~ 0.7419 ~ 70608. The root of the given equation is 2.0609. Ans. Exercise 15.3 Solve the following equations by Regula Falsi method 1 ¥-2r-5=0 Ans. 20046 2 x! 10 4+40r-35 Ans. 1.1975. 3B P+P+3r44 = 0 Ans, -1.22248 4, x8-x*--1= Ans. 1.4036 5. 2° -9x+1=0 (Root between 2 & 3) Ans. 2.9416 6 -5r-7 20 Ans. 2.746 7. ¥-x-1=0 Ans. 1315 8. 30—5x243x-5=0 (AMLE.TE, Summer 1997) Ans. 1.6629 Scanned with CamScanner Numerical Techniques 993 9. “The smallest positive root of the equation x = & is to be determined. Show that the root Ties in (0, 1). Using the Regula Falsi method, find the root correct to three decimals. (AMLETE, Summer 1996) Ans. 0.6065 410. Obtain a root of the equation 2° 4x ~ 9 = 0, comet to three decimal places using the method of false position. Ans. 2.7064 11, Use the method of false position to find the root of the equation x*— 18 = 0, given that it lies between 2 and 3. Write down three steps of the procedure. Ans. 2.621 12. Find the root of the equation tan.x-+ tanh = 0 which Ties in the interval (1.6, 3.0) correct to four significant digits using any one of the numerical methods. Ans. 2.365 app. 155 ITERATION METHOD Let so wa ) (1) can be written as x = (x) (2) where |‘ (x)|<1 2. Let first approximate root be x1 = a Second Approximation x2 Putting x = x; in R.H.S. of (2), we have x2 = (x1) Similarly x3 = (35) By repeating this method, we get the better approximation of the root. Example 17. Use the method of iteration to solve the equation x = exp (—x), starting with x = 1.00. Perform four iterations, taking the readings upto four decimal places. Solution. x = &* ) G(x) = €*, 8G) = I9’@)| = 19'()| = = 3679 <1 Putting x = 1 in (1) we get x 0.3679 Putting x = 0.3679 in (1) we have x» = €°35 = 0,692 Putting x = 0.692 in (1), we obtain x3 = 90 = 0.5 Putting x= 0.5 in (1), we get x, = e 9 = 0.6065 Ans. Example 18. Find a real root of the equation x + 2 — 1 = 0 by the method of iteration. Solution. fj = 442-1 AL) f(O7) = 0.343 +0.49—1 = ~0.167 = ~ve ‘f(0.8) = 0.512+0.64-1 = +0.152 = +ve As f (0.7) and f (0.8) are of opposite sign, so that root lies between 0.7 and 0.8. Let the first approximate root be 0.7. 8+2-1=0 o S=1-¥% x= (1-x)% x= (x) where g(x) = (1-27)* | 9 (.7)| = .73<1 x, = 1-(7)°% = (1.49) = (0.51) = 0.799 x = [1—(0.799)2] = (1 — 0.63840) = (0.316) = 0.712 Scanned with CamScanner 994 Numerical Techniques a5 = [1- (0.7121 = [10.507 = (0.493) = 0.79 xy = [1- (0.79) = [1 — 0.6341)” = (0.3759) = 0.722 [1 (0.722)3]4 = [1- 0.5212] = (0.4788) = 0.782 xs= S(7.82) = (.782)3 + (.782)*— 1 = 0.478 +0.611—1 = 0.089 Root = 0.782 Ans. Example 19. Find a solution of x!-+x—1 = 0 by iteration. Solution. f(a) = 9+x-1= 0 ‘The approximate root of the given equation is 1 as shown by rough sketch. We can write the equation in the form 1 thus a.) =— Tre tS Tae 1 veg) = | 28 way) = & Let °W=Te Wool =| Tap |" MI=7 <1 = 05 4¥ 400 1.0 = 0.800 } Xe a = 0610 ~ = Trap F = 1 y 4 = > = 0.729 ¥y “= Ty @.eoF t Similarly Xs = 0.653, xx = 0.701. ° px ‘The exact root is 0.682328. Ans. ” ” Exercise 15.4 Solve by iteration method 1, 1+logx 5 Ans. 5.36 2 sinx = od [lint. Approximate root= 5.5] Ans. —5.5174 3. Use the method of iteration to find a root, near 2, of the equation x° = x°4x41. Carry aut five iterations. Ans. 1.8408 15.6 SOLUTION OF LINEAR SYSTEMS Here we shall discuss two methods for solving the linear systems i.e., Gauss-Seidel and Crout’s methods. Gauss method By this method elimination of unknown is done more systematically and we have a check to detect the errors. The method is explained in the following example : Example 20. Solve the following simultaneous equations Qxt3y+z= 13 x-y-2z=-1 Scanned with CamScanner Numerical Techniques 995 Bxtyt4e= 15 Step 1. We write the equation, first, which has unity as coefficient of x, otherwise divide the equation by the coefficient of x to make it unity. Thus x-y-2z=-1 2xt3ytc= 13 Bxtytde= 15 Step 2. To eliminate x, subtract suitable multiples of first equation from the remairing equations, and we get x-y-2z5-1 Sy+52= 15 (2)-2(1) 4y+10z = 18 @)-3() Step 3. The coefficient of y is made unity in none of the resulting equations and we have x-y-2z=-1 yte=3 5 (2) 4y+10z = 18 Step 4. To eliminate y, subtract suitable multiple of second equation from the third. Thus we have x-y-2z=-1 ytes3 62=6 Step 5. Start from bottom and substitute. 6z=6 or z=1 yto=3 or y#1=3 or y= x-y-22=-1 or x-2-2=-1 or x=3 Now the solution is presented in the table given below in a compact form. Tt contains only the coefficients of the unknowns and constant term from step 1. One additional column contains the sum of all the numbers appearing in each row. Step No. ofrow [x z Constant | Check sum_ | Explanation 1 1 1 2 “1 3 2 2 1 B wo 3 3 1 4 1s 23 2 4 1 =I 2 “1 3 5 0 5 5 15 25 @)-20) 6 0 4 10 18 2 @)-30) 7 1 1 3 3 156) 8 0 6 6 2 O-4 9 1 1 2 146 (8) Cheek sum [7 12 4 o 12 From (9), z=l From (7), yizs3 or yt1=3 or y=2 From (4), x-y-22=-1 of x-2-2=-1 or x=3 Scanned with CamScanner 996 Numerical Techniques Note: (1) Sum of the numbers in the check column should be equal to the sum of the numbers in last check row. If the two do not tally some mistake has been made and must be rectified. (2) In each step the coefficient of the first unknown is called the pivotal coefficient. 15.7 CROUT’S METHOD In Gauss elimination method, the number of steps increase rapidly with the number of unknowns, that method is laborious and time-consuming. To save labour, there is one method known as Crout's method or Cholesky’s method. It will greatly facilitate solution if we could transform the equations. ay xtapytayz = by yy X4 yy Y + yy 2 = by ~) 431 X4 dy V+ G33 z= by into the equations of the triangular form xtmpy tmz = C1 req Equation (2) on backward substitution gives the values of x, y, Let us write down equation (1) and (2) in the matrix form as upper triangular matrices. (2) AX=B 3) and Ux=C (A) Mm Ar 413 Town ms where A=|ay ay a@3| and U=|0 1 us yay, 33 oo 1 are upper triangular matrices. x ba “1 X=|y|.B=)h|,C=|e z bs % Now if A= LU where Z. is a lower triangular matrix. On puting the value of A = LU in (3), we get LUX =B or LO=B since UX = C from(4) Since LU = A and LC = B, By combining these two relations, we get_ (U/C) = (A/B) (5) where (U/C) are augmented matrix of (3) and (4). From (5), we have m0 0 Tou msc ay a2 a3 by in In 0 10 1 3 G2} =) an a a3 by [i In AB ol “ FB 432 O33 | On multiplication, we have ty ln te In tts Ine ay a ab Ty ly Math by tis the tos dy rth @ Fs Gx 33 a by breath bitte wth ict ath | La a a bs Scanned with CamScanner Numerical Techniques 997 fin = au, tr = dab = an Atay = dim hits, = din Ter = bt or m= e or ty = 72 or rs aay, Ist t Ig = 3, or 43 hth, OT 2 = G32 aut dats + baattas = 23, auc + bnaez = ba or U3 = (@3—btsbr OF ey = (b2- hrcillns Byatt + Iyattas + l53 = 33, Isic + taxa + aes = bss or thy = @33—Tgitty3—Inptin, or €3 = (b3— bs1¢1 — Ia2e2Vils3, ‘Thus values of u’s and c’s are known. On substitution in (2) we get the values of x, y, z. A table is prepared. The upper half of tke table contains the coefficients of the original equations. The lower half of the table contains the element of J. and U. An additional column in the table is for check sums. After the upper half is completed, the entries in the lower half are made in the flollowing order : (1) First column (2) First row (3) Second column (4) Second row and so on. General formulae for calculating /’s, u's and ¢’s are st dis = rs J) Intts (42 5)y rt Ua = lod bt (r 40 _417 3 33 Y= "5 ~20~ 10 ~ 21 _3.17,7_68 == 2716" 20 ~ Again putting these values on RS. of (1) we get next approximations. 1 33_ 189 _ 1030 _ = 4 80 320 ~ 320 ~ 325 14976 863 Y= "5 200-400 ~ 400 = 216 _3. 97, 33176 _ ==> 760" 160 ~ 160 ~ | Substituting, again, the values of x, y, z on HLS. of (1) we get 17216 _ 3.0 xo 22 = 2.885 1.93 0.96 Repeating the process for x = 2.885, y = 1.93, z = 0.96 we have 493.3 0,96 = 4.25- 0.48072 = 3.05 2385 06 _ 28 -0.577-0.192 = 2.03 2885 183 - 1 5—o721+0.241 = 1.02 3 4 5 6 (1039 099 3.25 | 2aas | 305 863 _ Bo 216 | 193 | 208 176 _ thou 096 | 1.02 Scanned with CamScanner 1002 Numerical Techniques Afler 6th iteration x= 3.05, y = 2.03, z= 1.02 ‘The actual values are xe yz 15.10 GAUSS-SEIDEL METHOD Gauss-Seidel method is a modification of Jacobi’s mettod. In place of substituting the same set of value in all the three equations (2) of Article 15.9, we use in each step the value obtained in the earlier step. Ans. Step 1. First we put y in first of the equation (2) of Anticle 15.9 and x = cy. Then in second equation we put this value of x ie., cy and z = O and obtain y. In the third equation we use the values of x and y obtained earlier get z. Step 2. We repeat the above procedure. In the first equation we put the values of y and z obtained in step 1 and redetermine x. By using the new value of x and value of z obiained in step 1 we redetermine y and so on. In other words, the latest values of the unknowns are used in each step. Example 25. Solve by Gauss-Seidel method 6x+y 05 4xt8yt3z2 = 155 Sxt4y—0z = 65. Solution. ‘The numbers 6, 8, ~ 10 in the leading diagonal are the largest, so we can apply Gauss-Seidel method to solve the given equations. The above equations can be written as A) 2) 3) Putting y Putting x = 25 and z = 0 in equation (2), we have 2 _ 155 35 9 _ 85 rr) 8 Substituting x = 32, y = 8 in equation (3), we obtain 13,3517 _ 13 sata tT on tan . 3 _ 13 Again starting from equation (1) and putting y = $3.2 = 3, we get 35_85_ 13 _ 703 x= 3-37 = ag = 464 Scanned with CamScanner Numerical Techniques 1003 Similarly the process is carried on and the roots so oblained are given in the following table : erations 1 2 3 4 x Bes 1464 15.12 14.98 S106 9.62 10.06 9.98 =-B 242, a z=-Bededy P= 65 467 5.084 498 At the end of fourth iteration the roots are x = 14.98, y = 9.98, z = 4.98 But the actual roots are x = 15, y= 10, 2=5 Ans. Example 26. With the following system of equations Bxt2y = 4, 2x+3y-2=5 ~y+2z=-05, set up the Gauss-Seidel iteration scheme for solution. lerate two times, using the initial approximation as xo = 0.4, yo = 1.6, z = 04. Solution. The given equations can be written as r= 15—3y (1) =5 2,42 yozgat ts 2=-25+05y " < Xo Putting y = 1.6 in (1) we get_x Pulling x = 0.433 and z = 0.4 in (2), we have y = LSI Putting y = 1.511 in (3), we get z= 0.506 Again starting from equation (1) and putting y = 1.511 in (1), we get x = 0.493 Similarly the process is carried on and the roots so obtained are given in the following table : Herations 1 2 3 4 0.433 0.493 0.495 0.497 1511 1.507 1.505 1.504 z= -025+05y 0.506 0.504 0.503 0.502 At the end of fourth iteration the roots are x = 0.497, y = 1.503, z = 0.502 But the actual roots are x= 05, y= 15, 2=05 Ans. Scanned with CamScanner 1004 Numerical Techniques Example 27. The following system of equation is given: 2x; 42x = 3 xy 43x 43x; = —1 xyt2x45xy = 1 Iterate two times using the Gauss-Seidel method, starting with the initial approximations 41 = 03, x2 = —08 and x5 = 0.3. Solution, x, = 0.3, 4 = -08, 5 = 03 Qxy—mt2ay = 3 X43 432, =-1 xt2H45x5 = 1 The above equations can be written as ne ~() m= (2) ye @) Putting x2 = - 0.8 and x3 = 0.3 in eq, (1) we get x = 15-04-03 = 08 Putting xy = 0.8 and x3 = 0.3 in eq. (2) we get = 1-28 93 -_ = zg 03 = -0.9 Putting xy = .8 and x» = -0.9 in eq. (3) we get x3 = 0.2 04 Again starting from eq (1) and putting x» = ~0.9,x3 = 0.4 Similarly the process is carried on and the roots so obtained are given in the following table : erations 1 2 3 4 5 6 a8 0.65 0575 0.586 0518 0.509 -09 -095 | -0975 | -.988 | -0994 | -0997 os 0.45: 0.475 0.488 0.494 0.497 ‘Ans. Exact roots are x, = 0.5,2) = — 1,.%3 = 0.5 Example 28. Apply Gauss-Seidal method to solve Sxt2yte= 12 Scanned with CamScanner Numerical Techniques 1005 xt4y422= 15 x+2y452= 20 correct upto decimal places, taking Xo = Yo= m=O Solution. The given equations can be written as (1) (2) -B) 3.15 Putting x = 2.4,y = 3.15 in eq. (3), we have _ 4g 24 2x3.15 _ eo 4 SSS = 226 Again starting from eq. (1) and putting y = 3.15,z = 2.26, we get 2 2.26 KPO EXBIS— ATS = 0.688 Similarly the process is carried on and the roots so obiained are given in the following table: Iterations L 2 3 4 Ss 24 0.688 0.84416 0.962612 099426864 3.15 2.448 2.09736 2.013237 200034144 2.26 2.8832, 2.99222 3.0021828 3.001009696 Ans. Exact roots x= 1,y = 2,2=3 EXERCISE 155 1. Solve by Gauss elimination method 6x-y-z= 19 Bxtdytz= 26 xt2y+62= 2 Ans.x 2 4.y = 3,252 2. Use Gauss-Seidel method ta salve the system of equations. 3xtytz=1 x43y-2= 1 x-2ytdy = 21 3. Solve by Crout's method [: 22-2) Scanned with CamScanner 1006 Numerical Techniques 4, Use Crout’s method to solve 2xe3y-4z+2w = x42 y432-4w Ax-y+22-2w 3xtSy-zctOw 5 5. Ams xeLye dca 2wed 5. Use Jacobi's method to solve 1x-2y-32 = 205 2x- Wy +22 = - 154 2xty—10z = - 120 upto the end of sixth iteration. Ans, x 5 32,y = 26,2 5 21 6. Use Jacobi's method to solve Sxt2ytz = 12 xt4y 4226 15 xH2y+52 = 20 upto the end of eighth iteration. Ams. x = 1.08, y = 1.95,2 = 3.16 7 Solve Question (6) by Gauss-Seidel method upto fifth iteration. Ans. x = 8 Solve by Gauss-Seidel method (A) Bxt5y-324+w = 18 (B) Gr+y+z=6 Qxti2ytz-dw = 13 x4 8y+ 3x-4y4 102+ = 29 3x4 2y + 102: Qxty-3249w = 31 Initial values. x=0.8, y= 0.4, 2=-0.45, ‘Ans, Exact roots x = 1.y = 2,2 3,w = 4. (AMLE.LE, Winter 1996) 1 2 Ans. x51, =f. Determine how many iterations of Gauss-Seidel method are needed in order ta find solution of the system of equations 994-15. +26x, = 0 0.4.x, 413.6%,- 4.22 = 82 07 440444714 = -13 with an accuracy of 1074 15.11 SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS ‘A number of differential equations cannot be solved by analytical methods. It is, therefore, imperative to solve them by numerical methods. We will discuss the following methods : (1) Taylor's series method (2) Picard’s method (3) Runge-Kutta meshod. 15.12 TAYLOR’S SERIES METHOD Let us consider the first order differential equation 2 =flny) Al) under the condition y = 0 for x = x9. Scanned with CamScanner Numerical Techniques 1007 Method. On differentiating (1) again and again, we get dy dy a ay de’ de? dt ~~ On putting x = xy and y = 0 in the above equations we get the values of dy d?y d?y dx? de substituting the values of y’, y”, y”", ¥""... in Taylor's series : yor (a0) BY a1 + FS™ fy” gd += oy (ol + ‘Thus we can obtain a power series for y (x) in powers of an ‘The method is illustrated by the example. Example 29, Using Taylor's series method, obtain the solution of ® OD = 3xty? and = 1, when x = 0. Find the value of y for x = 0.1, correct to four places of decimals. Solution. 4 = 3xty A) yQ=1 -Q) Differentiating (1) wart ‘x’, we get 2) wl) 3) and so on. From (1) a. o+ayr=1 From (3) sero From (4) a = 2(1)(53)+2(1P From (5) = 2May2H +4 = 54 ‘We know by Taylor's series expansion eta? 5 Y= wt 29 Oe FH 79g EAH yg BE ngs. 06) On substituting the value of v0 ¥O.¥" o. y* (0) ete. in (6) we get 2 xt F712) + F764) +... xe ya Lert (8+ Scanned with CamScanner 1008 Numerical Techniques = 3 2 s. or YQ) = Lest FP e28 agate... Ans. y@d) = 140.1 + 3 (0.01) +2 0.001) + $(0.0001) +... = 140.1 + 0.025 + 0.002 + 0.000225 = 1.127225 Ans. Example 30. Use Taylor's series method to solve the equation dy ae Solution. y (1) ¥) = 0. Differentiating (1) repeatedly, we find y=nxy¥-y, YO = y=-ay_ay, ¥"(Q) =0 y’-3y", (0) =3 =-a-4y", (0) = 0 ae’ ae N= 3B dy _,d*y ay _ = 3r “a 3x33 = 99 d¥y _,dty aby dy dy = 3x99 = a 3 a a 3x99 = 207 and so on. We know by Taylor’s series expansion aay & (tte? ( (t= ( d3y y= yore oF), “Or [ae |, 3! la |, Scanned with CamScanner Numerical Techniques 1009 eto" (dy (toy) ( dy a (ae |.. 3! (a | UF 338 gor 2078 ya lea SPs Oe aT = Hoy Bons ys 4 297 @ 15 ye 1430+ 1 on?+ Bo. +2 (0.8 +759 @.D' yl) = 1436 yet Lae 4 Fors Bent Bois (1) = 14.3 + 0,055 + 0.0055 + 0.0004125 + 0.00002475 y (1) = 136093725 Example 32. Find the solutions u (0.1) and u (0.2), of the initial value problem w= x(1-212); u() = 1 using the first three non zero terms of the Taylor Series method and h = du Ans. i = x20) Solution. oe = x(1-218) au du zt riots ) Bu du du, du)? au oe hu du (2) 4] du du)? du ein -4( 2) 40 dtu of du du du)? , du ae *(@) ug -4( 3] 40] Putting x = Ou = 1 in St, 3, Ty, Te we get du @ yaaa fe Ga = 20140 = 0+0+5 By Taylor's series ua) = ur) + £ 4 (0.1) = 4 (0) +(0.1-O) uw’ Oto, uw’ (0) 0.01 = 1404 (- 1) +0+ ome 1 (12) = 10.005 + 0.00005 = 0.99505 Scanned with CamScanner 1010 Numerical Techniques foe =: Lani n = on tt ang 429 Putting x = 0.1 and u = 0.99505 in { and “= we get at ey aw Geax (l= 22) oA = 0.1[1~2(0.99505)%] = 0.1 (-.0.98025) = — 0.098025 eu _ au) ae 2) -1(-40f) Spa = [1 ~2(0.99505)"1 + 0.1 (— 4 x 0.99505 x— 0.098024) — 0.98025 + 0.03902 = — 0.94123 0.2, x9 = 0.1, w’ (0.1) and uv” (0.1) in Taylor series (1), we get 4 (0.2) = u(0.1)+02-0.) 7 (0.1) 02-0 wos i = 0.99505 +-0.1 (— 0.098025) + sone — 0.94123) 0.99505— 0.0098025— 0.005 x 0.94123 = 0.98054135 Ans. EXERCISE 15.6 Using Taylor's method, solve the following differential equations : 1x4, 1x4x7 5 AXA oy LESXT oy, } 3 op _ Fe = FyM given y(0) = 1, and find y (0.03). 44-5 = 0,fory (0) = 0, find y when x = 02. 0.020016 15.13 PICARD’S METHOD OF SUCCESSIVE APPROXIMATIONS Let us consider the first order differential equation a SY) (1) and y=yo for =a. Method. Integrating (1) between the limits x9 and x, we get 5 é : P a= senyae or yy =f senyar Wa " or y=y+t] Seyde (2) Equation (2) is the solution of (1). But (2) contains the unknown y under the integral sign on right hand side. On putting yp for y on R.H.S. of (2), we get a first approximation y,. Scanned with CamScanner Numerical Techniques 1011 nent foomar 0) From (3) we get the value of yy and we put yy for y on R.H.S. of (2) to get second approximation y>. ‘Thus newt F fayddr Similarly third approximation is y, = yo+ J f(x y:) de and so on In this way we get a better approximation each time than the preceding one. Note, This method is used to solve the differential equation if the succession integration can be performed easily. ‘The method is now illustrated by an example. Example 33. Using Picard’s method, find a solution of $= 1 xy upto the third ap- proximation, when xo = 0, yo = 0. i x. Solution. Bo tty ) Integrating (1) wart. “x° between the limits 0 and x, we get Jo a=f asad or y=J Gta 22) 0 a 0 On putting y (0) = 0 for y on RS. of (2) we have n= f U+0d ot =x . On substituting y, = x for y on RHLS. of (2), we obtain nef dedaesrd =f Byla = fi x y= I [t4x[x4 5 Jere [rere : « ears i Example 34. Given the differential equation ye a Ts with the initial condition y = 0 when x = 0, use Picard’s method to obtain y for x = 0.25, 0.5 and 1.0 correct to three places of decimals. dy 8 a T+ 2 . vt) = 0+ J eae = 0 [ Bade= Now using this value of y, we have Solution. z 3 Scanned with CamScanner 1012 Numerical Techniques yeorf If x= 0.25, then y = tan 0357 = tan 2015625 — tan 10,005208 = 1.0052 1 (0:5)? _ 1 0.125 _ tan SP = tan 3 = If x= 1.0 then y = tan“! ; = tan~! 0.3333 = 0.3218 Ans. Example 35. Perform two iterations of Picard’s method to find an approximate solution of the initial value problem If x= 0.5, then tan”! 0.042 = 0.0420 Solution, AD), y@=1 Integratintg (1) wrt. ‘x” between and x, we get fi ay= J rar y= yor i (ety) de 2) On putting y (0) = 1 for y on R.K.S. of (2), we have * 2 yy edt J, Dar = 14 Sex On substituting the value of y; for y ox R.HLS. of (2), we get ysl Qf (vs) nate] [steepezeere * xt ye uf 143rt22e eee s ye bee 2888 Example 36. Using three successive approximations of Picard’s method, obtain approxi- mate solution of the differential equation y’ = x2 +y* satisfying the initial condition (0) = a. Ans. Solution. 2 =xt+y (1), yQ=0 Integrating (1) wa , ‘x’ between the limit 0 and x, we get Jae fl rae ~Q) On putting y (0) = 0 for y on R.HLS. of (2) we have Scanned with CamScanner Numerical Techniques 1013, nef @+oar-F 3 3 for y on RLS. of (2), we obtain a) Bt I (e+ a -545 eh fe)? (5 ge Dy! lt nel, [e(3 3) |« J, (#54 ai) Box 2x On puting HS Ans. 7 card’ ay - ixample 37. Use Picard’s method to solve 5 = Solution. y@) = y0- Jayde 0 =1-f x(yar Jem Now using this value of y, we have Repeating once again we shall obtain a1 oa Ans. VOT ag ag! 384 * Example 38. Use Picard’s method to solve the equations dx dt * given that x = 1, y= Owhen t = 0. Solution. ly 4 We (2) Integrating (1) w.rt., ‘t’ from f = 0 to f we get to yar 1=-f ya bi =— Jide or x Jy =1- ydt h3) x J, y 3) Integrating (2), wart., ‘t' from f = 0 to 1, we get [yale or y-0 fi xae Scanned with CamScanner 1014 Numerical Techniques y=] xat AA) 0 Replacing y by 0 in (3) and x by 1 in (4), we have 1- Odt=1 id {i an and so on Exercise 15.7 Using Picard’s method, solve the following WY _ vay ’ : uM 1, & = x+y giveny(0) = 0, upto third approximation, Am. y= FP tata t gis 2. Apply Picard’s iteration method to find approximate solutions to the initial value atien y=14y y(O=0 (AMLETE, Winter 1996) 3. © = x-y, giveny (0) = 1 and find y (0.2) to five places of decimals. ss ® Ams. y = Lax4— = +E E42 ogszas 12” 60° 720" =o sven y(Q) = : - eae 4, & = y+x,giveny (0) = 1, find y (1), Ans. y = Lexexta basa do by 3434 8 Ba ees for y(0) = 0,findy (04), Ans, 00214. y dz Be ryee Sex Y+2z giveny(0) = 0, 2(0) = 1 Ans. yertave Bede ,2= reaxtdeadoatte 15.14 EULER'S METHOD This is purely numerical method for solving the first order differential equations. This is an elementary method and which will demonstrate the procedure underlying these methods. This method should not be used for practical solution. Consider tre differential equation =f&y) <1) Let y = (x) be the solution of (1). 2) Let (Xo Yo)s (1s Ys «++ War In)s @n+1-Ine1) be the points on the curve of (2). XoyXwekn Ny teos AFC equispaced at equal interval h. Jnr = O40) [041+ Jn+1) lies on (2).] = 0-41) (nv = apt) Scanned with CamScanner Numerical Techniques 1015 = $C) +h Go) +417 6") + 3) = $65) +h 9G) (his very sma) = (4) +f Om Yn) {since 2 = Sls, ») Inet = Yn TUF Cnn Yn) [since y, = $(x,) from(2)]_ (4) This formula (4) can be used to find y,.,, where y, is 4¥ known. Q%o445 Yoo) On substituting the value of yo, (n = 0) in (4) we get y4, Similarly putting the value of y,, (n = 1) in (4), we obtain ya and so on. Note. Since we have neglected 1 h? $” (x,) and higher powers of ft from formula (4) there will be a larger error in Yo Therefore it is not used in practical problems. Geometrically Let y = (x) be a solution curve PQ. The ordinate of P i.e. y, is known. Now we have to find the ordinate y,,.1 of any point Q. net = MQ = MR+RQ = PL4+RT+TO (TQ = Error) = yythtan = won +16 G9) Example 39. Using Euler's method, find an approximate value of y corresponding 10 =1. x+2y andy = I when iv dy 2, given that & Solution, (Gy) = x4 2y Ine = Mn+ MF Cnr In) = Yat OL (+29) Method: In column 3 we record the value of x+2y and in column 4 we enter the sum of the value of y and the product of 0.1 with the value of x-+2y. This value entered in 4th column is transfered to second column for the next calculation. . } waye# | aiysoi() «mes 10 1.00 3.00 1.0+0.1 (3) = 130 Lt 13 3.70 1340.1 (3.7) = 1.67 12 1.67 4.54 1.67 + 0.1 (4.54) = 212 13 2.12 5.54 2.12 + 0.1 (5.54) = 2.67 14 2.67 674 2.67 + 0.1 (6.74) = 3.34 1s 3.34 8.18 3.34 + 0.1 (8.18) = 4.16 16 4.16 9.92 4.16 +0.1 (9.92) = 5.15 17 5.15 12.00 5.15 + 0.1 (12.0) = 6.35 18 6.35 14.50 6.35 + 0.1 (14.50) = 7.80 3 70 1730 a0 011750) = 958 2.0 9.55 Scanned with CamScanner 1016 Numerical Techniques ‘Thus the required approximate value of y = 9.55 Ans. Exercise 15.8 4. Using Euler's method, find an approximate value of y corresponding to x = 1, given that +yand y = Lwhenx = 0. Ans. 3.18 2. Using Euler's method, find an approximate value of y corresponding to x= 1.4, given Ams. 1.498577. xy? and when x 3. Using Euler's method, find an approximate value of y corresponding to x= 1.6, given y= Lwhenx = Ams. 1.1351 15.15 EULER’S MODIFIED FORMULA In equation (3) of Art 15.14 the expansion of 41 is Yar = Int H/C) +51" Gin Jn) +P IP 8 dH) +o ~) In Euler's formula we omit £4” (x,y) and higher powers of fh. The error due to this omission is called Truncation error. Now a formula is derived with small error. Differentiating (1) wat. x we get (Z)... = (+0 (25,99) + £4? § (3) te Fen Yue) = Fn IHF Cn Ja) #5 IEG Ya) + +0) = Flin IDNA Z IPG" Cn Ja) ‘Multiplying (2) by a and subtracting from (1) we get 1 h w Yar TAL Cav wae) = Jat ZL mI) — Fy 0” Bm I) Neglecting terms containing h? and higher powers, we obtain yh [f= Yn) 2st le » 3) Ine = Equation (3) is the Euler’s modified formula. But f (tq. 1, Yn1) Which occurs on the right hand side of equation (3), cannot be calculated since y,,1 is unknown. So first we calculate y,,1 from Euler’s first formula, Ine = nt Wf ie Yn) ‘Thus for each stage we use the following two formulae. +1 = Int HEC Yn) h Jae = Int ZF Cin Yn) +L Gin tJ 7) Example 40. Apply Euler's modified method to solve Box 4+ 3y subject to y(0)=1 and hence find an approximate value of y when x = 1. Scanned with CamScanner Numerical Techniques 1017 Solution. Sy) = x43y n=l Yas = Intl in Yn) Ines = oF FV Cn Ind +P Gos eo] This gives Yoo = Int OL yt 395) ner = Yn 0.05 [in +3 Yn) + (ng + 3 Yn) ‘The following table shows the computation work. ” in Ya Ant 39m Bulers formula] xy+1 Bint Eulers Jar Byne1 | modified yn 0 00 1 3 13 on 4 135 1 on 135 415 1.765 02 5.495 1.832 2 02 1.832 5.695 2.402 03 7.506 2.492 3 03 2.492 1.116 3.270 04 10.21 3.391 4 o4 3391 10.573 4.448 os 13.844 4612 5 05 4612 14.336 6.046 06 18.738 6.266 6 06 6.266 19.398 8.206 07 25.318 8.502 7 07 8.502 26.206 11.123 08 34.169 11.921 8 08 11.521 35.363 15.057 09 46.071 15.593 9 09 15,593 | 47.679 20.361 10 62.083 21.081 10 | 10 21.081 Hence the required value of y at x = 1 is 21.081. ‘The exact solution gives y = 21.873 forx = 1. The error is 0.792 i.e., 3.6%. Ans. Procedure. We calculated y,, by Euler's formula i.¢., ys1 = YO. 1 (t,-+3yq) and entered in 5th column. In 7th column we record the sum ie. x4) +3 Yy+1- Then we computed the value of y,,, by Euler’s modified formula i.e., Yaar = yt [Gn +3 yn) + Gtn+ 1+ 3 Yn 1)] and entered in 8th column. EXERCISE 15.9 -L. Using Euler's modified formula, find an approximate value of y when x=0.3, given that = x+ yand y= Iwhenx = 0. 1.3997 2. Using Euler’s modified formula find an approximate value of y when x = Pay and y (0) = 1, taking the interval 0.02. ‘Ans. 1.0619 3. Using Euler's nmodified formula, soive 2axygiven y = Oatx = 0 from = 0100.6 taking the interval h = 02. Ans. 0.4748 15.16 RUNGE’S FORMULA Euler’s modified formula is yn41 = mt Am IWF Ans Ine] or Yuet = Int EC In) 4S Gin Be Ya FL] ) Scanned with CamScanner 1018 Numerical Techniques Let ky = Mf nm Yn) and Ky = ME nt My Yo ME Cm Yo] OF ke = Min +I Yn t ka) Putting the values of k, and k, in (1) we get Jae = nt 5 (kita) (2) This is known as Runge’s formula of order 2. Example 41. Apply Runge’s formula of order 2 approximate value of y when x = 1.1, sive Solution. Here we have x9 = 1, yp = 1.2, h = 0.1 f(xy) = 3x+9?, fo, yo) = 3(1) + (1.2)? = 4.44 ky = if (x.y) = 0.1X4.44 = 0.444 ky = hf (Goth, Yothy) = O.Lf(LA1, 1.240.444) = 0.1 f (1.1, 1.644) 0.1 [3 x 1.14 (1.6447] = 0.600 dat pth 3xty? and y = 1.2 when x = 1. 0 0 Jae y= 12 + (0.444 + 0.600) = 1.722 Ans. EXERCISE 15.10 1. Apply Runge’s formula of second order to find approximate value of y when x = 1.1, given that @ = x-yandy = Lwhenx = 1. ‘Ans. 1,005 2. Apply Runge’s formula of second order to find approximate value of y when x= 0.02, given that a _ dey and yi) = a8 tY and y(0) = 1. Ans, 1.0202. 15.17 RUNGE’S FORMULA (THIRD ORDER) D1 = Yor g (hit 4 ke ths) where ky = WfGso.y0. be = watt wed) by = Wf Gap+ yp + 2k hy) never hh +4iet ky ‘This is the Runge’s Formula (third order) with an error of the order I, Example 42. Using Runge’s Formula (third order), solve the differential equation SS = x-y subject to y = 1 when x = 1. Solution. f(x,y) = x—y Here h = 0.1, = 1,yo = 1 Ay = If (Xo, Yo) = O.1(x—y) = 0.1 (1-1) = fy = I 0+ dao +] = 0.1/(1.05, 1 +0) = 0.1(1.05~1) = 0.005 ky = hf (oh, Yo+2ky—Ky) = O.1f(1.1, 1.01) = 0.1 (1.1-1.01) = 0.009 Scanned with CamScanner Numerical Techniques 1019 1 Ms YG rt Ake hs) y (Ql) = 1+2(0+0.02+ 0.009) = 1+ 0.004833 = 1.004833, Ans. 15.18 RUNGE-KUTTA FORMULA (FOURTH ORDER) A foxrth order Runge’s-Kutta Formula for solving the differential equation is y= yt] g(h+2h tah +h) where ky = Wf ayo ke = wf 8 +4] k= rrr), ke = hfe t hyo +B) Y= Jot Eh + ky + hy +l This is known as Runge-Kutta Formula, The error in this formula is of the order h. This method have greater accuracy. No deviatives are required to be tabulated. i requires only functional values at some selected points on the sub interval. Example 43. Apply Runge-Kutta method to find an approximate value of y when x = 0.2, given that Boxy, y=lwhenx=0 Solution. Let h = 0.1 Here 39 = 0 9 = L flay) =a ty Now ky= flap, yo) = 0.1041) = 01 k= Wah, yortt = 0.1f(0+ 005, 1 4 0.05) = 0.1 [0.05+ 1.05]= 0.11 0.1,f(0+0.05, 1+ 0.055) = 0.1 (0.05 + 1.055) = 0.1105 ky = hf eo th, yot ks) = O.1f(0+0.1, 140.1105) = O.1/(O.1, 1.1105) = 0.1 (0.1 + 1.1105) = 0.12105 According to Runge-Kutta (Fourth order) formula y= yor Rh + ka 4 2h +a] Yor = 145 0.1+0.224-0.221 +0.12105) 7 1 +5 (0.66205) = 1.11034 For the second step 4g = 0.1, y9 = 1.11034, h = 0.1 k= Go) = 0.1 (0.1 + 1.11034 = 0.121034 at 2) = 0.1 (0.1 +0.05, 1.11034+ 0.060517) koh ott, x = 0.1(0.15 + 1.170857) = 0.1320857 Scanned with CamScanner 1020 Numerical Techniques Not & Yo 3) = 0.1 (0.1 + 0.05, 1.11034 + 0.0660428) 0.1 (0.15 + 1.1763828) = 0.13263828 Af (Xo + hh Yo+ ks) = 0.1 (0.1 + 0.1, 1.11034 + 0.13263828) 0.1 (0.2 + 1.24297828) = 0.144297828 ky Ye oS Mt 2a tks ta) 1.11034 + to. 121034 +2 x 0.1320857 + 2 x 0.13263828 + 0.144297828] 1.11034 + t [0.121034 + 0.26417 14 + 0.26527656 + 0.144297828] 1.11034 + dx 0.794779788 = 1.11034+ 0.132463298 1,242803298 Ans, Example 44. Apply Runge-Kutta method (fourth order), to find an approximate value 0 of'y when x = 0.2, given that 2. = x+y andy = I when x = 0. dx Solution. Let h = 0.1, Here X= 0, yo = 1, fy) = x+y? Now ky = If Ganyo) = 0.1(0+ 1) = 0.1 a = Wy{ 20+, 90+ | = 041f(0+ 0.05, 1 +005) = 0.1 (0.05+ (1.057 = 0.11525 k= Wy sot tino = 0.1f (0 + 0.05, 1 +0.057625) = 0.1 [0.05 + (1.057625)7] = 0.11685 ke = Iif tat hh Yo ks) = O.1f (0+ 0.1, 1 + 0.11685) = 0.1 [0.1 + (1.11685) = 0.13474 According to Runge-Kutta (fourth order) formula Dia WEE +2 +2 kth) 14 E [0.1 + 2.611525) +2 (0.11685) + 0.13474] 140.1165 = 1.1165 O.1, yo = 1.1165 11 (01+ 1.2466) = 0.1347 0.1 (0.15 + 1.4014) = 0.1551 0.1 (0.15 + 1.4259) = 0.1576 ky = 0.1 (0.2+ 1.6233) = 0.1823 Jou = i For the second step 1 Yor = Yor § (hy +2 ky + 2k ty) = 1.1165 + 2 (0.1347 +2 0.1551 +2 (0.1576) + 0.1823] Scanned with CamScanner Numerical Techniques 1021 = 1.1165 +0.1571 = 1.2736 Ans. Example 45. Use the fourth order Runge-Kutta method to find u (0, 2), of the initial value problem u’ = —2 tw, u(Q) = 1, using h = 0.2. (AMLE.LE, Summer 1995) Solution. i = 0.2 Here = 0, w= 1, f(t,u) = 202 Ay = hf (to, uo) = 0.2 (2 w) = 0.2(0) = 0 ky = I tort igre = 0.2/(0.1, 1+0) =0.2f(0.1, 1) = 0.2 (-2x.1x 1) = -0.04 k= tor dae }- 0.2F(0+0.1, 10.02) = 0.2/(0.1, 0.98) = 0.2 [-2x 0.1 x (0.98))] = -0.2 [0.2 x 0.9604] = - 0.038416 = Hf (tg + hy ug + ky) = 0.2 (0.2, 1 0.038416) = 0.2 — 2) x (0.2) x (0.961584)? = - 0.08 0.924644 = - 0.073972 ua tot Pk # 2k +2 ks +a) = 1421042 (0.08 +2 (0.038416 + (0.073972) =1- i [0.08 + 0.076832+ 0.073972] = £0 230804) = 1— 0.038467 = 0.961533 Ans. Hence w at ¢ = 0.2 is 0.961533 Ans, Example 46. Find the solution y (0.1) of the initial value problem y’=— 21°, y 0)=1, with h = 0.1, using (® Taylor series method of order four, and Gi) Runge-Kutta method of order four. (AMLETE, Sunmer 1995) Solution, 4 2, yO =1, h=O1, Hrs 0 then & -2() (IF = 0 ay dP 2-4, Ift = 0, e -20P-0= 2 (4) ay td or = suf ay Le at a r=, £2 = 80) O)-4OF-4(N(-9 = 0 dy __ (a) _. dy 4 (dy) dy yay gad 4. dy ae --*(@ 8 ee -(3) (a) ve a ae Oe Ifr= 2 = 8.07 -8(y(-2)-4 07-400) —4 (1) (~2)—4 (0) (0) (—2) - 4) (1) (0) = 24 (i) By Taylor series method Scanned with CamScanner 1022 Numerical Techniques y= yor foe, nd oo @y Go dty 1 dt 3 dP 14 de -Pee _ e Pot y = 14+1(0)+ Zl“ D+ EO +5724) y(.1) = 1-(0.1)? +(0.1)* = 1—0.01+0.0001 = 0.9901 ‘Ans. (if) By Runge-Kutta method of order four Y= Wt E+ r2kyrky where ky = Hf (aso) = (2%) = O.1[-2x0x(1 = 0 hi ky 0 ky = hf tot 5s Wort = 0.14] 040.05, 1+ = 0.17(.05, 1) = 0.1 (2605) (1)"] = —0.01 k=l orf) o.as{ 00.05, 14202 2 = 0.1°F(0.05, 0.995) {—2 (0.05) (0.995)"] = - 0.00990025 ky = If (ta + hh yo-+ ks) = 0.1,f(0+ 0.1, 1 — 0.00990025) = 0.1,f(0.1, 0.99009975) = 0.1 [-2 (0.1) (0.99009975}*| = 0.01960595 ye Yor Flr +2 2hs+hy) 1 +4 [0+ 2 (— 0.01) +2 (-0.00990025) — 0.01960595] 1+ t [- 0.02—0.01980050— 0.01960595] =1 +4 {-0.05940645] = .009901075 = 0.99009892 Ans. Example 47. Use the Runge-Kutta fourth order method to find y(0.2) with h = 0.1 for the initial value problem. dy/dx = Very, yO) = 1. Solution. h = 0.1, x = 0, yo= 1, funy) = ety Now ky = Af Coo) = 0AVOFT = 0.1 = infer 3-ror 9) = 0.1/(0-+ 0.05, 1 + 0.05) = 0.1,/(0.05, 1.05) 0.1054 1.05 = 0.1 VI.T = 0.10488 0.1f(0+ 0.05, 1 + 0.05244) “£(0.05, 1.05244) = 0.1 VO.05+ 1.05244 = 0.1 VI.10244 = 0.104997 ky = Ifa h yo+ ks) = O.1f(0-+ 0.1, 1 + 0.104997) = 0.1 F(0.1, 1.104997) = 0.1 V0.1 + 1.104997 = 0.1 ¥1.204997 = 0.10977 According to Runge-Kutta (fourth order) formula Scanned with CamScanner Numerical Techniques 1023 1 Ya = Yor g + ka + hy + hy) Yor= 1+ zt (0.1 + 0.20976 + 0.209994 + 0.10977) = 142 0.629524 = 140.10492 = 1.10492 For the second step xq hf (%o» Yo) = 0.1 YO.T+ L-10492 = 0.1 VI-20492 = 0.109769 O.1, yo = 1.10492, = 0.1 pfs, mkt = 0.1,f(0.1 + 0.05, 1.10492 + 0.0548845) 1V-3098045 = 0.114447 ks = Mil soe, vor = 0.1/(0.1+ 0.05, 1.10492 + 0.057235) = 0.1 (0.15, 1.1621435) = 0.1 VO1S+ 11621435 = 0.1 YTST2TA3S = 0.145488 ky = faa hy yo+ hs) = 0.1 (0.14 0.1, 1.10492 + 0.1145488) = 0.1 (0.2, 1.2194688) = 0.1 VO.2-+ 1.2194688 = 0.1 VT4T94688 = 0.191415 Jor = Yor 2 (hi + 2k +2hs + ky) 0.1f (0.15, 1.1598045) = 0.1 YO.15 + 11598045 = = 1.104924 4 (0.109769 + 0.228894 + 0.2290976+0.1191415) = 1.104924 dx 0.6869021 = 1.10492 + 0.1144837 = 1.2194037 Ans. EXERCISE 15.11 J. “The initial value problem y’=x (+3) -2,y (I) =2 is given, Find the value of y(1.2) with h=0.2 using the Runge-Kutta method of fourth order. ‘Ams. y (1.2)=2.3 138 2. Use the Runge-Kutta method of fourth order to find y (0. 8) with h = 0.2 for the initial value problem. AW, yO4 = 041 Ams, 0.8489912 3. Find y (0.2) for the equation =x, y(0) = 1, using Runge-Kutta method. de 4. Apply the Runge-Kutta method to obtain y (1.1) from the differential equation ez YC) = 1 taking = 0.1. 5. Apply Runge-Kutta (fourth order) formula to find an approximate value of y when x = 1.1, given that we Bex-y and Tat x=1, Ans. 1.004837 15.19 HIGHER ORDER DIFFERENTIAL EQUATIONS wet B= puyd, £= g0¥.2.r00) = ya.200) = 2 Scanned with CamScanner 1024 Numerical Techniques Formulae for the application of Runge-Kutta method are as follows : Ky = If Xue Yne Zady M, = NG (Xe Yur Zn) =frs4, yo, om alae dome of my = ne(ooed ntt a] _ ho. bm ba tfurha wr B ar 7 Hye, a4) tals. Int ys tat 2) Ky = Wf yt My Yat hay 24m) = Ag (ty thy Yq thy Zn Ms) Bn = ath Ju = Yat (br + ka + 2k + hy) fait = Zn +h (1m, + 2g + 2s + mg) Higher order differential equations are best treated by transforming the given equation into a system of first order simultaneous equations which can be solved by one of the aforesaid methods. Consider, for example the second order differential equation : A a = ox} I G0) =m 2), = yo" Substituting 2 = we get dz _ 7 HALEN Y Qo) = Yor 2X0) = yo" ‘These constitute the equivalent system of simultaneous equations. Example 48. Use Runge-Kutta method to find y (0.2) for the equation siven haty = 1, 2 = Ownenx = 0. Solution. Substituting 2 2 The given equation reduces to S¥ = xe-y = guy. ‘The initial conditions are given by x = 0, y = 1, z= 0. Also h=02 ky = W(y.9) = he = 0.2x0 = Scanned with CamScanner Numerical Techniques 1025 my = hg (x y.2) = h(xz—y) = 0.2(0x0-1) =~ hm) bes ") 3] |] = 82t- 0.01— 1) = —0.202 b= eet = is . 02 (0-22) = = - 0.0202 ing= agleed, ye en 3l- alle ae 3) 6 4] = oaf(a+SP\(0-25) (1-27) = 0.2[- 0.0101 — 0.99] = — 0.20002 ky = fat hy y+ kay 2+ ms) = h(e-+my) = 0.2 (0-0.20002) = — 0.040004 mg = hg (e+ 9-4 ks. 2-3) = Ni [e+ h) (e+ mg) - (9+ ka] = 0.2 [(0.2) (0.20002) (1 — 0.0202)] = 0.2 [- 0.040004 — 0.9798] = —0.2039608 This gives, at x= 0.2 (02) = y (0) +Z hy 2ka +2ks 4 kal= 14-5 10+ 2(— 0.02 )+2(— 0.0202) + ( 0.040004] = 144 (=0.04— 0.0404 - 0.040004) = 1+ (0.120404) = 0.97993266 2(0.2) = 2(0) dom + 2m + 2s + ms) = 0+21-0.2+2(- 0.202) +2 (- 0.20002 - 02039608) [-0.2— 0.404 — 0.40004 — 0.2039608] = ie 1.208008) = — 0.201333466 Ans, EXERCISE 15.12 A. Find y(0.4) for the equation © = 32+) (0) = 0 by Picard’s method. ‘Ans. 0.0214. 2 Use Picard's method to salve 2 = wee & = y+2z; given that y(0) = 0, (0) = 1. Ans, yaxt2eeBredee.. catered eetoe te a = 0 for x= 0, Ans. y (0.2) = 0.9801; »'(02) = -0.1970 3. Employ Runge-Kutta method to find y for x = 0.2 from ae given that y = 1,4 4, Describe Runge-Kutta method (4th order) for obtaining solution of initial value problem : Y= FOI ya) = yo, (Ke) = Yo? 5. State clearly the conditions under which the method is applicable. Scanned with CamScanner

You might also like