![Page 1: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/1.jpg)
Gaussian Elimination
Industrial Engineering Majors
Author(s): Autar Kaw
http://numericalmethods.eng.usf.edu
Transforming Numerical Methods Education for STEM Undergraduates
![Page 2: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/2.jpg)
Naïve Gauss Elimination
http://numericalmethods.eng.usf.edu
![Page 3: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/3.jpg)
Naïve Gaussian Elimination
A method to solve simultaneous linear equations of the form [A][X]=[C]
Two steps1. Forward Elimination2. Back Substitution
![Page 4: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/4.jpg)
Forward Elimination
2.279
2.177
8.106
112144
1864
1525
3
2
1
x
x
x
The goal of forward elimination is to transform the coefficient matrix into an upper triangular matrix
735.0
21.96
8.106
7.000
56.18.40
1525
3
2
1
x
x
x
![Page 5: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/5.jpg)
Forward Elimination
A set of n equations and n unknowns
11313212111 ... bxaxaxaxa nn
22323222121 ... bxaxaxaxa nn
nnnnnnn bxaxaxaxa ...332211
. . . . . .
(n-1) steps of forward elimination
![Page 6: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/6.jpg)
Forward EliminationStep 1 For Equation 2, divide Equation 1 by and multiply by .
)...( 1131321211111
21 bxaxaxaxaa
ann
111
211
11
21212
11
21121 ... b
a
axa
a
axa
a
axa nn
11a
21a
![Page 7: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/7.jpg)
Forward Elimination
111
211
11
21212
11
21121 ... b
a
axa
a
axa
a
axa nn
111
2121
11
212212
11
2122 ... b
a
abxa
a
aaxa
a
aa nnn
'2
'22
'22 ... bxaxa nn
22323222121 ... bxaxaxaxa nn Subtract the result from Equation 2.
−_________________________________________________
or
![Page 8: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/8.jpg)
Forward EliminationRepeat this procedure for the remaining equations to reduce the set of equations as
11313212111 ... bxaxaxaxa nn '2
'23
'232
'22 ... bxaxaxa nn
'3
'33
'332
'32 ... bxaxaxa nn
''3
'32
'2 ... nnnnnn bxaxaxa
. . . . . . . . .
End of Step 1
![Page 9: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/9.jpg)
Step 2Repeat the same procedure for the 3rd term of Equation 3.
Forward Elimination
11313212111 ... bxaxaxaxa nn
'2
'23
'232
'22 ... bxaxaxa nn
"3
"33
"33 ... bxaxa nn
""3
"3 ... nnnnn bxaxa
. . . . . .
End of Step 2
![Page 10: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/10.jpg)
Forward EliminationAt the end of (n-1) Forward Elimination steps, the system of equations will look like
'2
'23
'232
'22 ... bxaxaxa nn
"3
"33
"33 ... bxaxa nn
11 nnn
nnn bxa
. . . . . .
11313212111 ... bxaxaxaxa nn
End of Step (n-1)
![Page 11: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/11.jpg)
Matrix Form at End of Forward Elimination
)(n-n
"
'
n)(n
nn
"n
"
'n
''n
b
b
b
b
x
x
x
x
a
aa
aaa
aaaa
1
3
2
1
3
2
1
1
333
22322
1131211
0000
00
0
![Page 12: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/12.jpg)
Back SubstitutionSolve each equation starting from the last equation
Example of a system of 3 equations
735.0
21.96
8.106
7.000
56.18.40
1525
3
2
1
x
x
x
![Page 13: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/13.jpg)
Back Substitution Starting Eqns
'2
'23
'232
'22 ... bxaxaxa nn
"3
"3
"33 ... bxaxa nn
11 nnn
nnn bxa
. . . . . .
11313212111 ... bxaxaxaxa nn
![Page 14: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/14.jpg)
Back SubstitutionStart with the last equation because it has only one unknown
)1(
)1(
n
nn
nn
n a
bx
![Page 15: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/15.jpg)
Back Substitution
1,...,1for11
11
nia
xabx
iii
n
ijj
iij
ii
i
)1(
)1(
n
nn
nn
n a
bx
1,...,1for...
1
1,2
12,1
11,
1
nia
xaxaxabx
iii
ninii
iiii
iii
ii
i
![Page 16: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/16.jpg)
THE END
http://numericalmethods.eng.usf.edu
![Page 17: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/17.jpg)
Naïve Gauss EliminationExample
http://numericalmethods.eng.usf
.edu
![Page 18: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/18.jpg)
Example: Production Optimization
To find the number of toys a company should manufacture per day to optimally use their injection-molding machine and the assembly line, one needs to solve the following set of equations. The unknowns are the number of toys for boys, x1, number of toys for girls, x2, and the number of unisexual toys, x3.
0
1260
756
000001051
333306667016670
666701667033330
3
2
1
x
x
x
...
...
...
Find the values of x1, x2,and x3 using Naïve Gauss Elimination.
![Page 19: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/19.jpg)
Example: Production Optimization
Forward Elimination: Step 1
Yields
16670
33330
12 .
.
RowRow
0
89881
756
000001051
0001500205833200
666701667033330
3
2
1
.
x
x
x
...
..
...
![Page 20: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/20.jpg)
Example: Production Optimization
Yields
Forward Elimination: Step 1
051
33330
13 .
.
RowRow
62381
89881
756
10032525210
0001500205833200
666701667033330
3
2
1
.
.
x
x
x
..
..
...
![Page 21: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/21.jpg)
Example: Production Optimization
Yields
This is now ready for Back Substitution
Forward Elimination: Step 2
52521
583320
23 .
.
RowRow
86475
89881
756
1007200
0001500205833200
666701667033330
3
2
1
.
.
x
x
x
.
..
...
![Page 22: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/22.jpg)
Example: Production Optimization
Back Substitution: Solve for x3 using the third equation
1133610072
86475
8647510072
3
3
..
.x
.x.
![Page 23: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/23.jpg)
Example: Production Optimization
Back Substitution: Solve for x2 using the second equation 89881000150020583320 32 .x.x.
81511583320
1133600015002089881583320
00015002089881 32
..
....
x..x
![Page 24: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/24.jpg)
Example: Production Optimization
Back Substitution: Solve for x1 using the first equation
756666701667033330 321 x.x.x.
8143933330
1133666670815111667075633330
6667016670756 321
..
.....
x.x.x
![Page 25: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/25.jpg)
Example: Production Optimization
Solution:
The solution vector is
11336
81511
81439
3
2
1
.
.
.
x
x
x
1440 toys for boys should be produced
1512 toys for girls should be produced
36 unisexual toys should be produced
![Page 26: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/26.jpg)
THE END
http://numericalmethods.eng.usf.edu
![Page 27: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/27.jpg)
Naïve Gauss EliminationPitfalls
http://numericalmethods.eng.usf.edu
![Page 28: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/28.jpg)
955
11326
3710
321
321
32
xxx
xxx
xx
Pitfall#1. Division by zero
9
11
3
515
326
7100
3
2
1
x
x
x
![Page 29: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/29.jpg)
Is division by zero an issue here?
955
14356
1571012
321
321
321
xxx
xxx
xxx
9
14
15
515
356
71012
3
2
1
x
x
x
![Page 30: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/30.jpg)
Is division by zero an issue here? YES
28524
14356
1571012
321
321
321
xxx
xxx
xxx
28
14
15
5124
356
71012
3
2
1
x
x
x
2
5.6
15
192112
5.600
71012
3
2
1
x
x
x
Division by zero is a possibility at any step of forward elimination
![Page 31: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/31.jpg)
Pitfall#2. Large Round-off Errors
9
751.1
45
315
7249.23
101520
3
2
1
x
x
x
Exact Solution
1
1
1
3
2
1
x
x
x
![Page 32: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/32.jpg)
Pitfall#2. Large Round-off Errors
9
751.1
45
315
7249.23
101520
3
2
1
x
x
x
Solve it on a computer using 6 significant digits with chopping
999995.0
05.1
9625.0
3
2
1
x
x
x
![Page 33: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/33.jpg)
Pitfall#2. Large Round-off Errors
9
751.1
45
315
7249.23
101520
3
2
1
x
x
x
Solve it on a computer using 5 significant digits with chopping
99995.0
5.1
625.0
3
2
1
x
x
x
Is there a way to reduce the round off error?
![Page 34: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/34.jpg)
Avoiding Pitfalls
Increase the number of significant digits• Decreases round-off error
• Does not avoid division by zero
![Page 35: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/35.jpg)
Avoiding Pitfalls
Gaussian Elimination with Partial Pivoting
• Avoids division by zero
• Reduces round off error
![Page 36: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/36.jpg)
THE END
http://numericalmethods.eng.usf.edu
![Page 37: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/37.jpg)
Gauss Elimination with Partial Pivoting
http://numericalmethods.eng.usf
.edu
![Page 38: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/38.jpg)
Pitfalls of Naïve Gauss Elimination
• Possible division by zero• Large round-off errors
![Page 39: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/39.jpg)
Avoiding Pitfalls
Increase the number of significant digits• Decreases round-off error
• Does not avoid division by zero
![Page 40: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/40.jpg)
Avoiding Pitfalls
Gaussian Elimination with Partial Pivoting
• Avoids division by zero
• Reduces round off error
![Page 41: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/41.jpg)
What is Different About Partial Pivoting?
pka
At the beginning of the kth step of forward elimination, find the maximum of
nkkkkk aaa .......,,........., ,1
If the maximum of the values is in the p th row, ,npk then switch rows p
and k.
![Page 42: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/42.jpg)
Matrix Form at Beginning of 2nd Step of Forward Elimination
'
'3
2
1
3
2
1
''4
'32
'3
'3332
22322
1131211
0
0
0
n
'
nnnnn'n
n'
'n
''n
b
b
b
b
x
x
x
x
aaaa
aaa
aaa
aaaa
![Page 43: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/43.jpg)
Example (2nd step of FE)
3
9
8
6
5
431112170
862390
1111240
21670
67.31.5146
5
4
3
2
1
x
x
x
x
x
Which two rows would you switch?
![Page 44: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/44.jpg)
Example (2nd step of FE)
6
9
8
3
5
21670
862390
1111240
431112170
67.31.5146
5
4
3
2
1
x
x
x
x
x
Switched Rows
![Page 45: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/45.jpg)
Gaussian Elimination with Partial Pivoting
A method to solve simultaneous linear equations of the form [A][X]=[C]
Two steps1. Forward Elimination2. Back Substitution
![Page 46: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/46.jpg)
Forward Elimination
Same as naïve Gauss elimination method except that we switch rows before each of the (n-1) steps of forward elimination.
![Page 47: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/47.jpg)
Example: Matrix Form at Beginning of 2nd Step of
Forward Elimination
'
'3
2
1
3
2
1
''4
'32
'3
'3332
22322
1131211
0
0
0
n
'
nnnnn'n
n'
'n
''n
b
b
b
b
x
x
x
x
aaaa
aaa
aaa
aaaa
![Page 48: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/48.jpg)
Matrix Form at End of Forward Elimination
)(n-n
"
'
n)(n
nn
"n
"
'n
''n
b
b
b
b
x
x
x
x
a
aa
aaa
aaaa
1
3
2
1
3
2
1
1
333
22322
1131211
0000
00
0
![Page 49: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/49.jpg)
Back Substitution Starting Eqns
'2
'23
'232
'22 ... bxaxaxa nn
"3
"3
"33 ... bxaxa nn
11 nnn
nnn bxa
. . . . . .
11313212111 ... bxaxaxaxa nn
![Page 50: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/50.jpg)
Back Substitution
1,...,1for11
11
nia
xabx
iii
n
ijj
iij
ii
i
)1(
)1(
n
nn
nn
n a
bx
![Page 51: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/51.jpg)
THE END
http://numericalmethods.eng.usf.edu
![Page 52: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/52.jpg)
Gauss Elimination with Partial Pivoting
Example
http://numericalmethods.eng.usf
.edu
![Page 53: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/53.jpg)
Example 2
2279
2177
8106
112144
1864
1525
3
2
1
.
.
.
a
a
a
Solve the following set of equations by Gaussian elimination with partial pivoting
![Page 54: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/54.jpg)
Example 2 Cont.
2279
2177
8106
112144
1864
1525
3
2
1
.
.
.
a
a
a
1. Forward Elimination2. Back Substitution
2.279112144
2.1771864
8.1061525
![Page 55: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/55.jpg)
Forward Elimination
![Page 56: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/56.jpg)
Number of Steps of Forward Elimination
Number of steps of forward elimination is (n1)=(31)=2
![Page 57: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/57.jpg)
Forward Elimination: Step 1• Examine absolute values of first column, first row
and below.
144,64,25
• Largest absolute value is 144 and exists in row 3.• Switch row 1 and row 3.
8.1061525
2.1771864
2.279112144
2.279112144
2.1771864
8.1061525
![Page 58: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/58.jpg)
Forward Elimination: Step 1 (cont.)
.
1.1244444.0333.599.634444.02.279112144
8.1061525
2.1771864
2.279112144
10.53.55560667.2 0
124.1 0.44445.33363.99
177.21 8 64
8.1061525
10.535556.0667.20
2.279112144
Divide Equation 1 by 144 and
multiply it by 64, .
4444.0144
64
Subtract the result from Equation 2
Substitute new equation for Equation 2
![Page 59: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/59.jpg)
Forward Elimination: Step 1 (cont.)
.
47.481736.0083.200.251736.0279.2112144
33.588264.0 917.20
48.470.17362.08325
106.81 5 25
8.1061525
10.535556.0667.20
2.279112144
33.588264.0917.20
10.535556.0667.20
2.279112144
Divide Equation 1 by 144 and
multiply it by 25, .
1736.0144
25
Subtract the result from Equation 3
Substitute new equation for Equation 3
![Page 60: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/60.jpg)
Forward Elimination: Step 2• Examine absolute values of second column, second row
and below.
2.917,667.2
• Largest absolute value is 2.917 and exists in row 3.• Switch row 2 and row 3.
10.535556.0667.20
33.588264.0917.20
2.279112144
33.588264.0917.20
10.535556.0667.20
2.279112144
![Page 61: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/61.jpg)
Forward Elimination: Step 2 (cont.)
.
33.537556.0667.209143.058.330.82642.9170
10.535556.0667.20
33.588264.0917.20
2.279112144
23.02.0 0 0
53.33 0.75562.6670
53.10 0.55562.6670
23.02.000
33.588264.0917.20
2.279112144
Divide Equation 2 by 2.917 andmultiply it by 2.667,
.9143.0917.2
667.2
Subtract the result from Equation 3
Substitute new equation for Equation 3
![Page 62: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/62.jpg)
Back Substitution
![Page 63: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/63.jpg)
Back Substitution
1.152.0
23.0
23.02.0
3
3
a
a
Solving for a3
230
3358
2279
2000
8264091720
112144
23.02.000
33.588264.0917.20
2.279112144
3
2
1
.
.
.
a
a
a
.
..
![Page 64: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/64.jpg)
Back Substitution (cont.)
Solving for a2
6719.917.2
15.18264.033.58917.2
8264.033.58
33.588264.0917.2
32
32
a
a
aa
230
3358
2279
2000
8264091720
112144
3
2
1
.
.
.
a
a
a
.
..
![Page 65: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/65.jpg)
Back Substitution (cont.)
Solving for a1
2917.0144
15.167.19122.279144
122.279
2.27912144
321
321
aa
a
aaa
230
3358
2279
2000
8264091720
112144
3
2
1
.
.
.
a
a
a
.
..
![Page 66: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/66.jpg)
Gaussian Elimination with Partial Pivoting Solution
2279
2177
8106
112144
1864
1525
3
2
1
.
.
.
a
a
a
15.1
67.19
2917.0
3
2
1
a
a
a
![Page 67: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/67.jpg)
Gauss Elimination with Partial Pivoting
Another Example
http://numericalmethods.eng.usf
.edu
![Page 68: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/68.jpg)
Partial Pivoting: ExampleConsider the system of equations
655
901.36099.23
7710
321
321
21
xxx
xxx
xx
In matrix form
515
6099.23
0710
3
2
1
x
x
x
6
901.3
7
=
Solve using Gaussian Elimination with Partial Pivoting using five significant digits with chopping
![Page 69: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/69.jpg)
Partial Pivoting: ExampleForward Elimination: Step 1
Examining the values of the first column
|10|, |-3|, and |5| or 10, 3, and 5
The largest absolute value is 10, which means, to follow the rules of Partial Pivoting, we switch row1 with row1.
6
901.3
7
515
6099.23
0710
3
2
1
x
x
x
5.2
001.6
7
55.20
6001.00
0710
3
2
1
x
x
x
Performing Forward Elimination
![Page 70: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/70.jpg)
Partial Pivoting: ExampleForward 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
5.2
001.6
7
55.20
6001.00
0710
3
2
1
x
x
x
001.6
5.2
7
6001.00
55.20
0710
3
2
1
x
x
x
Performing the row swap
![Page 71: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/71.jpg)
Partial Pivoting: Example
Forward Elimination: Step 2
Performing the Forward Elimination results in:
002.6
5.2
7
002.600
55.20
0710
3
2
1
x
x
x
![Page 72: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/72.jpg)
Partial Pivoting: ExampleBack Substitution
Solving the equations through back substitution
1002.6
002.63 x
15.2
55.2 32
xx
010
077 321
xxx
002.6
5.2
7
002.600
55.20
0710
3
2
1
x
x
x
![Page 73: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/73.jpg)
Partial Pivoting: Example
1
1
0
3
2
1
x
x
x
X exact
1
1
0
3
2
1
x
x
x
X calculated
Compare the calculated and exact solution
The fact that they are equal is coincidence, but it does illustrate the advantage of Partial Pivoting
![Page 74: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/74.jpg)
THE END
http://numericalmethods.eng.usf.edu
![Page 75: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/75.jpg)
Determinant of a Square Matrix
Using Naïve Gauss EliminationExample
http://numericalmethods.eng.usf.edu
![Page 76: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/76.jpg)
Theorem of Determinants
If a multiple of one row of [A]nxn is added or
subtracted to another row of [A]nxn to result
in [B]nxn then det(A)=det(B)
![Page 77: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/77.jpg)
Theorem of Determinants
The determinant of an upper triangular matrix [A]nxn is given by
nnii aaaa ......Adet 2211
n
iiia
1
![Page 78: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/78.jpg)
Forward Elimination of a Square Matrix
Using forward elimination to transform [A]nxn to an upper triangular
matrix, [U]nxn.
nnnn UA
UA detdet
![Page 79: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/79.jpg)
Example
112144
1864
1525
Using naïve Gaussian elimination find the determinant of the following square matrix.
![Page 80: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/80.jpg)
Forward Elimination
![Page 81: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/81.jpg)
Forward Elimination: Step 1
.
56.28.126456.21525 56.18.40
56.2 8.1264
1 8 64
112144
1864
1525
112144
56.18.40
1525
Divide Equation 1 by 25 and
multiply it by 64, .
56.225
64
Subtract the result from Equation 2
Substitute new equation for Equation 2
![Page 82: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/82.jpg)
Forward Elimination: Step 1 (cont.)
.
76.58.2814476.51525 76.48.16 0
76.5 8.28144
1 12 144
76.48.160
56.18.40
1525
112144
56.18.40
1525
Divide Equation 1 by 25 and
multiply it by 144, .
76.525
144
Subtract the result from Equation 3
Substitute new equation for Equation 3
![Page 83: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/83.jpg)
Forward Elimination: Step 2
.
76.48.160
56.18.40
1525
46.58.1605.356.18.40
7.0 0 0
46.58.160
76.48.160
7.000
56.18.40
1525
Divide Equation 2 by −4.8
and multiply it by −16.8,
.
5.38.4
8.16
Subtract the result from Equation 3
Substitute new equation for Equation 3
![Page 84: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/84.jpg)
Finding the Determinant
.
7.000
56.18.40
1525
112144
1864
1525
After forward elimination
00.84
7.08.425
Adet 332211
uuu
![Page 85: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/85.jpg)
Summary
-Forward Elimination
-Back Substitution
-Pitfalls
-Improvements
-Partial Pivoting
-Determinant of a Matrix
![Page 86: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/86.jpg)
Additional Resources
For all resources on this topic such as digital audiovisual lectures, primers, textbook chapters, multiple-choice tests, worksheets in MATLAB, MATHEMATICA, MathCad and MAPLE, blogs, related physical problems, please visit http://numericalmethods.eng.usf.edu/topics/gaussian_elimination.html
![Page 87: Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for](https://reader036.vdocuments.site/reader036/viewer/2022062805/5697c0251a28abf838cd5439/html5/thumbnails/87.jpg)
THE END
http://numericalmethods.eng.usf.edu