Page 91 - Applied Numerical Methods Using MATLAB
P. 91

80    SYSTEM OF LINEAR EQUATIONS
              First, to remove the x 1 terms from equations (2.2.0.m) other than (2.2.0.a), we
           subtract (2.2.0a)×a m1 /a 11 from each of them to get
                                 (0)     (0)    (0)     (0)
                                a x 1 + a x 2 + a x 3 = b               (2.2.1a)
                                 11      12     13      1
                                         (1)    (1)     (1)
                                        a x 2 + a x 3 = b               (2.2.1b)
                                         22     23      2
                                         (1)    (1)     (1)
                                        a x 2 + a x 3 = b               (2.2.1c)
                                         32     33      3
           with
            a (0)  = a mn ,  b (0)  for m, n = 1, 2, 3                  (2.2.2a)
             mn          m  = b m
                              (0)
                          (0)
                                                   (0)
                                 (0)
                                                       (0)
            a (1)  = a (0)  − (a /a )a ,  b (1)  = b (0)  − (a /a )b (0)  for m, n = 2, 3
             mn    mn    m1  11  1n    m     m     m1  11  1
                                                                        (2.2.2b)
           We call this work ‘pivoting at a 11 ’ and call the center element a 11 a ‘pivot’.
              Next, to remove the x 2 term from Eq. (2.2.1c) other than (2.2.1a,b), we sub-
                         (1)  (1)
           tract (2.2.1b)×a /a (m = 3) from it to get
                         m2  22
                                 (0)     (0)    (0)     (0)
                                a x 1 + a x 2 + a x 3 = b               (2.2.3a)
                                 11      12     13      1
                                                (1)
                                         (1)
                                        a x 2 + a x 3 = b (1)           (2.2.3b)
                                         22     23      2
                                                (2)     (2)
                                               a x 3 = b                (2.2.3c)
                                                33      3
           with
                                  (1)
                                                    (1)
                                                        (1)
                           (1)
                               (1)
             a (2)  = a (1)  − (a /a )a ,  b (2)  = b (1)  − (a /a )b (1)  for m, n = 3
              mn    mn    m2  22  2n    m     m     m2  22  2
                                                                         (2.2.4)
           We call this procedure ‘Gauss forward elimination’ and can generalize the updat-
           ing formula (2.2.2)/(2.2.4) as
                   (k−1)
             (k)
            a mn  = a mn  − (a (k−1) /a (k−1) )a (k−1)  for m, n = k + 1,k + 2,... ,M (2.2.5a)
                                       kn
                                 kk
                           mk
            b (k)  = b (k−1)  − (a (k−1) /a (k−1) )b (k−1)  for m = k + 1,k + 2,... ,M  (2.2.5b)
             m     m       mk    kk   k
              After having the triangular matrix–vector equation as Eq. (2.2.3), we can solve
           Eq. (2.2.3c) first to get
                                             (2)  (2)
                                       x 3 = b /a                       (2.2.6a)
                                             3   33
           and then substitute this result into Eq. (2.2.3b) to get
                                         (1)   (1)   (1)
                                   x 2 = (b  − a x 3 )/a                (2.2.6b)
                                         2     23    22
           Successively, we substitute Eqs. (2.2.6a,b) into Eq.(2.2.3a) to get
                                             3

                                       (0)      (0)     (0)
                                x 1 = b   −    a x n /a                 (2.2.6c)
                                       1        1n      11
                                            n=2
   86   87   88   89   90   91   92   93   94   95   96