Professional Documents
Culture Documents
Submitted By:
18-EE-047
i). To study about , the Gauss–Seidel method and perform it on matlab by solving equations.
ii). To understand about the Algorithm Design and formulation of code that formulates the
Gauss–Seidel method
In numerical linear algebra, the Gauss–Seidel method, also known as the Liebmann method or
the method of successive displacement, is an iterative method used to solve a system of linear
equations. It is named after the German mathematicians Carl Friedrich Gauss and Philipp Ludwig von
Seidel, and is similar to the Jacobi method. Though it can be applied to any matrix with non-zero
elements on the diagonals, convergence is only guaranteed if the matrix is either strictly diagonally
dominant, or symmetric and positive definite. Gauss-Seidel method is a popular iterative method of
solving linear system of algebraic equations. It is applicable to any converging matrix with non-zero
elements on diagonal. The method is named after two German mathematicians: Carl Friedrich Gauss
and Philipp Ludwig von Seidel.
Gauss-Seidel is considered an improvement over Gauss Jacobi Method. In this method, just like any
other iterative method, an approximate solution of the given equations is assumed, and iteration is
done until the desired degree of accuracy is obtained.
The matrices, iterations, and the procedure explained below cover the basic guidelines to
write the program code for Gauss-Seidel method in MATLAB.
equations can be presented in matrix form
Or simply, it can be written as: [A][X] = [B]
Now, decomposing the matrix A into its lower triangular component and upper triangular
component, we get:
A=LxU
where,
L x X = B – UX —–(a)
In Gauss-Seidel method, the equation (a) is solved iteratively by solving the left
hand value of x and then using previously found x on right hand side.
Mathematically, the iteration process in Gauss-Seidel method can be expressed
as:
5.2.1 Example:
2x+5y=21
x+2y=8
Solution:
Total Equations are 2
2x+5y=16
3x+y=11
2x+5y=16
y=15(16-2x)
Solution steps;
1st Approximation
x1=13[11-(0)]=13[11]=3.666667
y1=15[16-2(3.666667)]=15[8.666667]=1.733333
2nd Approximation
x2=13[11-(1.733333)]=13[9.266667]=3.088889
y2=15[16-2(3.088889)]=15[9.822222]=1.964444
3rd Approximation
x3=13[11-(1.964444)]=13[9.035556]=3.011852
y3=15[16-2(3.011852)]=15[9.976296]=1.995259
4th Approximation
x4=13[11-(1.995259)]=13[9.004741]=3.00158
y4=15[16-2(3.00158)]=15[9.99684]=1.999368
5th Approximation
x5=13[11-(1.999368)]=13[9.000632]=3.000211
y5=15[16-2(3.000211)]=15[9.999579]=1.999916
6th Approximation
x6=13[11-(1.999916)]=13[9.000084]=3.000028
y6=15[16-2(3.000028)]=15[9.999944]=1.999989
4x1 – x2 –x3 = 3
-2x1 + 6x2 + x3 = 9
-x1 + x2 – 7x3 = -6
5.2.1 Code:
5.2.2 Answers:
So,
X1 = 1;
X2 = 2;
X3 = -1;
5.3 Conclusion:
The algorithm and code of Gauss-Seidel Method can be formulated using MATLAB and data
can be made user defined to solve different equations by just adding different values for equations. To
solve equations by using Gauss –seidel method code is the easiest way to get accurate answer.