Laplace's Equation: a Plate in Steady State

Set the four edges of a square plate and pick a point. The page finds the steady temperature there three ways: from Fourier's series, from a grid relaxed sweep by sweep from cold, and from random walkers released at the point, counting where they leave.

Loading interactive simulation...

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

The temperature at a point is the chance of wandering to the hot edge 🖖

Press Hot top, P three-quarters up. The series puts P at 54.05 °C. Now forget the plate and play a game: start at P, step to one of the four neighbouring grid points with equal chances, and keep going until you reach an edge. Of 20,000 walkers, 10,825 reach the top first, so 54.13% of walkers end at 100 °C and the rest at 0, an average of 54.13 ± 0.35. On the grid the agreement is exact, not approximate: the chance of finishing at the top obeys the same rule as the temperature, each point the average of its four neighbours, with the same values at the edges, and the grid's 53.98 is that chance to the last digit. The walkers find P's temperature without computing any other point's. The bars outside the plate show where they left: most of them near the middle of the top edge, which is closest.

Every point is the average of any circle round it 🖖

Stay on Hot top, P three-quarters up and look at the green circle. Its top is at 89.97 °C and its bottom at 29.46, and halfway between those is 59.71. The average round the whole circle is 54.05, P's own temperature, and it stays 54.05 for any circle about P that fits inside the plate. The grid's rule, each point the average of its four neighbours, is this property in its smallest form. It has a consequence you can check by dragging P anywhere: no point inside can be hotter than every point round it, so the hottest and coldest places on the plate always lie on its edges. The same property of the electric potential is why no arrangement of fixed charges can hold another charge in stable equilibrium in empty space, which Electric Field Visualiser takes up.

Relaxing a plate is heat flowing, so a grid twice as fine takes four times the sweeps 🖖

Press The centre on 10 × 10, then Hot top, P at the centre, then The centre on 40 × 40. The centre comes within 0.1 °C of 25 after 120, 485 and 1,945 sweeps. Replacing every value by the average of its neighbours is exactly one time step of the heat equation, the largest step that grid can take without going unstable, so a Jacobi sweep is a frozen-in-time version of the plate cooling, and it inherits heat's slowness: halve the spacing and each step covers a quarter of the time, so the same cooling takes four times the steps. The walkers pay the same price. Their average trip to an edge is 29.5, 118.0 and 467.6 steps on the three grids. A grid fine enough to be accurate is therefore expensive to relax this way. At the centre the extra sweeps buy no accuracy at all: by the quarter-turn argument every grid's answer there is exactly 25.

Problem solved in full

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

    Open this problem in the tool

    1. 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:

    2. 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:

    3. On a 1,000 × 1,000 grid cos(π/N) is much closer to 1:

    4. 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)