UNIHIVE

Study Hub UNIPORT MTH 492

MTH 492 · Numerical Methods

Elliptic equations: Laplace and Poisson

The five-point formula, setting up the system, and solving it by Gauss-Seidel and SOR.

Our notes

2 min read

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

Sweepu₁u₂u₃u₄
125.00031.2506.2509.375
234.37535.93810.93811.719
336.71937.10912.10912.305
637.48837.49412.49412.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

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.

All MTH 492 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.