Although it seems that the Gauss elimination method gives an exact solution, the accuracy of this method is not very good in large systems. The main reason of inaccuracy in the gauss elimination method is round-off error because of huge mathematical operations of this technique. Furthermore, this method is very time consuming in large systems. Many of systems of linear algebraic equations which should be solved in engineering problems are large and there are lots of zeros in their coefficient matrix. To solve this kinds of problems, iterative methods often is used. Gauss-Seidel one of the iterative techniques, is very well-known because of its good performance in solving engineering problems. For a system of linear equation as follows:
. . .
where a are coefficients of unknowns and _{ij}c are equations’ constants. The Gauss-Seidel method needs a starting point as the first guess. The new guess is determined by using the main equation as follows:_{i}
Mathematically, it can be shown that if the coefficient matrix is diagonally dominant this method converges to exact solution.
The algorithm of the Gauss-Seidel method can be written as follows:
<e then let X is solution else go to step 2.
(Source Code in C++) |