In[1]:=

Off[General :: spell1, General :: spell]

In[2]:=

If[$SystemID == "Windows", << A:\MATH375.M, Needs["math375`"]]

Gaussian Elimination

This notebook contains three different algorithms for performing Gaussian Elimination. The first is Gaussian Elimination with nonzero column pivoting. The second is Gaussian Elimination with partial pivoting. The third is Gaussian Elimination with scaled column pivoting.

In[3]:=

a = {{2.0, -1.5, 3.0, 1.0}, {-1.0, 0.0, 2.0, 3.0}, {4.0, -4.5, 5.0, 1.0}} ;

In[4]:=

b = {{1.19, 2.11, -100.0, 1.0, 1.12}, {14.2, -0.122, 12.2, -1.0, 3.44}, {0.0, 100.0, -99.9, 1.0, 2.15}, {15.3, 0.110, -13.1, -1.0, 4.16}} ;

In[5]:=

c = N[{{Pi, -E, Sqrt[2], -Sqrt[3], Sqrt[11]}, {Pi^2, E, -E^2, 3/7, 0}, {Sqrt[5], -Sqrt[6], 1, -Sqrt[2], Pi}, {Pi^3, E^2, -Sqrt[7], 1/9, Sqrt[2]}}] ;

In[6]:=

MatrixForm[a]

Out[6]//MatrixForm=

( 2.`     -1.5`   3.`     1.`   )    -1.`    0.`     2.`     3.`    4.`     -4.5`   5.`     1.`

In[7]:=

MatrixForm[b]

Out[7]//MatrixForm=

( 1.19`     2.11`     -100.`    1.`       1.12`   )    14.2`     -0.122`   12.2`     -1.`      3.44`    0.`       100.`     -99.9`    1.`       2.15`    15.3`     0.11`     -13.1`    -1.`      4.16`

In[8]:=

MatrixForm[c]

Out[8]//MatrixForm=

( 3.141592653589793`     -2.718281828459045`    1.4142135623730951`    -1.7320508075688772`   3.3166247903554`     )    9.869604401089358`     2.718281828459045`     -7.3890560989306495`   0.42857142857142855`   0.`    2.23606797749979`      -2.449489742783178`    1.`                    -1.4142135623730951`   3.141592653589793`    31.006276680299816`    7.3890560989306495`    -2.6457513110645907`   0.1111111111111111`    1.4142135623730951`

•Nonzero Column Pivoting

In[9]:=

MatrixForm[gencp[a, Verbose -> True]]

Multiply row   1   by   -0.5`   and subtract from row   2  .

( 2.`      -1.5`    3.`      1.`    )    0.`      -0.75`   3.5`     3.5`    4.`      -4.5`    5.`      1.`

Multiply row   1   by   2.`   and subtract from row   3  .

( 2.`      -1.5`    3.`      1.`    )    0.`      -0.75`   3.5`     3.5`    0.`      -1.5`    -1.`     -1.`

Multiply row   2   by   2.`   and subtract from row   3  .

( 2.`      -1.5`    3.`      1.`    )    0.`      -0.75`   3.5`     3.5`    0.`      0.`      -8.`     -8.`

Out[9]//MatrixForm=

( 2.`      -1.5`    3.`      1.`    )    0.`      -0.75`   3.5`     3.5`    0.`      0.`      -8.`     -8.`

In[10]:=

backsub[gencp[a]]

Out[10]=

{-1.`, 0.`, 1.`}

In[11]:=

MatrixForm[gencp[b, Verbose -> True]]

Multiply row   1   by   11.932773109243698`   and subtract from row   2  .

( 1.19`                  2.11`                  -100.`                 1.`                    1.12`                )    0.`                    -25.3001512605042`     1205.47731092437`      -12.932773109243698`   -9.924705882352944`    0.`                    100.`                  -99.9`                 1.`                    2.15`    15.3`                  0.11`                  -13.1`                 -1.`                   4.16`

Multiply row   1   by   0.`   and subtract from row   3  .

