Lesson
The theory — Laplace's Equation: a Plate in Steady State
Laplace's equation, ∂²u/∂x² + ∂²u/∂y² = 0, holds for the temperature of a uniform body with no heat sources inside, once it has stopped changing: heat flows in at some places and out at others, but no point gains or loses any. Its solutions, the harmonic functions, have the mean-value property: the value at any point equals the average over any circle about it that lies inside the region. On a grid the equation becomes the rule that every point is the average of its four neighbours. It is the first problem Fourier works through with his series in the Analytical Theory of Heat (1822): a plate of infinite length, its end held at the temperature of boiling water and both sides at that of ice, in its final, unchanging state.
What each symbol means
u- the steady temperature, °C
T- an edge's fixed temperature: Tt, Tr, Tb, Tl for the top, right, bottom and left
N- the number of grid squares along a side; the grid spacing is 1/N of the side
W- the number of walkers released at P
Problem solved in full
-
How many sweeps would a fine grid need? 4 steps
The 20 × 20 grid needs 485 Jacobi sweeps, from cold, before the centre of the plate stays within 0.1 °C of 25. How many would a 1,000 × 1,000 grid need? Press Hot top, P at the centre: the page prints the 485.
-
From a cold start, the error that lasts longest is the smoothest pattern, sin πx sin πy, and each sweep multiplies it by cos(π/N). With the top at 100, that pattern's size at the centre is 400/π² on a fine grid, and within half a percent of it at N = 20:
-
It has to shrink to 0.1 °C, so the number of sweeps s solves 40.53 cos(π/N)s = 0.1. On the 20 × 20 grid this gives the page's count:
-
On a 1,000 × 1,000 grid cos(π/N) is much closer to 1:
-
Each sweep updates 999² interior points:
Answer
About 1.22 million sweeps, some 1.2 × 10¹² updates of a single point. That is about 2,500 times the 485 for a grid 50 times finer, the square of the ratio, which is why large grids are not solved by plain Jacobi sweeps alone.
-
Learning path
The heat, wave and Laplace equations
References (2)
- Fourier's first worked example of his method: the permanent temperatures of a rectangular plate of infinite length, its base held at the temperature of boiling water and its two sides at that of ice (Arts. 163–165), solved as a series whose terms are e^(−kx) cos ky with the coefficients found by expanding 1 in cosines (Arts. 171–190): J. Fourier, The Analytical Theory of Heat, translated with notes by A. Freeman, Cambridge University Press, 1878 (Théorie analytique de la chaleur, 1822), Chapter III, Arts. 163–165, pp. 131–133, and Art. 190, p. 154.
- The random-number generator the walkers use, transcribed into the page from the authors' reference C and checked against it output for output: D. Blackman and S. Vigna, xoshiro128** 1.1, reference implementation in C (public domain), 2018, https://prng.di.unimi.it/xoshiro128starstar.c.