0% found this document useful (0 votes)
4 views19 pages

Unit-5 Sim Equation

The document outlines methods for solving simultaneous linear equations, including direct methods like Gauss elimination and Gauss Jordan, as well as iterative methods such as the Jacobi and Gauss Seidel methods. It explains the concepts of pivoting, including partial and complete pivoting, and provides detailed steps for performing these methods, including examples. Additionally, it discusses the notation for row operations and the process of back substitution to find solutions to the equations.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views19 pages

Unit-5 Sim Equation

The document outlines methods for solving simultaneous linear equations, including direct methods like Gauss elimination and Gauss Jordan, as well as iterative methods such as the Jacobi and Gauss Seidel methods. It explains the concepts of pivoting, including partial and complete pivoting, and provides detailed steps for performing these methods, including examples. Additionally, it discusses the notation for row operations and the process of back substitution to find solutions to the equations.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Solution of Simultaneous 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

5.1 Solution of simultaneous Equation


The graphs of 2y + x = 8 and y + 1 = 2x are straight lines, they are called linear equations.

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.

Numerical Methods & Computer Programming Page 1


Solution of Simultaneous Equation

Consider a Simultaneous equation,

a11 x1  a12 x2  ........ a1n xn  b1


a21 x1  a22 x2  ........ a21 xn  b2
....... ...... ....... ......
am1 x1  am 2 x2  ........ amn xn  bn

This set of equation can be written in the matrix from Ax  B


Where,
 a11 a12 ... a1n   x1   b1 
a a22 
... a2 n   x   
A   21 x   2  B  b2 
 ... ... ... ...   ...   ... 
     
am1 am 2 ... amn 
;  xn 
; bn 

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.

Pivoting might be thought of as swapping or sorting rows or columns in a matrix, and


thus it can be represented as multiplication by permutation matrices. However,
algorithms rarely move the matrix elements because this would cost too much time;
instead, they just keep track of the permutations.

Pivot position

A pivot position, is a position in the matrix that corresponds to a row–leading 1 in the


reduced row echelon form of matrix-A. Since the reduced row echelon form of matrix-A
is unique, the pivot positions are uniquely determined and do not depend on whether or
not row interchanges are performed in the reduction process.

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.

Numerical Methods & Computer Programming Page 2


Solution of Simultaneous Equation

Steps for Partial Pivoting:

 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.

Steps for Complete Pivoting:

 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.

Differences between partial and complete pivoting:

Partial Pivoting Complete Pivoting

Considers both rows and


Only considers the largest value
Criteria for columns to find the largest value
in the current column for
Selection in the remaining sub matrix for
swapping rows.
swapping
Only swaps rows to place the Swaps both rows and columns
Swapping pivot element in the correct to place the pivot element in the
position correct position.

Offers improved stability Offers higher numerical


compared to no pivoting but stability as it selects the
Numerical
might still be susceptible to maximum value from both rows
Stability
numerical instability in certain and columns, minimizing the
cases potential for small divisions.
More computationally intensive
Less computationally intensive
Complexity due to the consideration of both
than complete pivoting
rows and columns.

Numerical Methods & Computer Programming Page 3


Solution of Simultaneous Equation

Notation for Row Operations

Letting Ri denote the ith row of a matrix, we write:


Operation 1: Ri ↔ Rj to mean: Interchange row i with row j.
Operation 2: cRi to mean: Replace row i with c times row i.
Operation 3: Ri + aRj to mean: Replace row i with the sum of row i and a times row j.

Numerical Methods & Computer Programming Page 4


Solution of Simultaneous Equation

5.2 Gauss Elimination Method:


Given system of linear equations in n variables.
a11 x  a12 y  a13 z  b1
a21 x  a22 y  a23 z  b2
a31 x  a32 y  a33 z  b3

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

Reduce the augmented matrix [A : B] through elementary row operations to obtain


[A’ : B’]. To perform row reduction on a matrix, one uses a sequence of elementary
row operations to modify the matrix until the lower left-hand corner (Lower
Triangular elements) of the matrix is filled with zeroes, as much as possible.

There are three types of elementary row operations:


 Swapping two rows, Ri ↔ Rj to mean: Interchange row i with row j.
 Multiplying a row by a nonzero number, cRi to mean: Replace row i with c times
row i.
 Adding a multiple of one row to another row. Ri + aRj to mean: Replace row i with
the sum of row i and a times row j.

𝐴11 𝐴12 𝐴13 𝐵1


0 𝐴22 𝐴23 𝐵2
0 0 𝐴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.

A11 x  A12 y  A13 z  B1


A22 y  A23 z  B2
A33 x3  B3

Numerical Methods & Computer Programming Page 5


Solution of Simultaneous Equation