( 1.19`                  2.11`                  -100.`                 1.`                    1.12`                )    0.`                    -25.3001512605042`     1205.47731092437`      -12.932773109243698`   -9.924705882352944`    0.`                    100.`                  -99.9`                 1.`                    2.15`    15.3`                  0.11`                  -13.1`                 -1.`                   4.16`

Multiply row   1   by   12.857142857142858`   and subtract from row   4  .

( 1.19`                  2.11`                  -100.`                 1.`                    1.12`                )    0.`                    -25.3001512605042`     1205.47731092437`      -12.932773109243698`   -9.924705882352944`    0.`                    100.`                  -99.9`                 1.`                    2.15`    0.`                    -27.018571428571427`   1272.6142857142859`    -13.857142857142858`   -10.240000000000002`

Multiply row   2   by   -3.952545538971103`   and subtract from row   3  .

( 1.19`                       2.11`                       -100.`                      1.`                         1.12`                     )    0.`                         -25.3001512605042`          1205.47731092437`           -12.932773109243698`        -9.924705882352944`    0.`                         -1.4210854715202004`*^-14   4664.803967625`             -50.11737465946662`         -37.07785196089439`    0.`                         -27.018571428571427`        1272.6142857142859`         -13.857142857142858`        -10.240000000000002`

Multiply row   2   by   1.0679213396937208`   and subtract from row   4  .

( 1.19`                       2.11`                       -100.`                      1.`                         1.12`                     )    0.`                         -25.3001512605042`          1205.47731092437`           -12.932773109243698`        -9.924705882352944`    0.`                         -1.4210854715202004`*^-14   4664.803967625`             -50.11737465946662`         -37.07785196089439`    0.`                         0.`                         -14.740659138451292`        -0.04595847236440065`       0.3588052019485062`

Multiply row   3   by   -0.00315997397548867`   and subtract from row   4  .

