Linear algebra · CMNA Laboratory

Watch a linear system settle down.

Jacobi and Gauss-Seidel both replace a direct solve with a sequence of better guesses. Paste your own matrix into R and watch the residual shrink.

Same equations, different information flow

Jacobi computes an entire new approximation from the previous iterate. Gauss-Seidel uses updated components as soon as they become available. That small implementation difference can produce visibly different convergence histories.

Bring your own system

Define A and b in actual R.

Diagonally dominant systems are especially friendly to these methods. Try changing the matrix and see whether the residual behaves itself.

RuntimePreparing R…
RDefine A and b
JacobiGauss-Seidel

nJacobi xJacobi residualGauss-Seidel xG-S residual
Book§3.4 · Iterative Methods · pp. 79–85Book details
CMNA packagejacobigaussseidel
TeachingInstructor notes and chapter contextOpen teaching material
Numerical ZooWorked problems