Swift–Hohenberg: how stripes and spots appear from noise

pattern formation · PDE · C · spectral solver · Nov 2026

Heat a thin layer of fluid from below and, past a threshold, it stops being flat: it breaks into rolls, into hexagons, into something. There is no blueprint for the pattern — it is the same equations everywhere, and the layout is selected by the dynamics. The Swift–Hohenberg equation is the canonical toy model for that: one scalar field, one PDE, and it spontaneously grows stripes, spots and grain boundaries.

∂u/∂t  =  ε u − (1 + ∇²)²u − u³
ε > 0 is the distance from threshold (the "temperature").

The trick is the operator (1 + ∇²)². Written in Fourier space it is (1 − k²)², so a mode of wavenumber k grows only near k = 1 and every other scale is damped. Turn up ε and a narrow ring of wavelengths is amplified from tiny random fluctuations; the cubic −u³ then saturates them to a finite amplitude. Which waves win, and at what angles, is the whole pattern.

Swift-Hohenberg roll pattern full field

ε = 0.10, started from pure white noise, after 1200 steps. Gold is u > 0, blue is u < 0. Adjacent bands of rolls meet at grain boundaries; the little knots are dislocations — the signature texture of the equation.

Watching it grow

This is the same run from the first instant: structureless grey noise, then pinpoints of contrast, then a field of rolls that coarsens and settles. Scrub it.

Swift-Hohenberg growth frame
step 0
loading…

26 frames, one every 20 steps, from step 0 (pure noise) to step 500.

Swift-Hohenberg concentric target from a seed
Raise ε to 0.30 and drop a single bright seed at the centre: it nucleates perfect concentric rings that march outward — a target. A point defect, grown from nothing.
Swift-Hohenberg rolls close crop
The same noise-driven rolls, unseeded. No centre, no direction: the field chooses many domains and they argue along their walls.

How I solved it

back to the lab · source: ~/src/sh.c