( 1.19`                       2.11`                       -100.`                      1.`                         1.12`                     )    0.`                         -25.3001512605042`          1205.47731092437`           -12.932773109243698`        -9.924705882352944`    0.`                         -1.4210854715202004`*^-14   4664.803967625`             -50.11737465946662`         -37.07785196089439`    0.`                         0.`                         0.`                         -0.2043280720081305`        0.24164015468505834`

Out[11]//MatrixForm=

( 1.19`                       2.11`                       -100.`                      1.`                         1.12`                     )    0.`                         -25.3001512605042`          1205.47731092437`           -12.932773109243698`        -9.924705882352944`    0.`                         -1.4210854715202004`*^-14   4664.803967625`             -50.11737465946662`         -37.07785196089439`    0.`                         0.`                         0.`                         -0.2043280720081305`        0.24164015468505834`

In[12]:=

backsub[gencp[b]]

Out[12]=

{0.1768252974993453`, 0.012692690867687867`, -0.020654050137131123`, -1.1826086954681545`}

In[13]:=

MatrixForm[gencp[c, Verbose -> True]]

Multiply row   1   by   3.141592653589793`   and subtract from row   2  .

( 3.141592653589793`     -2.718281828459045`    1.4142135623730951`    -1.7320508075688772`   3.3166247903554`     )    0.`                    11.25801605113261`     -11.831939037089015`   5.869969521274082`     -10.419484076094312`    2.23606797749979`      -2.449489742783178`    1.`                    -1.4142135623730951`   3.141592653589793`    31.006276680299816`    7.3890560989306495`    -2.6457513110645907`   0.1111111111111111`    1.4142135623730951`

Multiply row   1   by   0.7117625434171772`   and subtract from row   3  .

( 3.141592653589793`       -2.718281828459045`      1.4142135623730951`      -1.7320508075688772`     3.3166247903554`       )    0.`                      11.25801605113261`       -11.831939037089015`     5.869969521274082`       -10.419484076094312`    0.`                      -0.514718554834473`      -0.006584242089740844`   -0.18140467425009543`    0.7809433572459716`    31.006276680299816`      7.3890560989306495`      -2.6457513110645907`     0.1111111111111111`      1.4142135623730951`

Multiply row   1   by   9.869604401089358`   and subtract from row   4  .

( 3.141592653589793`       -2.718281828459045`      1.4142135623730951`      -1.7320508075688772`     3.3166247903554`       )    0.`                      11.25801605113261`       -11.831939037089015`     5.869969521274082`       -10.419484076094312`    0.`                      -0.514718554834473`      -0.006584242089740844`   -0.18140467425009543`    0.7809433572459716`    0.`                      34.217422396491266`      -16.60347971034235`      17.205767384403277`      -31.319561065280627`

Multiply row   2   by   -0.045720183067485494`   and subtract from row   3  .

( 3.141592653589793`     -2.718281828459045`    1.4142135623730951`    -1.7320508075688772`   3.3166247903554`     )    0.`                    11.25801605113261`     -11.831939037089015`   5.869969521274082`     -10.419484076094312`    0.`                    0.`                    -0.5475426609087787`   0.08697140686311577`   0.30456263781818976`    0.`                    34.217422396491266`    -16.60347971034235`    17.205767384403277`    -31.319561065280627`

Multiply row   2   by   3.0393829819641116`   and subtract from row   4  .

( 3.141592653589793`     -2.718281828459045`    1.4142135623730951`    -1.7320508075688772`   3.3166247903554`     )    0.`                    11.25801605113261`     -11.831939037089015`   5.869969521274082`     -10.419484076094312`    0.`                    0.`                    -0.5475426609087787`   0.08697140686311577`   0.30456263781818976`    0.`                    0.`                    19.35831444262284`     -0.6353180832051919`   0.3492415164464795`

Multiply row   3   by   -35.354897115218506`   and subtract from row   4  .

( 3.141592653589793`         -2.718281828459045`        1.4142135623730951`        -1.7320508075688772`       3.3166247903554`         )    0.`                        11.25801605113261`         -11.831939037089015`       5.869969521274082`         -10.419484076094312`    0.`                        0.`                        -0.5475426609087787`       0.08697140686311577`       0.30456263781818976`    0.`                        0.`                        -3.552713678800501`*^-15   2.4395470584060748`        11.117022241648135`

Out[13]//MatrixForm=

( 3.141592653589793`         -2.718281828459045`        1.4142135623730951`        -1.7320508075688772`       3.3166247903554`         )    0.`                        11.25801605113261`         -11.831939037089015`       5.869969521274082`         -10.419484076094312`    0.`                        0.`                        -0.5475426609087787`       0.08697140686311577`       0.30456263781818976`    0.`                        0.`                        -3.552713678800501`*^-15   2.4395470584060748`        11.117022241648135`

In[14]:=

backsub[gencp[c]]

Out[14]=

{0.7883937911191892`, -3.125413699353999`, 0.16759659891826414`, 4.557002581008483`}

•Partial Pivoting (AKA Maximal Column Pivoting)

In[15]:=

MatrixForm[gemcp[a, Verbose -> True]]

Swap rows   1   and   3  .

( 4.`     -4.5`   5.`     1.`   )    -1.`    0.`     2.`     3.`    2.`     -1.5`   3.`     1.`

Multiply row   1   by   -0.25`   and subtract from row   2  .

( 4.`       -4.5`     5.`       1.`     )    0.`       -1.125`   3.25`     3.25`    2.`       -1.5`     3.`       1.`

Multiply row   1   by   0.5`   and subtract from row   3  .

( 4.`       -4.5`     5.`       1.`     )    0.`       -1.125`   3.25`     3.25`    0.`       0.75`     0.5`      0.5`

Multiply row   2   by   -0.6666666666666666`   and subtract from row   3  .

( 4.`                   -4.5`                 5.`                   1.`                 )    0.`                   -1.125`               3.25`                 3.25`    0.`                   0.`                   2.6666666666666665`   2.6666666666666665`

Out[15]//MatrixForm=

( 4.`                   -4.5`                 5.`                   1.`                 )    0.`                   -1.125`               3.25`                 3.25`    0.`                   0.`                   2.6666666666666665`   2.6666666666666665`

In[16]:=

backsub[gemcp[a]]

Out[16]=

{-1.`, 0.`, 1.`}

In[17]:=

MatrixForm[gemcp[b, Verbose -> True]]

Swap rows   1   and   4  .

( 15.3`     0.11`     -13.1`    -1.`      4.16`   )    14.2`     -0.122`   12.2`     -1.`      3.44`    0.`       100.`     -99.9`    1.`       2.15`    1.19`     2.11`     -100.`    1.`       1.12`

Multiply row   1   by   0.9281045751633987`   and subtract from row   2  .

( 15.3`                       0.11`                       -13.1`                      -1.`                        4.16`                     )    -1.7763568394002505`*^-15   -0.22409150326797386`       24.35816993464052`          -0.07189542483660127`       -0.42091503267973884`    0.`                         100.`                       -99.9`                      1.`                         2.15`    1.19`                       2.11`                       -100.`                      1.`                         1.12`

Multiply row   1   by   0.`   and subtract from row   3  .

( 15.3`                       0.11`                       -13.1`                      -1.`                        4.16`                     )    -1.7763568394002505`*^-15   -0.22409150326797386`       24.35816993464052`          -0.07189542483660127`       -0.42091503267973884`    0.`                         100.`                       -99.9`                      1.`                         2.15`    1.19`                       2.11`                       -100.`                      1.`                         1.12`

Multiply row   1   by   0.07777777777777778`   and subtract from row   4  .

( 15.3`                       0.11`                       -13.1`                      -1.`                        4.16`                     )    -1.7763568394002505`*^-15   -0.22409150326797386`       24.35816993464052`          -0.07189542483660127`       -0.42091503267973884`    0.`                         100.`                       -99.9`                      1.`                         2.15`    -2.220446049250313`*^-16    2.1014444444444442`         -98.9811111111111`          1.0777777777777777`         0.7964444444444445`

Swap rows   2   and   3  .

( 15.3`                       0.11`                       -13.1`                      -1.`                        4.16`                     )    -1.7763568394002505`*^-15   100.`                       -99.9`                      1.`                         2.15`    0.`                         -0.22409150326797386`       24.35816993464052`          -0.07189542483660127`       -0.42091503267973884`    -2.220446049250313`*^-16    2.1014444444444442`         -98.9811111111111`          1.0777777777777777`         0.7964444444444445`

Multiply row   2   by   -0.0022409150326797387`   and subtract from row   3  .

( 15.3`                       0.11`                       -13.1`                      -1.`                        4.16`                     )    -1.7763568394002505`*^-15   100.`                       -99.9`                      1.`                         2.15`    0.`                         0.`                         24.134302522875817`         -0.06965450980392153`       -0.4160970653594774`    -2.220446049250313`*^-16    2.1014444444444442`         -98.9811111111111`          1.0777777777777777`         0.7964444444444445`

Multiply row   2   by   0.021014444444444443`   and subtract from row   4  .

( 15.3`                       0.11`                       -13.1`                      -1.`                        4.16`                     )    -1.7763568394002505`*^-15   100.`                       -99.9`                      1.`                         2.15`    0.`                         0.`                         24.134302522875817`         -0.06965450980392153`       -0.4160970653594774`    -2.220446049250313`*^-16    0.`                         -96.8817681111111`          1.0567633333333333`         0.751263388888889`

Swap rows   3   and   4  .

( 15.3`                       0.11`                       -13.1`                      -1.`                        4.16`                     )    -1.7763568394002505`*^-15   100.`                       -99.9`                      1.`                         2.15`    0.`                         0.`                         -96.8817681111111`          1.0567633333333333`         0.751263388888889`    -2.220446049250313`*^-16    0.`                         24.134302522875817`         -0.06965450980392153`       -0.4160970653594774`

Multiply row   3   by   -0.24911088013171717`   and subtract from row   4  .

