Unit-5 Sim Equation
Unit-5 Sim Equation
Unit: 5
Solution of simultaneous equation
Syllabus Content
A. Solution of linear simultaneous equation:
Direct methods - Gauss elimination method, concept of pivoting – partial and
complete. Gauss Jordan method.
Iterative methods – Jacobi method and Gauss Seidel method.
B. Matrix Inversion using Gauss Jordan method
The two straight lines represent the equations 2y + x= 8 and y + 1 = 2x. This means, for
example, that for any point on the line 2y + x= 8 , 2 times the value of y plus the value of x
gives 8; similarly for y + 1 = 2x.
There is only one point that fits both equations. This is the point (2, 3) where the two
straight lines cut. So x = 2 and y = 3 are the solutions to the simultaneous equations Zv +
x = 8 and y + 1 = 2x.
Concept of pivoting
The pivot or pivot element is the element of a matrix, which is selected, to do
certain calculations, in this case finding this element is called pivoting. Pivoting
may be followed by an interchange of rows or columns to bring the pivot to a fixed
position and allow the algorithm to proceed successfully.
Pivot position
Partial Pivoting:
In partial pivoting is to select the row with the largest absolute value in the current
column as the pivot row. This helps prevent dividing by very small numbers (which
could lead to numerical instability) and ensures that the largest value in each column is
used as the pivot.
Identify the largest absolute value in the current column below the current row.
Swap the current row with the row containing the largest absolute value. This is the
pivot row.
Continue with the above process.
Complete Pivoting:
Complete pivoting takes the concept of partial pivoting further by not only considering
rows for pivoting but also considering columns. In each step, you find the largest
absolute value in both the current row and the current column. This ensures that the
largest value in the entire remaining sub matrix is chosen as the pivot element.
Search for the largest absolute value in the entire remaining sub matrix (including
rows and columns) starting from the current row and column.
Swap both the row and the column containing the largest absolute value with the
current row and column, respectively. This is the pivot element.
Continue with the Gaussian elimination process.
The process of row reduction makes use of elementary row operations, and can be
divided into two parts. The first part called forward elimination, reduces a given
system to row echelon form by using partial pivoting.
Form the augmented matrix [A : B] from the given system of linear equations in n
variables.
𝑎11 𝑎12 𝑎13 𝑏1
𝑎21 𝑎22 𝑎23 𝑏2
𝑎31 𝑎32 𝑎33 𝑏3
The second part called back substitution continues to use row operations until the
solution is found; in other words, it puts the matrix into reduced row echelon form
A’X = B’ to find the solution of the given system of linear equations.
Writing matrix A : B
1 1 1 2
1 2 5 5
2 3 5 10
R2 − R1
1 1 1 2
0 1 4 3
2 3 5 10
R3 − 2R1
1 1 1 2
0 1 4 3
0 1 3 6
R 3 − R2
1 1 1 2
0 1 4 3
0 0 −1 6
x = − 10 y = 15 z=−3
R1 ↔ R2 2 R 3 + R2
1 −3 1 8 1 −3 1 8
3 1 −2 0 0 10 −5 − 24
−2 1 −1 8 0 0 −3 24
R2 − 3R1 ̶ 1/3 R 3
1 −3 1 8 1 −3 1 8
0 10 −5 − 24 0 10 −5 − 24
−2 1 −1 8 0 0 −1 8
1 −3 1 8
0 10 − 5 − 24
0 0 − 1 8
Z= −8 10 y − 5 z = − 24 x − 3y+z=8
10 y − (5 × − 8) = − 24 x − (3 × − 6.4) − 8 = 8
y = − 6.4 x = − 3.2
The process of row reduction makes use of elementary row operations. Reduces a
given system to row echelon form by using complete pivoting.
Form the augmented matrix [A : B] from the given system of linear equations in n
variables.
𝑎11 𝑎12 𝑎13 𝑏1
𝑎21 𝑎22 𝑎23 𝑏2
𝑎31 𝑎32 𝑎33 𝑏3
1 0 0 𝐵1
0 1 0 𝐵2
0 0 1 𝐵3
The back substitution continues to use row operations until the solution is found; in
other words, it puts the matrix into reduced row echelon form A’X = B’ to find the
solution of the given system of linear equations.
x B1
y B2
z B3
R2 − 2R1 5/12 R 3
1 1 1 9 1 1 1 9
0 −5 2 −5 0 1 − 2/5 1
3 4 5 40 0 0 1 5
R3 − 3R1 R 2 + 2/5 R 3
1 1 1 9 1 1 1 9
0 −5 2 −5 0 1 0 3
0 1 2 13 0 0 1 5
R 2 + 2/5 R 3 R1 − R3
1 1 1 9 1 1 1 4
0 −5 2 −5 0 1 0 3
0 1 2 13 0 0 1 5
− 1/5 R 2 R1 − R2
1 1 1 9 1 0 0 1
0 1 − 2/5 1 0 1 0 3
0 1 2 13 0 0 1 5
Step-1: The coefficient matrix must have non zeros on its main diagonal. If the matrix A
is strictly diagonally dominant, must be satisfy the following conditions,
If any of the diagonal entries are zero, then rows or columns must be interchanged to
obtain a coefficient matrix that has all nonzero entries on the main diagonal.
Step-2: Then convert the linear simultaneous equations into iterative equations as
follows.
𝑏1 − 𝑎12 𝑦 − 𝑎13 𝑧
𝑥=
𝑎11
𝑏2 − 𝑎21 𝑥 − 𝑎13 𝑧
𝑦=
𝑎22
𝑏3 − 𝑎31 𝑥 − 𝑎32 𝑦
𝑧=
𝑎33
Example 1:
Using Jacobi iterative method solves the following linear simultaneous equations.
Take x(0) = y(0) = z(0) = 0. Perform 5 iteration.
27x 6 y z 85
6 x 15 y 2 z 72
x y 54z 110
Solution:
To begin the Jacobi method, convert each equation to iterative equation for one of the
unknowns, as follows.
x
1
85 6 y z y
1
72 2 z 6 x z
1
110 x y
27 15 54
Iteration 1:
Now, from given, x0 = y0 = z0 = 0
x1
1
85 6 y0 z 0 x1
1
85 6(0) 0 85 3.148
27 27 27
y1
1
72 2 z0 6 x0 y1
1
72 2(0) 6(0) 72 4.8
15 15 15
z1
1
110 x0 y0 z1
1
110 (0) (0) 110 2.037
54 54 54
Iteration 2:
From iteration 1, we got, x1 = 3.148 y1 = 4.8 z1 = 2.037
x2
1
85 6 y1 z1 x2
1
85 6(4.8) 2.037 2.157
27 27
y2
1
72 2 z1 6 x1 y2
1
72 2(2.037) 6(3.148) 3.269
15 15
z2
1
110 x1 y1 z2
1
110 (3.148) (4.8) 1.890
54 54
Iteration 3:
From iteration 2, we got, x2 = 2.157 y2 = 3.269 z2 = 1.890
x3
1
85 6 y 2 z 2 x3
1
85 6(3.269) 1.890 2.492
27 27
y3
1
72 2 z 2 6 x2 y3
1
72 2(1.890) 6(2.157) 3.685
15 15
z3
1
110 x2 y2 z3
1
110 (2.157) (3.269) 1.936
54 54
Iteration 4:
From iteration 3, we got, x3 = 2.492 y3 = 3.685 z3 = 1.936
x4
1
85 6 y3 z3 x4
1
85 6(3.685) 1.936 2.40
27 27
y4
1
72 2 z3 6 x3 y4
1
72 2(1.936) 6(2.492) 3.545
15 15
z4
1
110 x3 y3 z4
1
110 (2.492) (3.685) 1.923
54 54
Iteration 5:
From iteration 4, we got, x4 = 2.40 y4 = 3.545 z4 = 1.923
x5
1
85 6 y 4 z 4 x5
1
85 6(3.545) 1.923 2.431
27 27
y5
1
72 2 z 4 6 x4 y5
1
72 2(1.923) 6(2.40) 3.583
15 15
z5
1
110 x4 y 4 z5
1
110 (2.40) (3.583) 1.927
54 54
Example 2:
Using Jacobi iterative method solves the following linear simultaneous equations.
Take x(0) = y(0) = z(0) = 0. Perform 5 iteration.
15x 4 y z 17
3 x 15 y 6 z 18
2 x 3 y 15z 25
To begin the Jacobi method, convert each equation to iterative equation for one of the unknowns,
as follows.
x
1
17 4 y z y
1
18 3x 6 z z
1
25 2 x 3 y
15 15 15
Iteration 1:
Now, from given, x0 = y0 = z0 = 0
x1
1
17 4 y 0 z 0 x1
1
17 4 0 0 1.1333
15 15
y1
1
18 3x0 6 z 0 y1
1
18 3 0 6 0 1.2
15 15
z1
1
25 2 x0 3 y0 z1
1
25 2 0 3 0 1.6667
15 15
Iteration 2:
From iteration 1, we got, x1 = 1.1333 y1 = ̶ 1.2 z1 = 1.6667
x2
1
17 4 y1 z1 x2
1
17 4 (1.2) 1.6667 1.5644
15 15
y2
1
18 3x1 6 z1 y2
1
18 3 1.1333 6 1.6667 0.76
15 15
z2
1
25 2 x1 3 y1 z2
1
25 2 1.1333 3 (1.2) 1.2756
15 15
Iteration 3:
From iteration 2, we got, x2 = 1.5644 y2 = ̶ 0.76 z2 = 1.2756
x3
1
17 4 y 2 z 2 x3
1
17 4 (0.76) 1.2756 1.421
15 15
y3
1
18 3x2 6 z 2 y3
1
18 3 1.5644 6 1.2756 1.0027
15 15
z3
1
25 2 x2 3 y2 z3
1
25 2 1.5644 3 (0.76) 1.3061
15 15
Iteration 4:
From iteration 3, we got, x3 = 1.421 y3 = ̶ 1.0027 z3 = 1.3061
x4
1
17 4 y3 z 3 x4
1
17 4 (1.0027) 1.3061 1.4878
15 15
y4
1
18 3x3 6 z 3 y4
1
18 3 1.421 6 1.3061 0.9618
15 15
z4
1
25 2 x3 3 y3 z4
1
25 2 1.421 3 (1.0027) 1.2767
15 15
Iteration 5:
From iteration 4, we got, x3 = 1.4878 y3 = ̶ 0.9618 z3 = 1.2767
x4
1
17 4 y3 z 3 x4
1
17 4 (0.9618) 1.2767 1.4749
15 15
y4
1
18 3x3 6 z 3 y4
1
18 3 1.4878 6 1.2767 0.9869
15 15
z4
1
25 2 x3 3 y3 z4
1
25 2 1.4878 3 (0.9618) 1.2759
15 15
Step-1: The coefficient matrix must have non zeros on its main diagonal. If the matrix A
is strictly diagonally dominant must be satisfy the following conditions,
If any of the diagonal entries are zero, then rows or columns must be interchanged to
obtain a coefficient matrix that has all nonzero entries on the main diagonal.
Step-2: Then convert the linear simultaneous equations into iterative equations as
follows.
𝑏1 − 𝑎12 𝑦 − 𝑎13 𝑧
𝑥=
𝑎11
𝑏2 − 𝑎21 𝑥 − 𝑎13 𝑧
𝑦=
𝑎22
𝑏3 − 𝑎31 𝑥 − 𝑎32 𝑦
𝑧=
𝑎33
Example 1:
Using Gauss-Seidel method solves the following linear simultaneous equations.
Perform 4 iteration.
8x 2 y 2 z 8
x 8 y 3z 4
2 x y 9 z 12
To begin the Jacobi method, each equation is solved for one of the unknowns, as follows.
x
1
8 2 y 2 z y
1
4 x 3z z
1
12 2 x y
8 8 9
Iteration 1:
Now, consider y0 = z0 = 0
x1
1
8 2 y0 2 z0 x1
1
8 2(0) 2(0) 1
8 8
Now, x1 = 1 and z0 = 0
y1
1
4 x1 3z 0 y1
1
4 (1) 3(0) 0.625
8 8
z1
1
12 2 x1 y1 z1
1
12 2(1) (0.625) 1.042
9 9
Iteration 2:
From Iteration 1 calculation, y1 = 0.625 and z1 = 1.042
x2
1
8 2 y1 2 z1 x2
1
8 2(0.625) 2(1.042) 1.104
8 8
y2
1
4 x2 3z1 y2
1
4 (1.104) 3(1.042) 1.029
8 8
z2
1
12 2 x2 y2 z2
1
12 2(1.104) (1.029) 0.974
9 9
Iteration 3:
From Iteration 2 calculation, y2 = 1.029 and z2 = 0.974
x3
1
8 2 y2 2 z 2 x3
1
8 2(1.029) 2(0.974) 0.986
8 8
y3
1
4 x3 3z 2 y3
1
4 (0.986) 3(0.974) 0.989
8 8
z3
1
12 2 x3 y3 z3
1
12 2(0.986) (0.989) 1.004
9 9
Iteration 4:
From Iteration 2 calculation, y3 = 0.989 and z3 = 1.004
x4
1
8 2 y3 2 z3 x4
1
8 2(0.989) 2(1.004) 1.004
8 8
y4
1
4 x4 3z3 y4
1
4 (0.989) 3(1.004) 1.002
8 8
z4
1
12 2 x4 y4 z4
1
12 2(1.004) (1.002) 0.999
9 9
The process of row reduction makes use of elementary row operations. Reduces a
given system to row echelon form by using complete pivoting.
Form the augmented matrix [ A : I ] from the given system of linear equations in n
variables.
𝑎11 𝑎12 𝑎13 1 0 0
𝑎21 𝑎22 𝑎23 0 1 0
𝑎31 𝑎32 𝑎33 0 0 1
Perform row operations until the solution is found; in other words, it puts the matrix
into reduced row echelon form I A-1 to find the solution of the given system of linear
equations.
𝐴11 𝐴12 𝐴13
A-1 = 𝐴21 𝐴22 𝐴23
𝐴31 𝐴32 𝐴33
Solution:
A|I 1/2 R 3 & 1/3 R 3
1 1 1 1 0 0 1 1 1 1 0 0
3 5 2 0 1 0 0 1 − 1/2 −3/2 1/2 0
2 1 4 0 0 1 0 0 1 − 7/3 1/3 2/3
R2 − 3R1 R 2 + 1/2 R 3
1 1 1 1 0 0 1 1 1 1 0 0
0 2 −1 −3 1 0 0 1 0 − 8/3 2/3 1/3
2 1 4 0 0 1 0 0 1 − 7/3 1/3 2/3
R2 − 2R1 R1 −R3
1 1 1 1 0 0 1 1 0 10/3 − 1/3 − 2/3
0 2 −1 −3 1 0 0 1 0 − 8/3 2/3 1/3
0 −1 2 −2 0 1 0 0 1 − 7/3 1/3 2/3
18 −3 −3
1
A-1 = −8 2 1
3
−7 1 2