0% found this document useful (0 votes)
41 views8 pages

Jacobi and Gauss Seidal Iterative Method

Jacobi and Gauss Seidal Iterative Method

Uploaded by

Fahim Shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
41 views8 pages

Jacobi and Gauss Seidal Iterative Method

Jacobi and Gauss Seidal Iterative Method

Uploaded by

Fahim Shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 8
4 (ii) Solve the above system by chang by (22.1, 22.9, 32.9 and 31.1) (Ans: (i) 41.0, xg 1.0, xy l0, (ii) x= 6.0, xym 27.2, 29029, Xy-0.1) ing the right hand side x42 1.0 Indicators of ill-conditioned systems. suspected of being ill-condi- ations can be Se a e following indicators are tioned when one of more of th present. . . 1. Small changes in the co-efficient of the m: a large change in the solution. 2 The normalized determinant of A is small as compared to one, i.e, det (A) <<1.0. 3. The condition number. K= TA WATE is much less than one. atrix, results ZI om 3 In example 5, |] All ey Ti G45) G5) Recall the direct methods.which you have studied in the previous section, they usually. take: me arithmetic operations when the system is large i.e. m is large say n=1C000; the direct methods would take.years to solve such problems. evea on the fastest computer, therefore, in order to overcome. this’ difficulty, there is an alternative approach of using iterative methods to solve such problems when n is large and the matrix is sparse (most of ths entries are zero.) We shall discuss the following Iterative methods. (i) Jacobi iterative method. (ii) Gauss Seidel iterative method. Jacobi iterative method or method of simultaneous displacements Procedare ; Given a system of Linear equations ——S Azab Where the diagonal elements of A are non-zero. This system can be written in the iterative form as atte Brith 5 Where the elements of B are hyja =a inj bus0 Tnitial Guess is x9—(0,0,0,0,0,..)” continue the process of iteration for different values of kK, unless we get the required accuracy, \ : The following example will illustrate the Jacobi’s Proced: m xample 1.) Solve the following system of equations by Jocobi’s method, i Sx+y—z58 ) Qety+9z=12 I x—Ty+2z=—4 J Solution : xa (A) Step I. The given system can be written as ae Fy ta] y=12—2x—92 zal 4-x47)} Let the initial solution be x=0, y=0, z=0 putting values on the R. H. S. x=10 y=120 z=—2.0 - "If we proceed further the values will diverge because the diagonal elements “are not dominant and solution will not converge to the True solution. ; He x10 y=10 z=10 Step I. Re-writing the system (A) in the diagonally dominant form, by inter-charging second and third eqnations, xe 4 8-y+ 2 | yah bet24] pk alba @) | 1 z= p[l2-2x-y] J . ie Ee a Suppose the initial solution is x=0, y=0, z=0, First Iteration x= 1.0, y=0.571, 21.333 putting the values on the R. H. S. of (B). Second Iteration: x=1.095 y=1.095 z= 1.048 Third Iteration : x=20.995 y=1.026 z=0.969 Fourth iteration; x=0.993 y=0.990 z=1.000 Fifth iteration: = x=1.002 y=0.998 2=1,004 Sixth iteration: x=1.001 y=1.001 2=81.001 Seventh iteration : *=1.000 y=1.000 z= 1,000 Example ? Solve the ‘system of equations by Method : “ aa Mt6xt2x5=15 . a oe to Gay 6x1 tx +x5=9 | : Solution ; ‘ Step I. Setting up the Jacobi method by” solving the ith equation for *t, We obtain. = 15—6x,—2y5 %2=—3—x, 46x, 3=9 6x - If we put *1=0, %3=0 and-xy=0 IS: } F150); sales ' v= | 36 | etc, lag (=78J The method is clear] ly diverging, because ¢ the order are not diago; nally dominant, Step Il. Now if-we switch equations 1 and 3 of the set (A) and then switch quations 2 and 3 of the result we get he equations in 6x1 +x2+%3=9, } 14 6x2+2x5=315 | —— @) 7 System (B) is clearly diagonally dominant, (B) can be re-written as 3 L 1 \xs ae 3-(t)a-(4 5 1 1 \xs wo $-(H(H) 1 1 xu at (=)a- ( Choosing x9=0 ie. x,9=0 x,9=0 and x;°=0 and setting up iteration, ~~ (3 w=} 5 | a] [2] 24) fry we] 2s | “TR | te) Which is clearly converging to the solution x= (1.0, 2.0, 1.0)7. 7 Remark 1: The Jacobi method is an example of a method of simultaneous displacements. That is at the end of cach iteration, we replace all of the elements of x! simultaneously with the elements of x**t, Remark 2; It is often desirable to modify the original Set of equations to produce a matrix, which is, if not diagonally dominant, should be as close to diagonally dothinant as Possible. Remark 3; A sufficient condition for convergence is that na haul >S | ay | P=, yee > (1) j=l JAi when ,f4) is true x*+1 will convege to the solution no matter what initial vector js used, . - 18 Gauss Seidel Method or Mcthod of Successive displacements procedure, Given a system of Linear equations Ax=b. If the system is not diagonally dominant, make it so by inter-changing rows etc. Then the system can be written in the iterative form as i=l a ; Seas el Ss Yitte rH yates ky kaa, Qyevees au aus ai : j=l jaith erative procedure will continue cy. The following example of this method. he solution of the For different values of k, the it until we obtain the desired accura will Illustrate the procedural steps Find to 3 decimal places t system of equations. Ixy +2x2+23=15 x1 +10x2+2x39=16 2x,+3x2.—8a3=1 Solution : Step I. The Given system of equations is already in the diagonal dominant form, re-writing the equations m= ay (5-2 %) mat (6-1-2) aye —E (2x13) we set up the iteration 1 ayhtlea Tp (1522 x34) > () 1 xb les jo 16a —2354) ——— (2 1 xyes (1 + 2x,ht14 3xnk th) —— Q) We must set up initial estimate for x, x;, x3 in order to get 719 the iterative process started. A particularly simple approach is to take x°=0, x,9=0 and x;9=0 putting these values in eq. (1) when kK=0 We get x,!=1.364, then putting x,!=1.364 and x;°=0.0 in equation (2) we get x2!=1.453, then putting x,!=1.364 and X2!= 1.463 in eq. (3) we get x;1=0.765 continuing in this way and using the previous values in the next equation we get fork=t = x2=1.028 -x2=1.344 —-x32=0.636 fork=2 = xp=1.061 —-x,°= 1.367 -x33=0.653 fork=3 x=1.056 -x,4=1.364 x34 0.650 fork=4 = xj5=1.0565 x25=1.3643 x35=0-6507 fork=5 — x,5=31.0564 x,=1.3642 -x36=0.6507 Hence x, =1.056 x2 = 1.364 and x;=0.651 pee 2 Solve the system of equations 4x,—- 2xgtx3212 2x1 + 3x,.—x3=7 2x,-2x, + 2x38 By Gauss seidel method. Solution. Step 1. The given system of equations 1s diagonally domin- ant but not strictly diagonally dominant. The equatiors can be Tewritten as 1 =4 (12+ 2x23] ar w=} (7-25, +231 ce x34 [8—2x) +21] pns—eet |G) starting values x,=0, x2.=0 and x3=0 ky 2. putting in (1) m= = 3.0 Z putting x;=3.0 and x3=0.0 in equation (2) we get y=). Now putting xj=3.0 and x2=1/3=0.3332 in equation (3) x3=4 (8-64 2/3] =8/€= 1.3333 80 Second iteration ; Put x9@0,333 and xy=1,333 in equation (1) we get xed [124+0,666— 1.533] 2.8333 Now put x)e2.8333 and x) = 1.3333 in equation (2) a2 4 [75.6666 + 1.3333] = 0.8889 i Now put x; 2.8333 and x,=0.8889 in Equation (3) 8 $,6666 + 1.77778]==2.0556 xe ‘Third iteration. put x)-0,8889 and 32,0556 in (1) xped [1241.7778—2,0556]=2.9305 put x1=2.9305 and x3=2.0566 in (2) we get aed [7 $.8610+ 2.0556] = 1.0648 Now put x, = 2.9205 and x7 = 1.6648 in (3) xy=4 [8—5.8610-+2.1296]= 2.1343 Fourth iteration, put xger1.0648 and x;=+2,1343 in (1) . ye 4 (1242,1296 — 2.1343] = 2,998 put x1—=2.998 and x3— 2.1343 in (2) we get 24 [7- 5.996 42,1343, — 1,046 Now put x,= 2.998 and x» 1.046 in (3) X5= 4 (85.996 + 2,092) 2,048 After 4 iterations the solution of the system of equations is 12.998, x)= 1.017 and x5 = 2.048, If the process is continued for few more iterations the solution will converge to the true solution. %3.0, x2=51.0 and <3= 2,0 Remarks ; “ W1, Jacobi method is very slowly convergent, if it does converge, it will converge Linearly. Vv 2 If the matrix of the co-efficients is diagonally dominant, it guarantees the fast convergence of the method. 81 iB} Ve Gauss Seidel method is fastly convergent than Jacobi method and on the whole we ca: Seidel method convergs twiee method. Comparison of Methods i In this chapter we have studied two t: (@®) Direct methods (ii) Iterative methods In the category of direct methods, Eli: are advantageous because they can be, is large. in say that Guass as fast as Jacobi 'yPes of methods, mination methods applied when the system In the iterative methods, (@) rounding errors have less effect, (6) on the computer, the storage is economical when the matrix is sparse. (c) these are sgif correcting methods. (@) easier to program and can be impleniented on the computer, Diagonal Dominance theorem Stetement: Given a system of equations Ax=6 prove that in an iterative method the rapid convergence is guaranteed a if Law| a > Lay | FST, 2yrocsneeett Jal ini Proof : StepT. If the matrix of the co-efficients is diagonally dominant then there is no loss of generality in the co-efficient matrix, Lot X be the exact solution of the system Ax=d foes BC Hiy Raynes Fy) T =.

You might also like