Loading Search Params...

Gauss-Seidel Method

The Gauss-Seidel method is an iterative technique used to solve a system of linear equations. It's particularly useful for large systems where direct methods may be computationally expensive. The method uses the most recent values of the variables as soon as they are available, allowing for potentially faster convergence.


General Formulation

Given a system of linear equations:

{a1x1+b1y1+c1z1=ia2x2+b2y2+c2z2=ja3x3+b3y3+c3z3=k\begin{cases} a_1x_1 + b_1y_1 + c_1z_1 = i \\ a_2x_2 + b_2y_2 + c_2z_2 = j \\ a_3x_3 + b_3y_3 + c_3z_3 = k \end{cases}

Steps of the Gauss-Seidel Method

  1. Rearrange the Equations: Solve each equation for one variable in terms of the others.
  2. Initial Guess: Start with an initial guess for the values of the variables (x1,y1,z1)( x_1, y_1, z_1 )
  3. Iterate: Substitute the known values into the rearranged equations to update the values of the variables.
  4. Convergence Check: Repeat the iteration until the values converge.

Example

Consider the following system of equations:

{4x+y+z=12x+5y+2z=272x+y+6z=18\begin{cases} 4x + y + z = 12 \\ x + 5y + 2z = 27 \\ 2x + y + 6z = 18 \end{cases}

Error Margin is 0.1

1. Rearranging the Equations:

  • x=12yz4x = \frac{12 - y - z}{4}
  • y=27x2z5y = \frac{27 - x - 2z}{5}
  • z=182xy6z = \frac{18 - 2x - y}{6}

2. Initial Guess:

Start with

(x0=0,y0=0,z0=0)( x_0 = 0, y_0 = 0, z_0 = 0 )

Iterations:

First Iteration:

  • Calculate x1x_1:
    x1=12004=3x_1 = \frac{12 - 0 - 0}{4} = 3
  • Calculate y1y_1:
    y1=27305=4.8y_1 = \frac{27 - 3 - 0}{5} = 4.8
  • Calculate z1z_1:
    z1=182(3)4.86=1.2z_1 = \frac{18 - 2(3) - 4.8}{6} = 1.2

Second Iteration:

  • Calculate x2x_2:
    x2=124.81.241.5x_2 = \frac{12 - 4.8 -1.2 }{4} \approx 1.5
  • Calculate y2y_2:
    y2=271.52(1.2)54.62y_2 = \frac{27 - 1.5 - 2(1.2)}{5} \approx 4.62
  • Calculate z2z_2:
    z2=182(1.5)4.6261.73z_2 = \frac{18 − 2(1.5) − 4.62}{6} \approx 1.73

Third Iteration:

  • Calculate x3x_3:
    x3=124.621.7341.41x_3 = \frac{12 - 4.62 - 1.73}{4} \approx 1.41
  • Calculate y3y_3:
    y3=271.412(1.73)54.43y_3 = \frac{27 - 1.41 - 2(1.73)}{5} \approx 4.43
  • Calculate z3z_3:
    z3=182(1.41)4.4361.79z_3 = \frac{18 - 2(1.41) - 4.43}{6} \approx 1.79

Fourth Iteration:

  • Calculate x4x_4:
    x4=124.431.7941.445x_4 = \frac{12 - 4.43 - 1.79}{4} \approx 1.445
  • Calculate y4y_4:
    y4=271.4452(1.79)54.395y_4 = \frac{27 - 1.445 - 2(1.79)}{5} \approx 4.395
  • Calculate z4z_4:
    z4=182(1.445)4.39561.785z_4 = \frac{18 - 2(1.445) - 4.395}{6} \approx 1.785

Conclusion

The Gauss-Seidel method is simple to implement and can be very effective for certain types of systems. Its performance depends on the properties of the coefficient matrix; specifically, it works best when the matrix is diagonally dominant.

Gauss-Seidel Method

A ValueB ValueC ValueConstants
Error Margin

Results:

0