Example 1: Apply Gauss Elimination Method to solve the following simultaneous


equation
𝟑𝒙 + 𝐲 + 𝟐𝐳 = 𝟐
𝒙 + 𝟐𝒚 + 𝟓𝒛 = 𝟓
𝟐𝒙 + 𝟑𝒚 + 𝟓𝒛 = 𝟏𝟎
Solution: Performing row operation with partial pivoting

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

From above matrix, performing back substitution


−𝐳 = 𝟑 or 𝐳 = − 𝟑
𝒚 + 𝟒𝒛 = 𝟑 or 𝒚 + 𝟒 × −𝟑 = 𝟑 or 𝒚 = 𝟏𝟓
𝒙 + 𝒚 + 𝒛 = 𝟐 or 𝒙 + 𝟏𝟓 − 𝟑 = 𝟐 or 𝒙 = −𝟏𝟎

Hence final answer is

x = − 10 y = 15 z=−3

Numerical Methods & Computer Programming Page 6


Solution of Simultaneous Equation

Example 2: Apply Gauss Elimination Method to solve the following simultaneous


equation
𝟑𝒙 + 𝐲 − 𝟐𝐳 = 𝟎
𝒙 − 𝟑𝒚 + 𝒛 = 𝟖
−𝟐𝒙 + 𝒚 − 𝒛 = 𝟖
Solution: Performing row operation with partial pivoting
Writing matrix A : B R 3 + 2 R1
3 1 −2 0 1 − 3 1 8
1 −3 1 8 0 10 − 5 − 24
−2 1 −1 8 0 − 5 1 24

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

From above matrix, performing back substitution,

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

Hence final answer is

x = − 3.2 y = − 6.4 z=−8

Numerical Methods & Computer Programming Page 7


Solution of Simultaneous Equation

5.3 Gauss–Jordan Method


Given system of linear equations in n variables.
a11 x  a12 y  a13 z  b1
a21 x  a22 y  a23 z  b2
a31 x  a32 y  a33 z  b3

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

Reduce the augmented matrix [A : B] through elementary row operations to obtain


[A’ : B’]. To perform row reduction on a matrix, one uses a sequence of elementary
row operations to modify the matrix until the lower left-hand corner (Lower
Triangular elements) of the matrix is filled with zeroes, as much as possible.

There are three types of elementary row operations:


 Swapping two rows, Ri ↔ Rj to mean: Interchange row i with row j.
 Multiplying a row by a nonzero number, cRi to mean: Replace row i with c times
row i.
 Adding a multiple of one row to another row. Ri + aRj to mean: Replace row i with
the sum of row i and a times row j.

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

Numerical Methods & Computer Programming Page 8


Solution of Simultaneous Equation

Example 1: Apply Gauss Jordan Method to solve the following simultaneous


equation
𝒙+𝐲+𝐳=𝟗
𝟐𝒙 − 𝟑𝒚 + 𝟒𝒛 = 𝟏𝟑
𝟑𝒙 + 𝟒𝒚 + 𝟓𝒛 = 𝟒𝟎
Solution: Performing row operation with complete pivoting
Writing matrix A : B R3 − R2
1 1 1 9 1 1 1 9
2 −3 4 13 0 1 − 2/5 1
3 4 5 40 0 0 12/5 12

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

Hence final answer is

x=𝟏 y=𝟑 z=𝟓

Numerical Methods & Computer Programming Page 9


Solution of Simultaneous Equation

5.4 Jacobi method


Consider a Simultaneous Equation,
𝑎11 𝑥 + 𝑎12 𝑦 + 𝑎13 𝑧 = 𝑏1

𝑎21 𝑥 + 𝑎22 𝑦 + 𝑎23 𝑧 = 𝑏2

𝑎31 𝑥 + 𝑎32 𝑦 + 𝑎33 𝑧 = 𝑏3

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

Step-3: Make an initial approximation of the solution as, x = y = z = 0, each equation


is solved by substitute the previous iteration values x, y, z of on the right-hand
sides of each iterative equations to obtain the first approximation, one iteration has
been performed. In the same way, the second approximation is formed by
substituting the first approximation’s -values on the right-hand sides of the
rewritten equations.

Step-4: By repeated iterations, until the desire accuracy of approximations that


often converges to the actual solution.
𝑥n+1 − 𝑥n = 𝑦n+1 − 𝑦n = 𝑧n+1 − 𝑧n = Desire Accuracy

Numerical Methods & Computer Programming Page 10


Solution of Simultaneous Equation

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

Numerical Methods & Computer Programming Page 11


Solution of Simultaneous Equation

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

Numerical Methods & Computer Programming Page 12


Solution of Simultaneous Equation

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

