Page 33 - Numerical Methods for Chemical Engineering
P. 33

22      1 Linear algebra



                   Backward substitution proceeds in the same manner as before. Even if rows must be
                   swapped for each column, the computational overhead of partial pivoting is relatively
                   small.
                     To demonstrate Gaussian elimination with partial pivoting, consider the system of equa-
                   tions (1.70) with the augmented matrix

                                                               
                                                     1114
                                            (A, b) =   2137                        (1.111)
                                                     3162

                   First, we examine the first column to see that the element of largest magnitude is in row 3.
                   We thus swap rows 1 and 3,
                                                               
                                                     3162
                                             ¯ ¯
                                            (A, b) =    2137                       (1.112)
                                                     1114
                   Note that we swap the rows even though a 11  = 0. As is shown in the supplemen-
                   tal material in the accompanying website, we do this to improve the numerical sta-
                   bility with respect to round-off error. We next do a row operation to zero the (2, 1)
                   element.

                                              λ 21 = ¯ a 21 /¯ a 11 = 2/3            (1.113)



                                                                                 
                                           3          1          6          2
                                            2
                                                                             2
                                                                  2
                                                       2
                                                         1
                          (A, b) (2, 1)  =      2 −         1 −         3 −         7 −         
                                                                                2
                                              3
                                                                    6
                                            3          3          3          3
                                           1          1          1          4
                                       3  1   6   2
                                                   
                                   =   0  1  −15  2                                (1.114)
                                          3        3
                                       1  1   1   4
                   We then perform another row operation to zero the (3, 1) element.
                                                   (2, 1)    (2, 1)
                                            λ 31 = a   a    = 1/3                    (1.115)
                                                  31    11
                                                                                
                                           3          1          6          2
                               (3, 1)                 1                      2
                          (A, b)          0                    −1          5    
                                                      3                      3   
                                   = 
                                            1          1          1          1

                                        1 −   3    1 −   1    1 −   6    4 −   2
                                            3          3          3          3
                                                   
                                       3  1   6   2
                                       0  1  −15  2 
                                          3        3                                (1.116)
                                   = 
                                       0  2  −13   1
                                          3        3
                   We now move to the second column, and note that the element of largest magnitude appears
   28   29   30   31   32   33   34   35   36   37   38