( 15.3`                       0.11`                       -13.1`                      -1.`                        4.16`                     )    -1.7763568394002505`*^-15   100.`                       -99.9`                      1.`                         2.15`    0.`                         0.`                         -96.8817681111111`          1.0567633333333333`         0.751263388888889`    -2.220446049250313`*^-16    0.`                         0.`                         0.19359673425367235`        -0.22894918134262973`

Out[17]//MatrixForm=

( 15.3`                       0.11`                       -13.1`                      -1.`                        4.16`                     )    -1.7763568394002505`*^-15   100.`                       -99.9`                      1.`                         2.15`    0.`                         0.`                         -96.8817681111111`          1.0567633333333333`         0.751263388888889`    -2.220446049250313`*^-16    0.`                         0.`                         0.19359673425367235`        -0.22894918134262973`

In[18]:=

backsub[gemcp[b]]

Out[18]=

{0.17682529749934553`, 0.012692690867687546`, -0.02065405013713109`, -1.182608695468151`}

In[19]:=

MatrixForm[gemcp[c, Verbose -> True]]

Swap rows   1   and   4  .

( 31.006276680299816`    7.3890560989306495`    -2.6457513110645907`   0.1111111111111111`    1.4142135623730951`  )    9.869604401089358`     2.718281828459045`     -7.3890560989306495`   0.42857142857142855`   0.`    2.23606797749979`      -2.449489742783178`    1.`                    -1.4142135623730951`   3.141592653589793`    3.141592653589793`     -2.718281828459045`    1.4142135623730951`    -1.7320508075688772`   3.3166247903554`

Multiply row   1   by   0.3183098861837907`   and subtract from row   2  .

( 31.006276680299816`    7.3890560989306495`    -2.6457513110645907`   0.1111111111111111`    1.4142135623730951`  )    0.`                    0.36627222260278547`   -6.546887300235064`    0.39320366343989627`   -0.4501581580785531`    2.23606797749979`      -2.449489742783178`    1.`                    -1.4142135623730951`   3.141592653589793`    3.141592653589793`     -2.718281828459045`    1.4142135623730951`    -1.7320508075688772`   3.3166247903554`

Multiply row   1   by   0.07211662337130922`   and subtract from row   3  .

( 31.006276680299816`    7.3890560989306495`    -2.6457513110645907`   0.1111111111111111`    1.4142135623730951`  )    0.`                    0.36627222260278547`   -6.546887300235064`    0.39320366343989627`   -0.4501581580785531`    0.`                    -2.982363518539235`    1.1908026508341927`    -1.422226520525463`    3.039604346745535`    3.141592653589793`     -2.718281828459045`    1.4142135623730951`    -1.7320508075688772`   3.3166247903554`

Multiply row   1   by   0.10132118364233779`   and subtract from row   4  .

( 31.006276680299816`        7.3890560989306495`        -2.6457513110645907`       0.1111111111111111`        1.4142135623730951`      )    0.`                        0.36627222260278547`       -6.546887300235064`        0.39320366343989627`       -0.4501581580785531`    0.`                        -2.982363518539235`        1.1908026508341927`        -1.422226520525463`        3.039604346745535`    -4.440892098500626`*^-16   -3.4669497384023336`       1.6822842168334264`        -1.7433087168624704`       3.173334998292711`

Swap rows   2   and   4  .

( 31.006276680299816`        7.3890560989306495`        -2.6457513110645907`       0.1111111111111111`        1.4142135623730951`      )    0.`                        -3.4669497384023336`       1.6822842168334264`        -1.7433087168624704`       3.173334998292711`    0.`                        -2.982363518539235`        1.1908026508341927`        -1.422226520525463`        3.039604346745535`    -4.440892098500626`*^-16   0.36627222260278547`       -6.546887300235064`        0.39320366343989627`       -0.4501581580785531`

Multiply row   2   by   0.8602269267144295`   and subtract from row   3  .

( 31.006276680299816`        7.3890560989306495`        -2.6457513110645907`       0.1111111111111111`        1.4142135623730951`      )    0.`                        -3.4669497384023336`       1.6822842168334264`        -1.7433087168624704`       3.173334998292711`    0.`                        -4.440892098500626`*^-16   -0.2563435308726165`       0.07741457929561535`       0.3098161337288574`    -4.440892098500626`*^-16   0.36627222260278547`       -6.546887300235064`        0.39320366343989627`       -0.4501581580785531`

Multiply row   2   by   -0.10564682220388168`   and subtract from row   4  .

( 31.006276680299816`        7.3890560989306495`        -2.6457513110645907`       0.1111111111111111`        1.4142135623730951`      )    0.`                        -3.4669497384023336`       1.6822842168334264`        -1.7433087168624704`       3.173334998292711`    0.`                        -4.440892098500626`*^-16   -0.2563435308726165`       0.07741457929561535`       0.3098161337288574`    -4.440892098500626`*^-16   5.551115123125783`*^-17    -6.3691593186828666`       0.20902863738304975`       -0.1149053997205679`

Swap rows   3   and   4  .

( 31.006276680299816`        7.3890560989306495`        -2.6457513110645907`       0.1111111111111111`        1.4142135623730951`      )    0.`                        -3.4669497384023336`       1.6822842168334264`        -1.7433087168624704`       3.173334998292711`    0.`                        -4.440892098500626`*^-16   -6.3691593186828666`       0.20902863738304975`       -0.1149053997205679`    -4.440892098500626`*^-16   5.551115123125783`*^-17    -0.2563435308726165`       0.07741457929561535`       0.3098161337288574`

Multiply row   3   by   0.040247624222662405`   and subtract from row   4  .

