Skip to main content

Direct, iterative methods; Gauss-Seidel numerical

Short answer

Direct methods (Gauss elimination, LU, Cholesky) give exact solution in finite steps; iterative methods (Jacobi, Gauss-Seidel, SOR, CG) improve a guess. For the system, rearranging equations and iterating from (1,2,3) yields convergence to exact solution x=1, y=3, z=4 after six iterations.

What are the direct methods and iterative methods of solving linear equations? Solve the following set of linear equations by the Gauss-Seidel method starting with initial guess of [1,2,3][1, 2, 3].

12x+3y−5z=112x + 3y - 5z = 1

x+5y+3z=28x + 5y + 3z = 28

3x+7y+13z=763x + 7y + 13z = 76

Direct and iterative methods

  • Direct methods give the solution in a finite, known number of operations (exact apart from round-off). Examples: Gauss elimination, Gauss-Jordan, LU and Cholesky decomposition, matrix inverse (Cramer's rule). They are best for small or dense systems.
  • Iterative methods start from a trial vector and improve it repeatedly until the change is below a tolerance. Examples: Jacobi, Gauss-Seidel, SOR, conjugate gradient. They are best for large sparse systems and need convergence conditions such as diagonal dominance.

Gauss-Seidel solution

The system is diagonally dominant (12>812>8, 5>45>4, 13>1013>10), so it converges. Rearranging:

x=1−3y+5z12,y=28−x−3z5,z=76−3x−7y13x=\frac{1-3y+5z}{12},\quad y=\frac{28-x-3z}{5},\quad z=\frac{76-3x-7y}{13}

Start (x,y,z)=(1,2,3)(x,y,z)=(1,2,3).

Iterationxxyyzz
10.83333.63333.6974
20.71563.23843.9373
30.91433.05483.9903
40.98233.00943.9990
50.99733.00114.0000
60.99973.00004.0000

Example of iteration 1: x=(1−3(2)+5(3))/12=0.8333x=(1-3(2)+5(3))/12=0.8333; y=(28−0.8333−9)/5=3.6333y=(28-0.8333-9)/5=3.6333; z=(76−2.5−25.4333)/13=3.6974z=(76-2.5-25.4333)/13=3.6974.

Answer: x≈1, y≈3, z≈4x\approx1,\ y\approx3,\ z\approx4 (exact solution x=1,y=3,z=4x=1,y=3,z=4).

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computational Techniques in Civil Engineering chapter 2 questions →