~/simulations

Interactive physics and mathematical simulations — all running live in the browser.

Double Pendulum

A classic example of deterministic chaos. Two coupled pendulums whose motion is governed by the Lagrangian equations of motion and integrated with RK4. Tiny differences in initial conditions lead to exponentially diverging trajectories.

400
9.81

Boids Flocking

Craig Reynolds' 1987 emergent flocking algorithm. Each agent follows three simple local rules — separation, alignment, and cohesion — yet complex, lifelike flocking behaviour arises from the whole.

25
50
50
3

Gray-Scott Reaction Diffusion

Two chemical species U and V react and diffuse on a 2D grid. Depending on the feed rate F and kill rate k, the system self-organises into spots, stripes, mazes, or travelling waves — a model of biological pattern formation.

Random Walk

A discrete random walk on a lattice in 1, 2, or 3 dimensions. At each step the walker moves to a uniformly chosen neighbour. By Pólya's theorem the walk is recurrent in 1D and 2D (it will almost surely return to the origin) but transient in 3D. Watch the RMS displacement track the theoretical √N diffusion law.

1
20×
Steps taken
/ 5,000 max
RMS displacement
theoretical √N = —
Max displacement
furthest any walker reached
Near origin
walkers within 1 unit of start
Recurrence
Certain
P(return) = 1
Diffusion regime
Normal
⟨r²⟩ ∝ N  (σ² = t)