Loading the engineShared by all simulations, so the next one opens instantly.
The physics

In 1827 the botanist Robert Brown watched pollen particles in water jitter without pause and could not explain it. Albert Einstein did in 1905: the particle is hit by water molecules from all sides, the hits never quite cancel, and their sum is a random walk whose spread grows with the square root of time. He also showed how fast it spreads, D=kBT/γ, linking the visible jitter to the temperature and the friction of the liquid. Jean Perrin measured D for tiny resin spheres in 1908, obtained Avogadro’s number from it, and with that settled the debate over whether atoms exist.

What you see

Colored tracer particles in an 800 by 800 pixel box whose edges wrap around. Each one draws its last 600 positions, 150 frames, as a fading trail. The molecules themselves are not drawn: their effect is the random kicks. The label in the corner shows the diffusion coefficient.

All tracers start at random positions and move independently. Their paths are rough at every scale, with no straight stretches: zoom into a piece of a trail and it looks like the whole.

Equation

For a small particle in a liquid, friction removes any velocity within a microsecond, so its motion is overdamped: the position takes a random step each time step Δt,

𝐱(t+Δt)=𝐱(t)+2DΔt𝝃,D=kBTγ,

where 𝝃 is a vector of two independent standard normal numbers. Steps are drawn four times per frame, and the time unit is one frame. A single step has no memory of the last, so the mean squared distance from the start grows linearly in time,

⟨|𝐱(t)−𝐱(0)|2⟩=4Dt

in two dimensions. Measured over 10 seconds (600 frames) with D=1 px² per frame, the tracers moved 47 px rms, against 49 px from the formula.

Temperature and friction enter only through their ratio: doubling both changes nothing. Inertia is left out, which is exact on the time scales shown.

Presets

Room temperature: kBT=1, γ=1, 50 tracers, also the default. D=1 px² per frame: a typical tracer wanders about 50 px in 10 seconds and 120 px in a minute.

Hot bath: kBT=5. Five times the diffusion coefficient: the trails cover about 5≈2.2 times the distance in the same time (106 px in 10 seconds, measured).

Viscous liquid: γ=4, 30 tracers. A quarter of the diffusion coefficient: the tracers tremble in place and cover half the distance of the default.

Five tracers: γ=0.5. D=2 px² per frame, five well separated paths that are easy to follow.

Parameters

Thermal energy kT: the temperature in the simulation’s units, 0.01 to 5.

Friction γ: the drag coefficient, 0.1 to 5. Only D=kBT/γ matters for the motion.

Tracers: 1 to 100 independent particles; applies on Reset.

Trail length: how many past positions each trail keeps, 10 to 600, which is 2.5 to 150 frames.

Temperature and friction apply immediately.