Gauss–Seidel Method Calculator

Solve linear systems \( A \mathbf{x} = \mathbf{b} \) using the Gauss–Seidel method. Supports 2×2, 3×3, 4×4 and 5×5.Iteration table, residual monitoring, diagonal dominance check, and convergence analysis.

Test systems:
? 3x3 Diag. dominant (1,2,3)
? 2x2 Simple (1,2)
? 4x4 Diag. dominant
? 5x5 Identity
Privacy first: All calculations are performed locally. No data leaves your device.

The Gauss–Seidel Method: Iterative Refinement for Linear Systems

The Gauss–Seidel method is an iterative technique used to solve a square system of linear equations \( A\mathbf{x} = \mathbf{b} \). It updates each component of the solution vector sequentially, using the most recent values available. This in-place update accelerates convergence compared to the classical Jacobi method, making it a staple in computational mathematics, power flow analysis, computational fluid dynamics (CFD), and large sparse systems.

$$ x_i^{(k+1)} = \frac{1}{a_{ii}} \left( b_i - \sum_{j < i} a_{ij} x_j^{(k+1)} - \sum_{j > i} a_{ij} x_j^{(k)} \right) $$

Where $$ k $$ is the iteration index. The method requires that the diagonal entries $$ a_{ii} \neq 0 $$ . For strictly diagonally dominant matrices $$ |a_{ii}| > \sum_{j \neq i} |a_{ij}| $$ , the Gauss–Seidel iteration is guaranteed to converge for any initial guess. Moreover, symmetric positive definite matrices also guarantee convergence.

Why Choose Gauss–Seidel?

  • Faster convergence – Typically converges twice as fast as Jacobi for many problems due to immediate use of updated components.
  • Memory efficient – Only one copy of the solution vector is required; in-place update reduces storage overhead.
  • Natural for sparse systems – Used in finite difference and finite element methods, large-scale engineering simulations.
  • Foundation for advanced methods – Serves as basis for Successive Over-Relaxation (SOR) and other Krylov subspace preconditions.
Convergence Criteria & Practical Insights

Convergence is not guaranteed for arbitrary matrices. Sufficient conditions include strict diagonal dominance or irreducible diagonal dominance. Our tool automatically checks for strict row diagonal dominance and warns you if the system may diverge. For non-convergent systems, we still run iterations up to the maximum limit – but the residual may stagnate or increase. The Gauss–Seidel method is often used as a smoother in multigrid methods and for solving discretized PDEs (Laplace, Poisson). In engineering, it's a workhorse for load flow studies in power systems (the "fast-decoupled" variants).

Theoretical note: Faster convergence occurs when the spectral radius of the iteration matrix \( \rho(L_*) < 1 \). For strictly diagonally dominant or symmetric positive definite matrices, $\rho(L_*) \lt 1$ is guaranteed – a direct consequence of the Stein–Rosenberg theorem. This tool's diagonal dominance check gives you immediate insight into the expected convergence behavior.

Our iterative solver computes the infinity-norm of the change between successive iterations: $$ \Delta^{(k)} = \max_i |x_i^{(k+1)} - x_i^{(k)}| $$. When $\Delta^{(k)} < \text{tolerance}$ $$, the iteration stops. Final residual $$ \( \| \mathbf{b} - A\mathbf{x} \|_\infty \) $$ confirms accuracy.

How to Use the Interactive Solver

  1. Select system size: 2, 3, 4 or 5 from the dropdown and click "Apply".
  2. Enter matrix coefficients $a_{ij}$ and right-hand side $b_i$ values. You can also pick one of the preset examples.
  3. Provide an initial guess (default zeros) and adjust tolerance / max iterations if needed.
  4. Click “Start Iteration” — the tool builds the iteration table, showing progress at each step (last 20 rows).
  5. Examine solution, residual, and check diagonal dominance condition. Expand the iteration table to understand convergence behavior.

Algorithm Verification & Practical Examples

System Matrix A / b Gauss–Seidel solution Diagonal dominant?
3x3 classic [[4,1,1],[1,5,2],[2,1,4]] , b=[7,19,14] [1.000, 2.000, 3.000] Yes
2x2 convergent [[5,2],[3,4]], b=[8,10] [1.0, 1.5] Yes
4x4 diagonally dominant [[6,1,0,1],[1,7,1,0],[0,1,8,1],[1,0,1,9]], b=[8,9,10,11] ~[1,1,1,1] Yes
Real‑world application: Power flow in electrical grids

In power systems, the Gauss–Seidel method is historically used to solve the AC power flow equations. Although modern systems often employ Newton-Raphson, Gauss–Seidel remains relevant for educational labs and small distribution networks. By iteratively updating voltage magnitudes and phase angles at each bus, engineers obtain steady-state operating points. Our calculator mimics the core iterative mechanism, allowing students to test diagonal dominance effects on convergence speed.

Frequently Asked Questions

Jacobi uses only values from the previous iteration to compute all new components, whereas Gauss–Seidel uses already updated components within the same iteration. This often leads to faster convergence and less memory usage.

Lack of diagonal dominance, indefinite or non-symmetric indefinite matrices, or spectral radius of the iteration matrix greater than 1. Our tool warns you about strict diagonal dominance violation.

SOR generalizes Gauss–Seidel by introducing a relaxation parameter ω. When ω = 1, SOR reduces exactly to Gauss–Seidel. For many systems, ω > 1 can accelerate convergence dramatically.

Grounded in Numerical Analysis – This tool implements the standard Gauss–Seidel algorithm as described in Burden & Faires (Numerical Analysis, 10th ed.) and Quarteroni, Sacco, Saleri. Convergence theory follows the Stein–Rosenberg theorem. Reviewed by GetZenQuery tech team, updated Jun 2026. All matrix operations conform to IEEE 754 double precision standards.

References: MathWorld Gauss-Seidel; Saad, Y. "Iterative Methods for Sparse Linear Systems"; Wikipedia: Gauss–Seidel method.