You are on page 1of 6

Numerical Methods

Solution of System of Linear Algebraic equations


å Gauss Jordan Method

Jayandra Raj Shrestha


September 2020

Institute of Engineering,
Tribhuvan University, Nepal
Gauss Jordan Method
Given the Linear System: Procedure:
• Reduce the augmented coefficient matrix to diagonal
a11 x1 + a12 x2 + a13 x3 = b1
form via row equivalent technique:
a21 x1 + a22 x2 + a23 x3 = b2 • eliminate the non-diagonal coefficients column-wise
a31 x1 + a32 x2 + a33 x3 = b3 • by taking the column diagonal as pivot
• and row corresponding to column diagonal as pivotal
In matrix form: row

a11 a12 a13 x1 b1


    
• Obtain the solution vector from diagonalized matrix
a21 a22 a23  x2  = b2 
    
• by dividing the constant term of each row from row
a31 a32 a33 x3 b3 diagonal (pivot element)

Augmented coefficient matrix: Diagonal Form: Solution:

x1 = β1 /α11
 
a11 a12 a13 : b1 0 0
   
α11 : β1
a21 a22 a23 : b2  ⇒  0 α22 0 ⇒ x2 = β2 /α22 
 
: β2 
   
JRS\IOE a31 a32 a33 : b3 0 0 α33 : β3 x3 = β3 /α33 1/5
Column-wise Elimination

a11 a12 a13 : b1 R1 ⇒ Pivotal Row


 

a21 a22 a23 : b2  R2 ← R2 − aa21 R1 [To eliminate a21 ]


 
11
a31 a32 a33 : b3 R3 ← R3 − aa31
11
R1 [To eliminate a31 ]

a11 a12 a13 : b1 R1 ← R1 − aa12 R2 [To eliminate a12 ]


 
22
∼ 0 a22 0 a23 0 : b2 0  R2 ⇒ Pivotal Row
 
0 a32 0 a33 0 : b3 0 R3 ← R3 − aa32
22
R2 [To eliminate a32 ]

a11 0 a13 0 : b1 0 R1 ← R1 − aa13 R3 [To eliminate a13 ]


 
33
a23
∼ 0 a22 0
a23 0 : b2 0  R2 ← R2 − a33 R3 [To eliminate a23 ]
 
0 0 a33 00 : b3 00
R3 ⇒ Pivotal Row

a11 0 0 : b1 00 x1 = b1 /a11
   

∼ 0 a22 0 0 : b2 00  ⇒ Solution ⇒ x2 = b2 /a22 


   
0 0 a33 00 : b3 00 x3 = b3 /a33
JRS\IOE 2/5
In summary
In the row operation formula
Eliminate all ai,j
where: ai,j ⇒ Element being eliminated
j = 1, 2, . . . , n Ri ⇒ Row corresponding to ai,j
i = 1, 2, . . . , n
aj,j ⇒ Pivot element
i 6= j
Rj ⇒ Pivotal Row
n = No. of unknowns
using the row operation:
ai,j
Ri ← Ri − Rj Limitations
aj,j
• The pivot element aj,j should not be
Finally, obtain the solution: zero.

bi • When aj,j ≪ ai,j during row-operation,


xi = small round-offs may result in large
ai,i
errors.
JRS\IOE where: i = 1, 2, . . . , n 3/5
Gauss Jordan Method: Example
Solve:
5 4 3 28
 
:
5x1 + 4x2 + 3x3 = 28 R2 ← R2 − (7/5)R1
∼ 0 −8/5 −26/5 : −96/5 
 
R3 ← R3 − (8/5)R1
7x1 + 4x2 − x3 = 20 0 −57/5 −4/5 : −104/5
8x1 − 5x2 + 4x3 = 24
5 0
 
−10 : −20
R1 ← R1 + (5/2)R2
∼ 0 −8/5 −26/5 : −96/5
 
Augmented Coefficient Matrix: R3 ← R3 − (57/8)R2
0 0 145/4 : 116
5 4 3 : 28
 

7 4 −1 : 20 5 0 0 12
   
:
8 −5 4 : 24 R1 ← R1 + (8/29)R3
∼ 0 −8/5 0 : −64/25
 
R2 ← R2 + (104/725)R3
0 0 145/4 : 116

x1 12/5 2.4
     

x2  =  −8/5  = 1.6


   −64/25   
Solution:
JRS\IOE 116 4/5
x3 145/4
3.2
Assignments

1. Construct a system of linear equations in four unknowns of your own (using


predetermined values for the unknowns) and show its solution by Gauss Jordan
Method. Make sure that the system so constructed has a unique set of solution
(coefficient matrix should be non-singular).
2. Write an algorithm/pseudo-code for solving a system of linear equations in any
number of unknowns using the Gauss-Jordan Method, taking care of error
condition(s) that may arise during the computation. Check your program for the
systems comprising of two, three, four, and five unknowns.
3. Find out an expression to determine the total number of scalar calculations required
to solve a system of n unknowns using the Gauss-Jordan Method.

JRS\IOE 5/5

You might also like