( 31.006276680299816`        7.3890560989306495`        -2.6457513110645907`       0.1111111111111111`        1.4142135623730951`      )    0.`                        -3.4669497384023336`       1.6822842168334264`        -1.7433087168624704`       3.173334998292711`    0.`                        -4.440892098500626`*^-16   -6.3691593186828666`       0.20902863738304975`       -0.1149053997205679`    -4.440892098500626`*^-16   5.551115123125783`*^-17    0.`                        0.0690016732464472`        0.3144408030779656`

Out[19]//MatrixForm=

( 31.006276680299816`        7.3890560989306495`        -2.6457513110645907`       0.1111111111111111`        1.4142135623730951`      )    0.`                        -3.4669497384023336`       1.6822842168334264`        -1.7433087168624704`       3.173334998292711`    0.`                        -4.440892098500626`*^-16   -6.3691593186828666`       0.20902863738304975`       -0.1149053997205679`    -4.440892098500626`*^-16   5.551115123125783`*^-17    0.`                        0.0690016732464472`        0.3144408030779656`

In[20]:=

backsub[gemcp[b]]

Out[20]=

{0.17682529749934553`, 0.012692690867687546`, -0.02065405013713109`, -1.182608695468151`}

•Scaled Column Pivoting

In[21]:=

MatrixForm[gescp[a, Verbose -> True]]

Swap rows   1   and   3  .

( 4.`     -4.5`   5.`     1.`   )    -1.`    0.`     2.`     3.`    2.`     -1.5`   3.`     1.`

Multiply row   1   by   -0.25`   and subtract from row   2  .

( 4.`       -4.5`     5.`       1.`     )    0.`       -1.125`   3.25`     3.25`    2.`       -1.5`     3.`       1.`

Multiply row   1   by   0.5`   and subtract from row   3  .

( 4.`       -4.5`     5.`       1.`     )    0.`       -1.125`   3.25`     3.25`    0.`       0.75`     0.5`      0.5`

Multiply row   2   by   -0.6666666666666666`   and subtract from row   3  .

( 4.`                   -4.5`                 5.`                   1.`                 )    0.`                   -1.125`               3.25`                 3.25`    0.`                   0.`                   2.6666666666666665`   2.6666666666666665`

Out[21]//MatrixForm=

( 4.`                   -4.5`                 5.`                   1.`                 )    0.`                   -1.125`               3.25`                 3.25`    0.`                   0.`                   2.6666666666666665`   2.6666666666666665`

In[22]:=

backsub[gescp[a]]

Out[22]=

{-1.`, 0.`, 1.`}

In[23]:=

MatrixForm[gescp[b, Verbose -> True]]

Swap rows   1   and   2  .

( 14.2`     -0.122`   12.2`     -1.`      3.44`   )    1.19`     2.11`     -100.`    1.`       1.12`    0.`       100.`     -99.9`    1.`       2.15`    15.3`     0.11`     -13.1`    -1.`      4.16`

Multiply row   1   by   0.08380281690140845`   and subtract from row   2  .

( 14.2`                  -0.122`                12.2`                  -1.`                   3.44`                )    0.`                    2.120223943661972`     -101.02239436619718`   1.0838028169014085`    0.8317183098591551`    0.`                    100.`                  -99.9`                 1.`                    2.15`    15.3`                  0.11`                  -13.1`                 -1.`                   4.16`

Multiply row   1   by   0.`   and subtract from row   3  .

( 14.2`                  -0.122`                12.2`                  -1.`                   3.44`                )    0.`                    2.120223943661972`     -101.02239436619718`   1.0838028169014085`    0.8317183098591551`    0.`                    100.`                  -99.9`                 1.`                    2.15`    15.3`                  0.11`                  -13.1`                 -1.`                   4.16`

Multiply row   1   by   1.0774647887323945`   and subtract from row   4  .

( 14.2`                  -0.122`                12.2`                  -1.`                   3.44`                )    0.`                    2.120223943661972`     -101.02239436619718`   1.0838028169014085`    0.8317183098591551`    0.`                    100.`                  -99.9`                 1.`                    2.15`    0.`                    0.24145070422535214`   -26.245070422535214`   0.07746478873239449`   0.4535211267605632`

Swap rows   2   and   3  .

( 14.2`                  -0.122`                12.2`                  -1.`                   3.44`                )    0.`                    100.`                  -99.9`                 1.`                    2.15`    0.`                    2.120223943661972`     -101.02239436619718`   1.0838028169014085`    0.8317183098591551`    0.`                    0.24145070422535214`   -26.245070422535214`   0.07746478873239449`   0.4535211267605632`

Multiply row   2   by   0.02120223943661972`   and subtract from row   3  .

