Monday, October 13, 2014

Gaussian Elimination Method for solving simultaneous equations

Gaussian Elimination Method
Gaussian elimination method is used for solving systems of linear equations, it is also known as row reduction method. Gaussian elimination method can also be used to find the rank of a matrix, to calculate the determinant of a matrix, and to calculate the inverse of an invertible square matrix. A sequence of operations performed on the augmented matrix obtained from the set of linear equations until the lower left-hand corner of the matrix is filled with zeros. To modify the coefficient matrix we can swap the two rows or multiplying a row by a non-zero number or adding a multiple of one row to another row. Using these operations, a matrix can always be transformed into an upper triangular matrix.
Consider the set of linear equations of 3 variable


The augmented matrix for the given set of equation is 


Using the below operation to the augmented matrix 


R2 = R2 – (a2/a1)*R1
R3 = R3 – (a3/a1)*R1


The augmented matrix will become

Now apply this operation

R3 = R3 – (F/D)*R2

After applying the above rules the augmented matrix will transferred into upper triangular matrix



and the value of  x, y and z can be obtained as


z  =  Q/P
y  =  (L – E*z)/D
x  =  (K – C*z – B*y)/A


Matlab Program for 3 Variables simultaneous equations using Gaussian Elimination Method

g=input('Enter the Augmented Matrix >  ');
g(2,:)=g(2,:)- g(2)/g(1)*g(1,:);
g(3,:)=g(3,:)- g(3)/g(1)*g(1,:);
g(3,:)=g(3,:)- g(6)/g(5)*g(2,:);
z=g(12)/g(9)
y=(g(11)-z*g(8))/g(5)
x=(g(10)-z*g(7)-y*g(4))/g(1)

No comments:

Post a Comment