Sunteți pe pagina 1din 6

Experiment NO-4

TITLE : SOLUTION OF LINEAR SIMULTANEOUS EQUATION

THEORY : A system of linear equations with a n unknowns is represented as

a11x1+a12x2+………..a1nxn=b1
a21x1+a22x2+………..a2nxn=a2
.
.
.
.
an1x1+an2x2+………..annxn=bn

Where x1,x2,…….xn are the variables whose values are to be found out.

In matrix format the above equation can be expressed as :


Ax=B
Where A=n*n coefficient of matrix
B is n*1 right hand side vector and x is an n*1 vector of unknowns

A set of equations is known as system of simultaneous equation

Various methods to solve linear algebraic equations can be classified as given below
A) DIRECT METHOD
i) Gauss Elimination Method
ii) Gauss Jordan Method

B) ITERATION METHOD
i) Gauss Seidal Method

1) GAUSS ELIMINATION METHOD:-

This method is employed in two steps:


a) Forward elimination
b) Backward substitution

The equation in general form are


a11x1+a12x2+a13x3=c1
a21x1+a22x2+a23x3=c2
a31x1+a32x2+a33x3=c3

In the matrix form Ax=B


a11 a12 a13 x1 c1
a 21 a 22 a 23 x2 = c2
a31 a32 a33 x3 c3

The matrix coefficient is reduced to upper triangular method by row transformations

a11 a12 a13 x1 c1


0 a 22 ' a 23 ' x2 = c 2'
0 0 a33 ' x3 c3'

This procedure is called Forward elimination . The value of x1 obtained by backward


substitution
c3'
x3=
a33 '

a 23 '
x2 =c2’ - * x3
a 22 '

a12 * x 2 − a13 * x3
x1 = c1 -
a11

PROBLEM:

Solve the following equations by Gauss elimination method

2x1+3x2+4x3=1
9x1+2x2-8x3=1.9
15x1-8x2+6x3=14.7
GAUSS JORDAN METHOD :

This method is extension of Gauss Elimination method . In this we convert all the
elements in the matrix except diagonal elements to zero.

Consider a system of equations

a11x1+a12x2+…………+a1nxn=d1
a21x1+a22x2+…………+a2nxn=d2
.
.
.
an1 x1+an2x2+………...+annxn=dn

This equation can be written in matrix form as


Ax=D

a11 . . a1n x1 d1
a 21 . . a 2n x2 d2
. . . . .
= .
an 1 . . ann xn dn

Now by performing row operations the matrix A is reduced to unit matrix

1 0 . 0 x1 d1
0 1 . 0 x2 d2
. . . . x3
= d3
0 0 . 1 x4 d4

Then solution is

x1 = d1
x2 = d2
x3 = d3
..
..
..
xn = dn
PROBLEM:-

Use Gauss Jordan method to solve equation

2x1+3x2-4x3=1
5x1+9x2+3x3=17
-8x1-2x2+x3= -9
GAUSS SEIDAL METHOD:-

Let the system is given by

a11x1+ a12x2+ ……… a1nxn = b1


a21x1+a22x2+………...a2nxn=b2
.
.
.
an1x1+an2x2+……….annxn = bn

Note that diagonal elements should not vanish. If they vanish , then the system must
be rearranged.

Now ,

b1 a12 a1n
x1 = - * x2 ……. - * xn
a11 a11 a11

b2 a 21 a 2n
x2 = - * x1 …….- * xn
a 22 a 22 a 22

.
.
.
bn an1 a ( nn −1)
xn= - * x1 …….- * xn-1
ann ann ann

Now initial approximations are


[ x1(1) , x2(1) , x3(1) ,…… xn(31) ]

Substituting this values in equation 1 to obtain new x1, x2(2),..


Use this new value and rest of the approximation for x2(2) .

Thus in the third equation we use [ x1(2) , x2(2) , …..xn(1)]

This way substitution continues till nth equation and which finishes the first iteration.
Thus the method uses an improved approximation as soon as available and hence it is
called successive displacement.
PROBLEM :-

Given the linear equation

4x+y+z = 5
x + 6y+2z = 19
-x -2y-5z = 10

Find x,y,z by Gauss Seidal method

S-ar putea să vă placă și