ENG 303 · Engineering Mathematics V (Numerical Methods and Computer Application)
Our notes
1 min readWhy iterate
Large systems from finite-difference grids (thousands of unknowns, mostly zeros in A) are cheaper to solve by iteration than by elimination.
Jacobi method
Solve each equation for its diagonal unknown, and use the old values on the right:
xᵢ(new) = [bᵢ − Σ (j ≠ i) aᵢⱼ xⱼ(old)] / aᵢᵢ.
Worked example.
10x + y + z = 12
x + 10y + z = 12
x + y + 10z = 12 (exact solution x = y = z = 1)
Starting from (0, 0, 0):
| Iteration | x | y | z |
|---|---|---|---|
| 1 | 1.2 | 1.2 | 1.2 |
| 2 | 0.96 | 0.96 | 0.96 |
| 3 | 1.008 | 1.008 | 1.008 |
Gauss-Seidel method
Use each new value as soon as it is computed:
| Iteration | x | y | z |
|---|---|---|---|
| 1 | 1.2 | (12 − 1.2 − 0)/10 = 1.08 | (12 − 1.2 − 1.08)/10 = 0.972 |
| 2 | (12 − 1.08 − 0.972)/10 = 0.9948 | (12 − 0.9948 − 0.972)/10 = 1.00332 | (12 − 0.9948 − 1.00332)/10 = 1.000188 |
Gauss-Seidel usually converges about twice as fast as Jacobi and needs to store only one copy of x.
When they converge
A sufficient condition: A is strictly diagonally dominant (in each row, |aᵢᵢ| > sum of the other |aᵢⱼ|). Reorder the equations to achieve it where possible. Symmetric positive definite matrices also guarantee Gauss-Seidel convergence.
Stopping
Stop when the largest change between iterations (or the residual b − Ax) is below a tolerance, with a maximum number of iterations.
Successive over-relaxation (SOR)
x(new) = ω × (Gauss-Seidel value) + (1 − ω) × x(old). With 1 < ω < 2 it can greatly speed up convergence on grid problems; ω = 1 is plain Gauss-Seidel.
Exams usually ask: perform two or three Jacobi or Gauss-Seidel iterations; state the convergence condition; rearrange equations to be diagonally dominant; compare the methods.
Common mistake: in Gauss-Seidel, using old values for unknowns already updated in the same sweep. That turns it back into Jacobi.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
Read
-
Best pick Kaw, Numerical Methods with Applications: Gauss-Seidel method
Textbook chapter (PDF, about 0.3 MB) with worked examples and a short quiz at the end.
(opens nm.mathforcollege.com in a new tab)
Kaw, Numerical Methods with Applications, Kaw, Numerical Methods with Applications: Gauss-Seidel method, CC BY-NC-ND 4.0 · licence
-
NOUN MTH 213: Numerical Analysis I
NOUN course book (PDF, about 1.4 MB). Interpolation, linear systems (direct and iterative), eigenvalues, non-linear equations.
(opens nou.edu.ng in a new tab)
-
Jacobi method
(opens en.wikipedia.org in a new tab)
Wikipedia, Jacobi method, CC BY-SA 4.0 · licence
-
Gauss–Seidel method
(opens en.wikipedia.org in a new tab)
Wikipedia, Gauss–Seidel method, CC BY-SA 4.0 · licence
-
Kaw, Numerical Methods with Applications (the whole free textbook)
Every chapter as a separate PDF (0.2 to 1.5 MB each), with videos and quizzes for each method.
(opens nm.mathforcollege.com in a new tab)
Kaw, Numerical Methods with Applications, Kaw, Numerical Methods with Applications (the whole free textbook), CC BY-NC-ND 4.0 · licence
Watch
We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.