Professional Documents
Culture Documents
Gaussian Elimination Solution of Simultaneous Equation
Gaussian Elimination Solution of Simultaneous Equation
Gaussian Elimination Solution of Simultaneous Equation
Gaussian Elimination
Prepared by:
Engr. Demy F. Gabriel (PECE, MSME)
Tesseract 4-dimensional cube
NUMERICAL METHODS
Gaussian Elimination
Introduction
A linear equation can involve more than two variables. The general linear
equation in n variables is:
In this form, a1, a2, …, an are the coefficients, x1, x2, …, xn are the variables,
and b is the constant. When dealing with three or fewer variables, it is
common to replace x1 with just x, x2 with y, and x3 with z, as appropriate.
NUMERICAL METHODS
Gaussian Elimination
Introduction
Elementary row operations are used to reduce a matrix to row echelon form. Gauss–
Jordan elimination, an extension of this algorithm, reduces the matrix further to
reduced row echelon form. Gaussian elimination alone is sufficient for many
applications, and is cheaper than the -Jordan version.
One of the most popular techniques for solving simultaneous linear equations of the
form
A X C
Consists of 2 steps:
2. Use elementary row operations on the augmented matrix [A|b] to transform A into
upper triangular form.
If a zero is located on the diagonal, switch the rows until a nonzero is in that
place.
If you are unable to do so, stop; the system has either infinite or no solutions.
Solve for the values of a, b, c, d and e from the five equation below.
3a + 9b - 6c - 15d + 9e = -6 eq. 1
2a + 3b - 4c - 6d - 3e = 7 eq. 2
3a + 4b + 5c + 3d - 6e = 34 eq. 3
5a - 2b - 5c + 3d + 2e = - 14 eq. 4
-6a + 3b + 2c + 7d + 4e = - 18 eq. 5
3 9 -6 -15 9 -6
2 3 -4 -6 -3 7
3 4 5 3 -6 34
5 -2 -5 3 2 -14
-6 3 2 7 4 -18
NUMERICAL METHODS
Gaussian Elimination
3 9 -6 -15 9 -6
2 3 -4 -6 -3 7
3 4 5 3 -6 34
5 -2 -5 3 2 -14
-6 3 2 7 4 -18
a b c d e eq
3 9 -6 -15 9 -6 1
2 3 -4 -6 -3 7 2
3 4 5 3 -6 34 3
5 -2 -5 3 2 -14 4
-6 3 2 7 4 -18 5
NUMERICAL METHODS
Gaussian Elimination
Original Equation (From This)
a b c d e eq
3 9 -6 -15 9 -6 1
2 3 -4 -6 -3 7 2
3 4 5 3 -6 34 3
5 -2 -5 3 2 -14 4
-6 3 2 7 4 -18 5
Convert it
Final/Forward Elimination (To This)
a b c d e eq
1
0 2
0 0 3
0 0 0 4
0 0 0 0 5
Step 2: Re-arrange the matrix to appear 0 in the required.
a b c d e eq
3 9 -6 -15 9 -6 1 Start here
2 3 -4 -6 -3 7 2 Pivot equation = eq1
Target equation = eq2
3 4 5 3 -6 34 3 Pivot element (PE) = 3
5 -2 -5 3 2 -14 4 Target element (TE) = 2
-6 3 2 7 4 -18 5
New value of eq2:
eq1*(TE/PE) – eq2
Make this 0 eq1*(2/3) – eq2
a b c d e eq
Since this is already 0,
3 9 -6 -15 9 -6 1
swap it with any equation
0 3 0 -4 9 -11 2 that needs this column to
3 4 5 3 -6 34 3 be 0
5 -2 -5 3 2 -14 4
-6 3 2 7 4 -18 5
a b c d e eq
3 9 -6 -15 9 -6 1
0 3 0 -4 9 -11 2 Swap this equation with
eq 4 or eq 5
3 4 5 3 -6 34 3
5 -2 -5 3 2 -14 4
-6 3 2 7 4 -18 5
a b c d e eq
3 9 -6 -15 9 -6 1
-6 3 2 7 4 -18 5 Rename equation 5 and 2
3 4 5 3 -6 34 3
5 -2 -5 3 2 -14 4
0 3 0 -4 9 -11 2
Step 5: Make the target element 0.
a b c d e eq
3 9 -6 -15 9 -6 1 Start here
-6 3 2 7 4 -18 2 Pivot equation = eq1
Target equation = eq2
3 4 5 3 -6 34 3 Pivot element (PE) = 3
5 -2 -5 3 2 -14 4 Target element (TE) = -6
0 3 0 -4 9 -11 5
New value of eq2:
eq1*(TE/PE) – eq2
eq1*(-6/3) – eq2
Make this 0
a b c d e eq
3 9 -6 -15 9 -6 1
0 -21 10 23 -22 30 2
0 0 8.619 12.52 -9.76 32.86 3
0 0 0 -13.9 -1.3 16.49 4
0 0 -1.429 0.714 -5.86 6.714 5
Step 19: Make the target element of column 3 equal to 0.
a b c d e eq
3 9 -6 -15 9 -6 1
0 -21 10 23 -22 30 2
0 0 8.619 12.52 -9.76 32.86 3 Start here
Pivot equation = eq3
0 0 0 -13.9 -1.3 16.49 4
Target equation = eq5
0 0 -1.429 0.714 -5.86 6.714 5 Pivot element (PE) = 8.619.
Target element (TE) = -1.42
a b c d e eq
3 9 -6 -15 9 -6 1
0 -21 10 23 -22 30 2
0 0 8.619 12.52 -9.76 32.86 3
0 0 0 -13.9 -1.3 16.49 4
0 0 0 -2.79 7.475 -12.2 5
Step 21: Make the target element of column 4 equal to 0.
a b c d e eq
3 9 -6 -15 9 -6 1
0 -21 10 23 -22 30 2
0 0 8.619 12.52 -9.76 32.86 3
0 0 0 -13.9 -1.3 16.49 4 Start here
Pivot equation = eq4
0 0 0 -2.79 7.475 -12.2 5
Target equation = eq5
Pivot element (PE) = -13.9..
Target element (TE) = -2.79
Make this 0
New value of eq5:
Step 22: Solve for the new values of equation 5 eq4*(TE/PE) – eq5
a b c d e eq eq3*(-13.9/-2.79) – eq5
3 9 -6 -15 9 -6 1
0 -21 10 23 -22 30 2
0 0 8.619 12.52 -9.76 32.86 3
0 0 0 -13.9 -1.3 16.49 4
0 0 0 0 -7.74 15.47 5
Step 21: Make the target element of column 4 equal to 0.
a b c d e eq
3 9 -6 -15 9 -6 1
0 -21 10 23 -22 30 2
0 0 8.619 12.52 -9.76 32.86 3
0 0 0 -13.9 -1.3 16.49 4
0 0 0 0 -7.74 15.47 5 Start solving the variable
here
– 7.74e = 15.47
e=–2
a b c d e eq
3 9 -6 -15 9 -6 1
0 -21 10 23 -22 30 2
0 0 8.619 12.52 -9.76 32.86 3
0 0 0 -13.9 -1.3 16.49 4
0 0 0 0 -7.74 15.47 5
Substitute e = – 2 in equation 4
d=–1
c=3
a b c d e eq
3 9 -6 -15 9 -6 1
0 -21 10 23 -22 30 2
0 0 8.619 12.52 -9.76 32.86 3
0 0 0 -13.9 -1.3 16.49 4
0 0 0 0 -7.74 15.47 5
b=1
a=2
Step 27: Summarize the answer:
a=2
b=1
c=3
d = -1
e = -2
NUMERICAL METHODS
Gaussian Elimination
Problem no. 2:
Solve for the values of a, b, c, d and e from the five equation below.
3b +2d - 8e = 10 eq. 1
4a + d + 2e = 9 eq. 2
-2c + 6d – 4e = 21 eq. 3
-2a + 6c + 2e = -9 eq. 4
a - 3b + 4c - 8d + 2e = - 27 eq. 5
0 3 0 2 -8 10
4 0 0 1 2 9
0 0 -2 6 -4 21
-2 0 6 0 2 -9
1 -3 4 -8 2 -27
NUMERICAL METHODS
Gaussian Elimination
0 3 0 2 -8 10
4 0 0 1 2 9
0 0 -2 6 -4 21
-2 0 6 0 2 -9
1 -3 4 -8 2 -27
a b c d e eq
0 3 0 2 -8 10 1
4 0 0 1 2 9 2
0 0 -2 6 -4 21 3
-2 0 6 0 2 -9 4
1 -3 4 -8 2 -27 5
NUMERICAL METHODS
Gaussian Elimination
a b c d e eq
0 3 0 2 -8 10 1
4 0 0 1 2 9 2
0 0 -2 6 -4 21 3
-2 0 6 0 2 -9 4
1 -3 4 -8 2 -27 5
A b c d e eq
1 -3 4 -8 2 -27 5
0 3 0 2 -8 10 1
0 0 -2 6 -4 21 3
4 0 0 1 2 9 2
-2 0 6 0 2 -9 4
NUMERICAL METHODS
Gaussian Elimination
A b c d e eq
1 -3 4 -8 2 -27 5
0 3 0 2 -8 10 1
0 0 -2 6 -4 21 3
4 0 0 1 2 9 2
-2 0 6 0 2 -9 4
A b c d e eq
1 -3 4 -8 2 -27 1
0 3 0 2 -8 10 2
0 0 -2 6 -4 21 3
4 0 0 1 2 9 4
-2 0 6 0 2 -9 5
NUMERICAL METHODS
Gaussian Elimination
A b c d e eq
1 -3 4 -8 2 -27 1
0 3 0 2 -8 10 2
0 0 -2 6 -4 21 3
4 0 0 1 2 9 4
-2 0 6 0 2 -9 5