There is a peculiar satisfaction in watching a pile of sand grains topple. Drop one grain onto an Abelian sandpile and, most of the time, nothing dramatic happens. But occasionally that single grain triggers an avalanche that propagates across the entire grid — a cascade whose size distribution follows a power law with no characteristic scale. This is self-organised criticality (SOC): a system that tunes itself to the edge of chaos without any external fine-tuning. It was proposed by Per Bak, Chao Tang, and Kurt Wiesenfeld in 1987, and it remains one of the most quietly radical ideas in statistical physics. Wave 105 brings SOC to your browser — alongside 29 other simulations that are equally unlikely to appear in a standard undergraduate course.
Physics at the Edge of Order: SOC, Spin Glass & Josephson Junctions
Abelian Sandpile and Self-Organised Criticality
The Abelian sandpile model lives on a 2D integer grid. Each cell holds a number of grains. When a cell exceeds a threshold — typically 3 for a square lattice — it topples, distributing one grain to each of its four neighbours:
if grid[x][y] >= 4:
grid[x][y] -= 4
grid[x+1][y] += 1
grid[x-1][y] += 1
grid[x][y+1] += 1
grid[x][y-1] += 1
The model is called Abelian because the final stable state is independent of the order in which topplings are applied — a non-obvious algebraic fact that gives the system a rich group structure. The emergent fractal patterns generated by dropping millions of grains onto a single central cell are striking: nested triangles, diamond rings, and fine-grained interference fringes that look almost crystalline, despite arising from purely local rules. Our simulation lets you seed the pile interactively and watch the avalanche statistics accumulate in real time.
Spin Glass: Frustration and Disorder
A spin glass is a magnetic material in which competing ferromagnetic and
antiferromagnetic interactions create frustration — no spin configuration can
simultaneously satisfy every bond. The Edwards-Anderson model captures this on a 2D grid
by assigning each bond Jij a random sign drawn from
±1. The energy of a configuration is:
E = -∑_⟨ij⟩ J_ij · s_i · s_j
where the sum runs over nearest-neighbour pairs. Minimising this energy at low temperature is notoriously hard — the problem is NP-complete in three dimensions. The simulation uses Metropolis-Hastings Monte Carlo with a slow annealing schedule so you can observe the system freezing into one of its many metastable states. Spin glasses are the conceptual ancestor of Hopfield networks and modern machine learning energy landscapes, so this is not merely an academic curiosity.
Josephson Junction: RSJ Model
When two superconductors are separated by a thin insulating barrier, Cooper pairs tunnel
quantum-mechanically — the Josephson effect. The resistively shunted junction (RSJ)
model treats the junction as a capacitor, resistor, and nonlinear inductor in parallel.
The dynamics of the gauge-invariant phase difference φ across the
junction obey:
C · d²φ/dt² + (1/R) · dφ/dt + I_c · sin(φ) = I_bias
This equation is formally identical to a driven, damped pendulum — a fact that makes it
an ideal pedagogical bridge between classical mechanics and quantum transport. Above the
critical current I_c the junction switches from a zero-voltage state to an
oscillating state, emitting microwave radiation at a frequency
f = 2eV/h — the basis of the Josephson voltage standard, the most precise
realisation of the volt in metrology. The simulation plots the I-V curve and
the phase-space portrait simultaneously.
Quantum Matter and Ultralow-Temperature Physics
Bose-Einstein Condensate: Gross-Pitaevskii Equation
When a dilute gas of bosons is cooled to within nanokelvins of absolute zero, a
macroscopic fraction of atoms collapses into the same quantum ground state. The
collective behaviour of this condensate is described by a single complex wavefunction
ψ(r, t) governed by the Gross-Pitaevskii equation (GPE):
iℏ ∂ψ/∂t = [-ℏ²/(2m) ∇² + V(r) + g|ψ|²] ψ
The nonlinear term g|ψ|² encodes mean-field contact interactions
between atoms. The GPE supports quantised vortices — topological defects where the phase
of ψ winds by 2π — which are the hallmark of
superfluidity. Our 2D simulation solves the GPE using split-operator time-stepping on a
uniform grid, making it possible to observe vortex nucleation, soliton propagation, and
the interference fringes that appear when two condensates overlap. This is the same
physics that earned Cornell, Ketterle, and Wieman the 2001 Nobel Prize — and it runs in
your browser tab.
All wave-function probabilities are rendered in perceptually uniform colour maps, with the phase encoded as hue and the density as brightness, giving an immediate visual read of the quantum state without any prior knowledge of complex numbers.
Geometry, Fractals & Psychoacoustics
Penrose Tiling by Inflation
Penrose tilings tile the plane with five-fold rotational symmetry — a pattern
categorically forbidden by the classical crystallographic restriction theorem. They were
discovered by Roger Penrose in 1974 and anticipate the experimental discovery of
quasicrystals by Dan Shechtman a decade later (Nobel Chemistry 2011). The
inflation algorithm generates a tiling recursively: start with a small patch of
kite and dart tiles, then repeatedly subdivide each tile according to fixed substitution
rules, scaling up the lattice at each step by the golden ratio φ = (1+√5)/2.
The simulation runs the inflation algorithm in the browser and lets you zoom into the self-similar structure. Because the tiling is aperiodic, you will never find a translational repeat unit — yet it is not random. It has long-range orientational order detectable in its diffraction pattern, which shows sharp Bragg peaks arranged with icosahedral symmetry.
Apollonius Gasket: Recursive Circle Packing
Given three mutually tangent circles, Apollonius of Perga showed in 200 BCE that there are exactly two circles tangent to all three. If you repeatedly apply this construction to every new triple of tangent circles, you obtain an Apollonius gasket — a fractal with Hausdorff dimension approximately 1.3057. The curvatures of all circles in any integer Apollonius packing satisfy Descartes's Circle Theorem:
(k₁ + k₂ + k₃ + k₄)² = 2(k₁² + k₂² + k₃² + k₄²)
where k = 1/r is the curvature (reciprocal of radius). If the four initial
curvatures are integers, every circle in the gasket has integer curvature — a number-
theoretic miracle that connects classical geometry to the theory of quadratic forms and
the Apollonian group in arithmetic. The simulation renders thousands of circles in a
single frame using recursive descent with early culling for circles below pixel size.
Shepard Tone: The Infinite Staircase of Sound
A Shepard tone is an auditory illusion: a sound that appears to rise (or fall) in pitch indefinitely, yet never actually gets higher or lower. It is constructed by superposing sine waves at octave intervals, with a bell-shaped amplitude envelope in log-frequency space. As each component fades in at the bottom of the spectrum and fades out at the top, the perceived pitch spirals ever upward without bound — the acoustic equivalent of an Escher staircase.
The simulation visualises the spectral envelope and the instantaneous phase of each partial in real time using the Web Audio API and a Canvas 2D waterfall display. You can adjust the rate of ascent, the bandwidth of the envelope, and the number of partials, making the underlying illusion mechanism transparent. Shepard tones appear in film scores — notably Christopher Nolan's Dunkirk and The Dark Knight Rises — to create a subliminal sense of relentless escalation.
Rendering note: All 30 Wave 105 simulations target Canvas 2D rather than WebGL. This was a deliberate choice: Canvas 2D runs everywhere, including low-power tablets and older Android phones, and for grid-based and geometry-based simulations the 2D API is often faster to iterate than shader code. Performance budgets are 16 ms per frame; simulations that exceed this on a mid-range device fall back to a reduced grid resolution automatically.
Try It Yourself
The best way to build intuition for these models is to break them. Try cranking the bias current past the critical point in the Josephson junction and watch the I-V curve snap from zero-voltage to finite-voltage. Seed the sandpile asymmetrically and see whether the fractal boundary remains symmetric. Stir the condensate with a moving obstacle potential and count the quantised vortices that nucleate. Here are three simulations to start with:
The full Wave 105 catalogue — all 30 simulations — is browsable via the category index. Each simulation page includes a mathematical overview, parameter controls with labelled units, and a link to the primary literature so you can go deeper if the browser window is not enough.
What Comes Next
Wave 105 closes out the current sprint. The models in this wave sit at the intersection of condensed matter, number theory, and perception science — domains that rarely share a syllabus but share more mathematics than their practitioners usually admit. The Josephson junction equation and the pendulum are the same differential equation. The Apollonius gasket and the theory of automorphic forms are, in a precise sense, the same structure. The sandpile group and abstract algebra are closer relatives than anyone who took a separate course in each would expect.
Wave 106 is already in planning. The target themes are reaction-diffusion systems on non-Euclidean surfaces, epidemiological metapopulation models with real mobility data, and a revisit of the double pendulum with Lyapunov exponent heat maps. If you have a simulation you would like to see — or a model you think is underrepresented in browser science education — the contact page is always open. The goal is not to replicate what you can find in a textbook. It is to make the things the textbooks leave as exercises actually run, in front of you, right now.