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.
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.
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.
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.
| 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 |
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.