Page 226 - Excel for Scientists and Engineers: Numerical Methods
P. 226

CHAPTER 9       SYSTEMS OF SIMULTANEOUS EOUATIONS                    203



                   Cells BIO, C10 and DIO contain, respectively, the formulas
                   =( $E$4-$C$4*Cg-$D$4*Dg)/$B$4
                   =($E$5-$8$5*89-$D$S*D9)/$C$5

                   =($E$6-$B$6*Bg-$C$6*Cg)/$D$6
                   When  these  formulas  are  filled  down  into  successive  rows,  as  shown  in
               Figure 9-10, the values of the variables XI, x2 and x3 converge.  Convergence to a
                suitable  level  is  observed  visually.  In  this  particular  example,  twenty-three
                iteration cycles were required to get below the  lo6  percent error level (here, the
                percentage error in the variable xl is shown).

                The Gauss-Seidel Method
                Implemented on a Worksheet
                   In  the  Gauss-Seidel  method,  an  improved  value  of  one  of the variables  is
                used  in the iteration cycle as soon as it has been calculated.  The Gauss-Seidel
                method is sometimes called the method of successive replacement.
                   To illustrate, consider the same system of order 3 that was used previously to
                illustrate the Jacobi method.  Again, begin with initial estimates of zero for xI, x2
                and x3.  Now solve for each unknown value in turn, using the latest values of the
                variables as they are calculated; thus


                                                  c1 -0-0
                                             x1  =
                                                    a1 1
                                                c2 - aZlxl - 0
                                           x2  =
                                                    a22

                                         x3  =  c3  - a31X1  - a32x2
                                                    a3 3
                   In the second iteration,

                                         XI  =  cl  - a12x2  - a13x3
                                                    a1  1
                and so on.
                   Using the  same constants  and  coefficients that were  used  in  the preceding
                example (Figure 9-10), the spreadsheet formulas in Figure 9-1 1 can be modified
                to implement the Gauss-Seidel method, in which the value of a variable is used
                as  soon  as  it  is  calculated.  The  formulas  in  cells  B14,  C14  and  D14  are,
                respectively,
   221   222   223   224   225   226   227   228   229   230   231