( 14.2`                  -0.122`                12.2`                  -1.`                   3.44`                )    0.`                    100.`                  -99.9`                 1.`                    2.15`    0.`                    0.`                    -98.90429064647887`    1.0626005774647886`    0.7861334950704226`    0.`                    0.24145070422535214`   -26.245070422535214`   0.07746478873239449`   0.4535211267605632`

Multiply row   2   by   0.0024145070422535216`   and subtract from row   4  .

( 14.2`                       -0.122`                     12.2`                       -1.`                        3.44`                     )    0.`                         100.`                       -99.9`                      1.`                         2.15`    0.`                         0.`                         -98.90429064647887`         1.0626005774647886`         0.7861334950704226`    0.`                         -2.7755575615628914`*^-17   -26.003861169014087`        0.07505028169014097`        0.44832993661971815`

Swap rows   3   and   4  .

( 14.2`                       -0.122`                     12.2`                       -1.`                        3.44`                     )    0.`                         100.`                       -99.9`                      1.`                         2.15`    0.`                         0.`                         -26.003861169014087`        0.07505028169014097`        0.44832993661971815`    0.`                         -2.7755575615628914`*^-17   -98.90429064647887`         1.0626005774647886`         0.7861334950704226`

Multiply row   3   by   3.8034463422044467`   and subtract from row   4  .

