You are on page 1of 10

Back Substitution (cont )

Back Substitution (cont.)
144 12 1   a1   279.2 
 0 2.917 0.8264 a    58.33 
   2  
 0 0  0.2   a 3   0.23

Solving for a1
144a1  12a2  a3  279.2
279.2  12a2  a3
a1 
144
279.2  12 19.67  1.15

144
 0.2917
Gaussian Elimination with Partial Pivoting 
Solution

 25 5 1  a 1   106 .8 
 64 8 1  a   177 .2 
  2  
144 12 1  a 3   279 .2 

 a1  0.2917 
a    19.67 
 2  
 a3   1.15 
Gauss Elimination with Partial 
Gauss Elimination with Partial
Pivoting
Another Example
Partial Pivoting: Example
Consider the system of equations
10 x  7 x  7
1 2

 3 x1  2.099 x2  6 x3  3.901
5 x1  x2  5 x3  6
In matrix form
 10  7 0  x1   7 
 3 2.099 6  x  3.901
   2 =  
 5  1 5  x3   6 

Solve using Gaussian Elimination with Partial Pivoting using five


significant digits with chopping
Partial Pivoting: Example
Forward Elimination: Step 1
E
Examining
i i ththe values
l off th
the fifirstt column
l
|10|, |-3|, and |5| or 10, 3, and 5
The llargestt absolute
Th b l t valuel iis 10
10, which
hi h means, tto
follow the rules of Partial Pivoting, we switch
row1 with row1.

Performing Forward Elimination


 10  7 0  x1   7  10 7 0  x1   7 
 3 2.099 6  x   3.901

 5
 2   
 1 5  x3   6 
 
 0  0.001 6  x   6.001
 0 2.5
 2   
5  x3   2.5 
Partial Pivoting: Example
Forward Elimination: Step 2
Examining the values of the first column
|-0.001| and |2.5| or 0.0001 and 2.5
The largest absolute value is 2.5, so row 2 is
switched with row 3
10 7 0  x1   7 
0 2 .5 5  x2    2.5 

Performing the row swap
 0  0.001 6  x3  6.001

10 7 0  x1   7 
 0  0.001 6  x   6.001

 0 2.5
 2   
5  x3   2.5 

Partial Pivoting: Example
Forward Elimination: Step 2

Performing the Forward Elimination results in:

10  7 0   x1   7 
 0 2.5 5   x    2.5 
  2   
 0 0 6.002  x3  6.002
Partial Pivoting: Example
Back Substitution
Solving the equations through back substitution

10  7
6.002
0   x1   7  x3  1
 0 2.5 5   x    2.5  6.002
  2   
 0 0 6.002  x3  6.002 2.5  5 x3
x2   1
2.5

7  7 x 2  0 x3
x1  0
10
Partial Pivoting: Example
Compare the calculated and exact solution
The fact that they are equal is coincidence, but it
does illustrate the advantage of Partial Pivoting

 x1   0   x1   0 
X  calculated   x2    1 X  exact   x 2    1
 x3   1   x3   1 
THE END

You might also like