Numerical Methods & Computer Programming Page 13


Solution of Simultaneous Equation

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

Numerical Methods & Computer Programming Page 14


Solution of Simultaneous Equation

5.5 Gauss-Seidel Method


Consider a Simultaneous Equation,
𝑎11 𝑥 + 𝑎12 𝑦 + 𝑎13 𝑧 = 𝑏1

𝑎21 𝑥 + 𝑎22 𝑦 + 𝑎23 𝑧 = 𝑏2

𝑎31 𝑥 + 𝑎32 𝑦 + 𝑎33 𝑧 = 𝑏3

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

Step-3: Make an initial approximation of the solution as, x = y = z = 0, each equation


is solved by substitute the recent updated values x, y, z of on the right-hand sides
of each iterative equations to obtain the first approximation, one iteration has been
performed. In the same way, the second approximation is formed by substituting
the first approximation’s -values on the right-hand sides of the rewritten equations.

Step-4: By repeated iterations, until the desire accuracy of approximations that


often converges to the actual solution.
𝑥n+1 − 𝑥n = 𝑦n+1 − 𝑦n = 𝑧n+1 − 𝑧n = Desire Accuracy

Numerical Methods & Computer Programming Page 15


Solution of Simultaneous Equation

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

From above x1 =1 and y1 = 0.625

z1 
1
12  2 x1  y1  z1 
1
12  2(1)  (0.625)   1.042
9 9

Hence, x1 =1 y1 = 0.625 and z1 = 1.042

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

Now, x2 = 1.104 and z1 = 1.042

y2  
1
 4  x2  3z1  y2  
1
 4  (1.104)  3(1.042)   1.029
8 8

From above x2 =1.104 and y2 = 1.029

z2 
1
12  2 x2  y2  z2 
1
12  2(1.104)  (1.029)   0.974
9 9

Hence, x2 =1.104 y2 = 1.029 and z2 = 0.974

Numerical Methods & Computer Programming Page 16


Solution of Simultaneous Equation

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

Now, x3 = 0.986 and z2 = 0.974

y3  
1
 4  x3  3z 2  y3  
1
 4  (0.986)  3(0.974)  0.989
8 8

From above x3 = 0.986 and y3 = 0.989

z3 
1
12  2 x3  y3  z3 
1
12  2(0.986)  (0.989)   1.004
9 9

Hence, x3 = 0.986 y3 = 0.989 and z3 = 1.004

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

Now, x4 = 0.989 and z3 = 1.004

y4  
1
 4  x4  3z3  y4  
1
 4  (0.989)  3(1.004)  1.002
8 8

From above x4 = 1.004 and y4 = 1.002

z4 
1
12  2 x4  y4  z4 
1
12  2(1.004)  (1.002)   0.999
9 9

Hence, x4 = 1.004 y3 = 1.002 and z3 = 0.999

Numerical Methods & Computer Programming Page 17


Solution of Simultaneous Equation

5.6 Inverse matrix by using Gauss–Jordan Method


Given system of linear equations in n variables.
a11 x  a12 y  a13 z  b1
a21 x  a22 y  a23 z  b2
a31 x  a32 y  a33 z  b3

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

Reduce the augmented matrix from [A : I] through elementary row operations to


obtain [ I : A-1 ]. To perform row reduction on a matrix, one uses a sequence of
elementary row operations to modify the matrix until the lower left-hand corner
(Lower Triangular elements) and Upper right-hand corner (Upper Triangular
elements) of the matrix is filled with zeroes, as much as possible.

There are three types of elementary row operations:


 Swapping two rows, Ri ↔ Rj to mean: Interchange row i with row j.
 Multiplying a row by a nonzero number, cRi to mean: Replace row i with c times
row i.
 Adding a multiple of one row to another row. Ri + aRj to mean: Replace row i with
the sum of row i and a times row j.

1 0 0 𝐴11 𝐴12 𝐴13


0 1 0 𝐴21 𝐴22 𝐴23
0 0 1 𝐴31 𝐴32 𝐴33

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

Numerical Methods & Computer Programming Page 18


Solution of Simultaneous Equation

Example 1: Apply Gauss Jordan method to find inverse of following Simultaneous


equations.
x + y + z = 5,
3x + 5y + 2z = 15
2x + y + 4z=8

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

2R3 +R2 R1 −R2


1 1 1 1 0 0 1 1 0 18/3 − 3/3 − 3/3
0 2 −1 −3 1 0 0 1 0 − 8/3 2/3 1/3
0 0 3 −7 1 2 0 0 1 − 7/3 1/3 2/3

Hence final answer is,

18 −3 −3
1
A-1 = −8 2 1
3
−7 1 2

Numerical Methods & Computer Programming Page 19

You might also like