Soluton of Lnear System of Equatons and Matr Inverson Gauss Sedel Iteraton Method It s another well-known teratve method for solvng a system of lnear equatons of the form a + a22 + + ann = b a2 + a222 + + a2nn = b 2 an + an22+ + annn = b n In Jacob s method, the (r + )th appromaton to the above system s gven by Equatons ) b a2 ( r) a n ( r) = 2 n a a a ) b2 a2 ( r) a2n ( r) 2 = n a22 a22 a 22 a ) bn an ( r) nn ( ) ( r) n = n ann ann a nn ( r ) Here we can observe that no element of + ( ) replaces r entrely for the net cycle of computaton. ( r ) In Gauss-Sedel method, the correspondng elements of + replaces those of ( r ) as soon as they become avalable. Hence, t s called the method of successve dsplacements. For llustraton consder a + a22 + + ann = b a2 + a222 + + a2nn = b 2 an + an22+ + annn = b n In Gauss-Sedel teraton, the (r + )th appromaton or teraton s computed from: ) b a2 ( r) a n ( r) = 2 n a a a ) b2 a2 ) a2n ( r) 2 = n a22 a22 a 22 a ) bn an ) nn ( ) ) n = n ann ann a nn Thus, the general procedure can be wrtten n the followng compact form Copyrght Vrtual Unversty of Pakstan
b a a n ) j ) j ( r) = j j a j= a j= + a for all,2,..., = n and r =, 2,... To descrbe system n the frst equaton, we substtute the r-th appromaton nto the rght-hand sde and denote the result by ( r + ). In the second equaton, we substtute ) ( r) ( r) ( r ) (,,..., n ) and denote the result by + 2 ) ) ( r) ( r) In the thrd equaton, we substtute (, 2, 4,..., n ) and denote the result by ( r ) +, and so on. Ths process s contnued tll we arrve at the desred result. For llustraton, we consder the followng eample : Note The dfference between jacob s method and gauss Sedel method s that n jacob s method the appromaton calculated are used n the net teraton for net appromaton but n Gauss-sedel method the new appromaton calculated s nstantly replaced by the prevous one. Eample Fnd the soluton of the followng system of equatons usng Gauss-Sedel method and perform the frst fve teratons: 4 2 = 2 + 42 4 = 2 + 4 4 = + 4 = 2 4 Soluton The gven system of equatons can be rewrtten as = 0.5 + 0.252 + 0.25 2 = 0.5 + 0.25+ 0.25 4 = 0.25 + 0.25+ 0.254 4 = 0.25 + 0.252 + 0.25 Takng 2 = = 4 = 0 on the rght-hand sde of the frst equaton of the system, we get () = 0.5. Takng = 4 = 0 and the current value of, we get from the 2nd equaton of the system () 2 = 0.5 + (0.25)(0.5) + 0 = 0.625 Further, we take 4 = 0 and the current value of the system we obtan from the thrd equaton of () = + + 0.25 (0.25)(0.5) 0 = 0.75 Copyrght Vrtual Unversty of Pakstan 2
Now, usng the current values of 2 and the fourth equaton of system gves () 4 = 0.25 + (0.25)(0.625) + (0.25)(0.75) = 0.5 The Gauss-Sedel teratons for the gven set of equatons can be wrtten as ) ( r) ( r) = 0.5 + 0.252 + 0.25 ) ) ( r) 2 = 0.5 + 0.25 + 0.254 ) ) ( r) = 0.25 + 0.25 + 0.254 ) ) ) 4 = 0.25 + 0.252 + 0.25 Now, by Gauss-Sedel procedure, the 2nd and subsequent appromatons can be obtaned and the sequence of the frst fve appromatons are tabulated as below: Varables Iteraton number r 2 4 0.5 0.625 0.75 0.5 2 0.75 0.825 0.5625 0.5975 0.8475 0.8598 0.6098 0.679 4 0.8679 0.870 0.620 0.6205 5 0.8705 0.87402 0.62402 0.6245 Eample Solve the system by Gauss-Sedel teratve method 8 y+ 2z = 20 4+ y z = 6+ y+ 2z (Perform only four teratons) Soluton Consder the gven system as Copyrght Vrtual Unversty of Pakstan
8 y+ 2z = 20 4+ y z = 6+ y+ 2z the system s dagonally do mn ant = [ 20 + y 2 z] 8 y = [ 4 + z] z = [ 5 6 y] 2 we start wth an ntal apromaton = y = z = 0 0 0 0 substtutng these frst teraton = [ 20 + (0) 2(0) ] = 2.5 8 y = [ 4(2.5) + 0 ] = 2.090909 z = [ 5 6(2.5) (2.090909) ] =.4994 2 Second teraton 2 = [ 20 + y z] = [ 20 + (2.090909) 2(.4994) ] = 2.99806 8 8 y2 = [ 42 + z] = [ 4(2.99806) +.4994] = 2.0774 z2 = [ 5 62 y2] = [ 5 6(2.99806) (2.0774) ] = 0.9470 2 2 thrd teraton = [ 20 + (2.0774) 2(0.9470) ] =.02662 8 y = [ 4(.02662) + 0.9470 ] =.98256 z = [ 5 6(.02662) (.98256) ] = 0.9077262 2 Copyrght Vrtual Unversty of Pakstan 4
fourth teraton 4 = [ 20 + (.98256) 2(0.9077262) ] =.0652 8 y4 = [ 4(.0652) + 0.9077262 ] =.985607 z4 = [ 5 6(.0652) (.985607) ] = 0.89 2 Eample Solve the system by sung Gauss-sedel teraton method + 4y z = 2 + y+ 0z = 24 2+ 7y+ 4z Soluton + 4y z = 2 + y+ 0z = 24 2+ 7y+ 4z the gven system s dagonally do mn ant so we wll make t dagonaaly do mn ant by terchanagnhg the equatons + 4y z = 2 2+ 7y+ 4z + y+ 0z = 24 hence we can apply Gauss Sedel method from the above equatons = [2 4 y+ z ] y = [5 2 4 z ] 7 z = [24 y ] 0 Copyrght Vrtual Unversty of Pakstan 5
Frst appromaton puttng y = z = 0 = [2] =.457 putng =.457, z = 0 y = [5 2(.457) 4(0)] =.924697 7 puttng =.457, y =.924697 z = [24.457 (.924697)] =.708404 0 Second teraton 2 = [2 4(.924697) +.708404] = 0.9965 y2 = [5 2(0.9965) 4(.708404)] =.5475567 7 z2 = [24 0.9965 (.5475567)] =.840868 0 thrd teraton = [2 4(.5475567) +.8468] = 0.98759 2 y = [5 2(0.987592) 4(.8468)] =.5090274 7 z = [24 0.987592 (.5090274)] =.848525 0 fourth teraton 4 = [2 4(.5090274) +.848525] = 0.99008 y4 = [5 2(0.99008) 4(.8468)] =.507058 7 z 4 = [24 0.99008 (.507058)] =.8485652 0 Eample Usng Gauss-Sedel teraton method, solve the system of the equaton. 0 2y z w= 2+ 0y z w= 5 y+ 0z 2w= 27 y 2z+ 0w= 9 Copyrght Vrtual Unversty of Pakstan 6
(Perform only four teratons) Soluton 0 2y z w= 2+ 0y z w= 5 y+ 0z 2w= 27 y 2z+ 0w= 9 t s dagonally do mn anat and we may wrte eqauton as = [ + 2 y+ z+ w ] 0 y = [5 + 2 + z+ w ] 0 z = [27 + + y+ 2 w ] 0 w= [ 9 + + y+ 2 z ] 0 frst appromaton puttng y = z = w = 0 on RHS of (), we get = 0. y = [5 + 2(0.)] =.56 0 puttng = 0., y =.56 and w = 0 z = [27 + 0. +.56] = 2.886 0 puttng = 0., y =.56 and z = 2.886 w = [ 9 + 0. +.56 + 2(2.886)] = 0.68 0 second teraton 2 = [ + 2(.56) + 2.886 0.68] = 0.88692 0 y2 = [5 + 2(0.88692) + 2.886 0.68] =.95204 0 z2 = [27 + 0.88692 +.95204 + 2( 0.68)] = 2.9565624 0 w2 = [ 9 + 0.88692 +.95204 + 2(2.9565624)] = 0.024765 0 thrd teraton = [+ 2(.95204) + 2.9565624 0.0.024765] = 0.986405 0 Copyrght Vrtual Unversty of Pakstan 7
y = [5 + 2(0.986405) + 2.9565624 0.024765] =.9899087 0 z = [27 + 0.986405 +.9899087 + 2( 0.024765)] = 2.992409 0 w = [ 9 + 0.98405 +.9899087 + 2(2.992409)] = 0.004647 0 fourth teraton 4 = [ + 2(.9899087) + 2.992409 0.004647] = 0.9968054 0 y4 = [5 + 2(0.9968054) + 2.992409 0.004647] =.998848 0 z4 = [27 + 0.9968054 +.998848 + 2( 0.004647)] = 2.998666 0 w4 = [ 9 + 0.9968054 +.998848 + 2(2.998666)] = 0.0007677 0 Note When to stop the teratve processes,we stop the teratve process when we get the requred accuracy means f your are asked that fnd the accurate up to four places of decmal then we wll smply perform up to that teraton after whch we wll get the requred accuracy. If we calculate the root of the equaton and ts consecutve values are.8952625,.966625,.995625,.992655,.992745,.9927 Here the accuracy up to seven places of decmal s acheved so f you are asked to acqure the accuracy up to s places of decmal then we wll stop here. But n the solved eamples only some teraton are carred out and accuracy s not consdered here. Copyrght Vrtual Unversty of Pakstan 8