MTH 492 · Numerical Methods
Our notes
2 min readThe five-point formula
For Laplace's equation u_xx + u_yy = 0 on a square grid (h = k):
uᵢ₊₁,ⱼ + uᵢ₋₁,ⱼ + uᵢ,ⱼ₊₁ + uᵢ,ⱼ₋₁ − 4uᵢ,ⱼ = 0
So each interior value is the average of its four neighbours. For Poisson's equation u_xx + u_yy = f, the right side is h²fᵢ,ⱼ. Error O(h²).
Worked example: a heated edge
A square plate with the top edge held at 100 and the other three edges at 0, and a 2 × 2 grid of interior nodes: u₁, u₂ (top row, left and right) and u₃, u₄ (bottom row).
By symmetry u₁ = u₂ and u₃ = u₄.
- Node 1: 4u₁ = u₂ + u₃ + 100 + 0 → 3u₁ − u₃ = 100
- Node 3: 4u₃ = u₄ + u₁ + 0 + 0 → 3u₃ − u₁ = 0, so u₁ = 3u₃
Substituting: 9u₃ − u₃ = 100, so u₃ = 12.5, u₁ = 37.5.
Check: node 1: (37.5 + 12.5 + 100 + 0)/4 = 37.5 ✓; node 3: (12.5 + 37.5 + 0 + 0)/4 = 12.5 ✓. Also, by superposition: turning the problem so each edge in turn is the hot one, and adding, gives a plate with every edge at 100, where every value is 100. Node 1 is next to the top and left edges and far from the other two, so 37.5 + 37.5 + 12.5 + 12.5 = 100 ✓.
Iterative solution
Real grids have thousands of nodes. The matrix is large and sparse, so we iterate:
- Jacobi: each new value is the average of the old neighbours.
- Gauss-Seidel: use new values as soon as they are computed (about twice as fast as Jacobi).
- SOR (successive over-relaxation): u_new = u_old + ω(u_GS − u_old) with 1 < ω < 2; the best ω can make it many times faster.
Gauss-Seidel on the example (from zero, no symmetry used)
Order: u₁ = (u₂ + u₃ + 100)/4, u₂ = (u₁ + u₄ + 100)/4, u₃ = (u₁ + u₄)/4, u₄ = (u₂ + u₃)/4.
| Sweep | u₁ | u₂ | u₃ | u₄ |
|---|---|---|---|---|
| 1 | 25.000 | 31.250 | 6.250 | 9.375 |
| 2 | 34.375 | 35.938 | 10.938 | 11.719 |
| 3 | 36.719 | 37.109 | 12.109 | 12.305 |
| 6 | 37.488 | 37.494 | 12.494 | 12.497 |
It converges to 37.5 and 12.5.
Irregular boundaries and derivative conditions
Near a curved boundary, use unequal arms in the difference formula. For an insulated edge (∂u/∂n = 0), use a mirror (ghost) node equal to the interior neighbour.
Exams usually ask
- Set up and solve the five-point equations on a small grid.
- Carry out Gauss-Seidel sweeps.
Common mistake
Using Gauss-Seidel but updating with only old values (that is Jacobi). Gauss-Seidel uses each new value immediately.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
Read
-
Relaxation (iterative method)
(opens en.wikipedia.org in a new tab)
Wikipedia, Relaxation (iterative 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
-
NOUN MTH 422: Partial Differential Equations
NOUN course book (PDF, about 1 MB). Formation, first-order equations (Lagrange and Charpit), Cauchy problem, classification of second-order equations.
(opens nou.edu.ng in a new tab)
Watch
-
Best pick Laplace's Equation and Poisson's Equation
18 min · ≈ 81 MB · about ₦45
(opens youtube.com in a new tab)
-
Laplace Equation
13 min · ≈ 59 MB · about ₦33
(opens youtube.com in a new tab)
-
Chapter 10.03: Lesson: Elliptic PDEs: Gauss-Seidel Method
14 min · ≈ 63 MB · about ₦35
(opens youtube.com in a new tab)
-
Laplace equation and Poisson equation
11 min · ≈ 50 MB · about ₦28
(opens youtube.com in a new tab)
-
Laplace and poisson equations (Maths)
35 min · ≈ 158 MB · about ₦89
(opens youtube.com in a new tab)
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.