Brownian Motion

Every molecule of this liquid is simulated on your GPU. Nothing in the code is random, yet the beads jiggle, because molecules keep hitting them.

Drag a bead through the liquid

Starting the simulation…
How far the beads wander mean squared displacementballistic, 2kT/M·t²diffusive, 4Dt
Liquid temperature
—
Bead temperature
—
Diffusion
—
Time steps
—

Published

October 15, 2026

Liquid

Molecular dynamics on WebGPU

Experiment

After Brown (1827), Einstein (1905) and Perrin (1909)

In the summer of 1827 the botanist Robert Brown put pollen of the wildflower Clarkia pulchella in water and looked at it under his microscope. Tiny particles from inside the grains were moving, in small jerks, and they never stopped [1]. Above, every molecule of a liquid is simulated: about 14,000 grey discs. The program draws no random numbers after it places them, yet the five magenta beads jiggle like Brown's particles, because molecules keep hitting them.

What Brown saw

Brown first suspected the particles were alive. Then he found the same motion in pollen that had been dried for a century, in powdered glass and minerals, and in dust from a fragment of the Sphinx. Whatever moved them was not life, and for decades nobody knew what it was.

The answer is that a liquid is made of molecules in constant motion, and a small particle is hit by them from every side. The hits never quite balance: at any instant more of them push one way than the other, so the particle moves a little, and a moment later it is pushed somewhere else. In 1905 Einstein worked out what this predicts [2], and from 1908 Jean Perrin tested it under the microscope with tiny spheres of gamboge resin [3].

The simulation

A molecule repels any other molecule that comes closer than about its own diameter, and otherwise moves in a straight line (this is the repulsive part of the Lennard-Jones potential, as used by Weeks, Chandler and Andersen [4]). The beads repel molecules the same way at their surface. At every time step the GPU adds up the forces on each molecule and bead and moves it by Newton's laws, using the leapfrog method common in molecular dynamics. To find each molecule's neighbors quickly, the molecules are sorted into a grid of cells about one molecule wide.

Lengths here are in molecule diameters, σ, and times in τ, roughly the time a molecule takes to cross its own width. If the molecules were argon atoms, σ would be 0.34 nm, τ would be 2.2 picoseconds, and a time step (0.005 τ) would be 11 femtoseconds. At normal speed, one second on this page is about 200 picoseconds in the liquid (the speed slider shows it).

Slow it down to watch single molecules hit each other and the beads. At normal speed the molecules blur and the beads' wandering shows.

A bead is a big molecule

Statistical mechanics predicts that in a liquid at temperature \(T\), every body has on average the same kinetic energy, \(kT/2\) for each direction it can move. This is called equipartition. A bead weighs as much as the liquid it displaces, 35 molecules, so its typical speed is \(\sqrt{35} \approx 6\) times lower than a molecule's, but its kinetic energy is the same. The readouts show both energies as temperatures: the liquid's from the molecules' speeds, the beads' from \(\tfrac12 M\langle v^2\rangle\). Over a run of 50,000 τ the beads measured 0.997 ± 0.002, against 1.000 for the liquid. Heat the liquid and the beads heat up with it.

Einstein thought a Brownian particle's speed could never be measured, because the particle changes direction too quickly. In 2010 Raizen's group measured it for a glass bead held in air by laser light, and the speeds matched this prediction [5].

From flights to a random walk

The chart below the simulation shows how far the beads move on average in a given time: the mean squared displacement \(\langle \Delta r^2 \rangle\) against the time lag \(t\), on log scales. Over short times a bead coasts, so \(\langle \Delta r^2 \rangle = (2kT/M)\,t^2\). That is the dashed line, and it has no fitted numbers. After a few τ the molecules have knocked the bead off course many times, and the displacement grows like a random walk:

$$\langle \Delta r^2 \rangle = 4Dt$$

in two dimensions (the dotted line), where \(D\) is the diffusion coefficient. The trails mark each bead's position every 50 τ, joined by straight lines, the way Perrin drew his particles' positions every 30 seconds.

Jiggle and drag

Drag a bead through the liquid and it lags behind the pointer, because the liquid resists. Einstein's insight was that this resistance and the jiggle come from the same collisions, so they are tied together. If a constant force \(F\) makes a bead drift at speed \(v = F/\gamma\), then

$$D = \frac{kT}{\gamma}$$

This is the Einstein relation. We measured both sides in this simulation. Pulling one bead at a time with a constant force (\(F = 0.5\) in the molecules' units, 20 pulls of 4,000 τ each) gave \(\gamma = 6.5 \pm 0.3\); half that force gave the same within the error (\(6.0 \pm 0.4\)). Watching the five beads jiggle freely for 50,000 τ gave \(D = 0.150 \pm 0.013\), from the slope of \(\langle \Delta r^2 \rangle\) between 300 and 3,000 τ. The product \(D\gamma\) is \(0.97 \pm 0.10\), against \(kT = 1.00\) for the liquid.

Perrin used the relation the other way round. For a sphere of radius \(a\) in a liquid of viscosity \(\eta\), Stokes's law gives \(\gamma = 6\pi\eta a\), so from how far his gamboge spheres wandered he could compute \(kT\), the energy of a single molecule. The gas constant \(R\), known from measurements on gases, divided by \(k\) is the number of molecules in a mole. Perrin found between 6 and 7 × 10²³ (today's value is 6.022 × 10²³), and with it convinced the remaining skeptics that atoms are real. He received the 1926 Nobel Prize in Physics.

Where this liquid differs

This liquid is two-dimensional, which changes one thing. A moving bead drags a swirl of liquid with it, and in two dimensions the swirl fades slowly, so the bead remembers its velocity for a long time: the memory decays as \(1/t\). Alder and Wainwright discovered these long-time tails in 1970, in computer simulations of discs much like these [6]. They make the paths here smoother than a real particle's over tens of τ, and \(\langle \Delta r^2 \rangle / 4t\) keeps creeping up: 0.089 at 100 τ, 0.115 at 300 τ, 0.138 at 1,000 τ and 0.147 at 3,000 τ. Because \(D\) and \(\gamma\) were measured in the same box, the Einstein relation still holds. In three dimensions the memory fades as \(t^{-3/2}\), and real particles settle into the random walk Einstein described.

The scales also differ. Perrin's grains were a few thousand molecules across and billions of times heavier than a molecule, and between his sketches, 30 seconds apart, each was knocked off course countless times. These beads are 8 molecules across and 35 times heavier, so the simulation can show both the coasting and the random walk in one picture.