( 14.2`                       -0.122`                     12.2`                       -1.`                        3.44`                     )    0.`                         100.`                       -99.9`                      1.`                         2.15`    0.`                         0.`                         -26.003861169014087`        0.07505028169014097`        0.44832993661971815`    0.`                         -2.7755575615628914`*^-17   0.`                         0.7771508580890086`         -0.9190653624665959`

Out[23]//MatrixForm=

( 14.2`                       -0.122`                     12.2`                       -1.`                        3.44`                     )    0.`                         100.`                       -99.9`                      1.`                         2.15`    0.`                         0.`                         -26.003861169014087`        0.07505028169014097`        0.44832993661971815`    0.`                         -2.7755575615628914`*^-17   0.`                         0.7771508580890086`         -0.9190653624665959`

In[24]:=

backsub[gescp[b]]

Out[24]=

{0.17682529749934559`, 0.012692690867687552`, -0.02065405013713108`, -1.18260869546815`}

In[25]:=

MatrixForm[gescp[c, Verbose -> True]]

Multiply row   1   by   3.141592653589793`   and subtract from row   2  .

( 3.141592653589793`     -2.718281828459045`    1.4142135623730951`    -1.7320508075688772`   3.3166247903554`     )    0.`                    11.25801605113261`     -11.831939037089015`   5.869969521274082`     -10.419484076094312`    2.23606797749979`      -2.449489742783178`    1.`                    -1.4142135623730951`   3.141592653589793`    31.006276680299816`    7.3890560989306495`    -2.6457513110645907`   0.1111111111111111`    1.4142135623730951`

Multiply row   1   by   0.7117625434171772`   and subtract from row   3  .

( 3.141592653589793`       -2.718281828459045`      1.4142135623730951`      -1.7320508075688772`     3.3166247903554`       )    0.`                      11.25801605113261`       -11.831939037089015`     5.869969521274082`       -10.419484076094312`    0.`                      -0.514718554834473`      -0.006584242089740844`   -0.18140467425009543`    0.7809433572459716`    31.006276680299816`      7.3890560989306495`      -2.6457513110645907`     0.1111111111111111`      1.4142135623730951`

Multiply row   1   by   9.869604401089358`   and subtract from row   4  .

( 3.141592653589793`       -2.718281828459045`      1.4142135623730951`      -1.7320508075688772`     3.3166247903554`       )    0.`                      11.25801605113261`       -11.831939037089015`     5.869969521274082`       -10.419484076094312`    0.`                      -0.514718554834473`      -0.006584242089740844`   -0.18140467425009543`    0.7809433572459716`    0.`                      34.217422396491266`      -16.60347971034235`      17.205767384403277`      -31.319561065280627`

Multiply row   2   by   -0.045720183067485494`   and subtract from row   3  .

( 3.141592653589793`     -2.718281828459045`    1.4142135623730951`    -1.7320508075688772`   3.3166247903554`     )    0.`                    11.25801605113261`     -11.831939037089015`   5.869969521274082`     -10.419484076094312`    0.`                    0.`                    -0.5475426609087787`   0.08697140686311577`   0.30456263781818976`    0.`                    34.217422396491266`    -16.60347971034235`    17.205767384403277`    -31.319561065280627`

Multiply row   2   by   3.0393829819641116`   and subtract from row   4  .

( 3.141592653589793`     -2.718281828459045`    1.4142135623730951`    -1.7320508075688772`   3.3166247903554`     )    0.`                    11.25801605113261`     -11.831939037089015`   5.869969521274082`     -10.419484076094312`    0.`                    0.`                    -0.5475426609087787`   0.08697140686311577`   0.30456263781818976`    0.`                    0.`                    19.35831444262284`     -0.6353180832051919`   0.3492415164464795`

Swap rows   3   and   4  .

( 3.141592653589793`     -2.718281828459045`    1.4142135623730951`    -1.7320508075688772`   3.3166247903554`     )    0.`                    11.25801605113261`     -11.831939037089015`   5.869969521274082`     -10.419484076094312`    0.`                    0.`                    19.35831444262284`     -0.6353180832051919`   0.3492415164464795`    0.`                    0.`                    -0.5475426609087787`   0.08697140686311577`   0.30456263781818976`

Multiply row   3   by   -0.02828462480716852`   and subtract from row   4  .

( 3.141592653589793`     -2.718281828459045`    1.4142135623730951`    -1.7320508075688772`   3.3166247903554`     )    0.`                    11.25801605113261`     -11.831939037089015`   5.869969521274082`     -10.419484076094312`    0.`                    0.`                    19.35831444262284`     -0.6353180832051919`   0.3492415164464795`    0.`                    0.`                    0.`                    0.06900167324644745`   0.314440803077965`

Out[25]//MatrixForm=

( 3.141592653589793`     -2.718281828459045`    1.4142135623730951`    -1.7320508075688772`   3.3166247903554`     )    0.`                    11.25801605113261`     -11.831939037089015`   5.869969521274082`     -10.419484076094312`    0.`                    0.`                    19.35831444262284`     -0.6353180832051919`   0.3492415164464795`    0.`                    0.`                    0.`                    0.06900167324644745`   0.314440803077965`

In[26]:=

backsub[gescp[c]]

Out[26]=

{0.7883937911191892`, -3.125413699353999`, 0.16759659891826417`, 4.557002581008483`}


Converted by Mathematica  (November 5, 2002)