Gauss-Seidel Method

Using Gauss-Seidel method, this application solves the system of linear equations $Ax=b$, where \[ A = \left[\begin{array}{cccc} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{n1} & a_{n2} & \cdots & a_{nn} \end{array}\right],\qquad x = \left[\begin{array}{c} x_1 \\ x_2 \\ \vdots \\ x_n \end{array}\right],\qquad b = \left[\begin{array}{c} b_1 \\ b_2 \\ \vdots \\ b_n \end{array}\right] \] and matrix $A$ has the diagonal dominant property, i.e. \[ |a_{ij}| > \sum_{j\ne i}|a_{ij}|,\qquad i=1,\ldots, n\] The updated $x_i^{(k+1)}$ is calculated from the relation \[ x_i^{(k+1)} = \frac{1}{a_{ii}}\left(b_i-\sum_{j=1}^{i-1}a_{ij}x_j^{(k+1)} - \sum_{j=i+1}^na_{ij}x_j^{(k)}\right),\qquad i=1,\ldots, n \] The calculation stops when $k=1000$ or $\|b-Ax\|_\infty < 10^{-8}$ which in the latter case $x$ is the solution of the problem.

Input Data

See Input Data for how to enter data to a matrix and a vector of real numbers.

Gauss-Seidel Method Calculator