Skip to content
CALX
Appearance

Appearance

Light or dark

Colour
Accessibility

Brownian diffusion simulator (1D random walk)

Simulated 1D Brownian diffusion: seeded random walkers, histogram against the Gaussian N(0, 2Dt), 2σ envelope, mean squared displacement tracked.

Brownian walk

The medium
m²/sExample value, replace it with your own: D of your species in your medium, in m²/s (1e-9 notation accepted).
The release
From 1 to 1000, all released at x = 0 at t = 0.
sWhole seconds, from 1 to 60.
Chance
An integer; the same seed gives the same draw.

The walk and its statistics

45 s of draw, in real time
1D Brownian walk · entered D = 1 × 10⁻⁹ m²/s400 molecules released at x = 0 · seed 20260823t = 45 sMSD/2Dt = 0.891−5000500position (µm)2σ05001000countN(0, 2Dt)0102030050 000time (s)MSD (µm²)2Dt√(2Dt) = 300 µmMSD = 80 200 µm²±3σ: 399/400
t = 45 s

Playback runs in real time and only pushes the cursor: the whole draw is made at once from the displayed seed, rewinding or replaying shows the same realisation.

Predicted standard deviation
σ = √(2Dt) = √(2 × 1 × 10⁻⁹ m²/s × 45 s) = 300 µm
Mean squared displacement
MSD = (1/n)·Σ xᵢ² = 80 200 µm², over 400 molecules
Invariant
MSD/2Dt = 80 200 µm² ÷ 90 000 µm² = 0.891 (expected: 1)
Note

The histogram widens according to N(0, 2Dt); the MSD follows the 2Dt line.

the draw: three sample walks, the histogram, MSDthe law: the ±2σ envelope, the density N(0, 2Dt), the 2Dt linethe current instant and the labelled invariant

Result

continuous computation
The invariant of the draw
MSD/2Dt0.891at t = 45 s, expected 1
Predicted standard deviation
300 µm
Observed mean squared displacement
80 200 µm²
Molecules within the field
399 of 400
Displayed instant
45 s

Calculation, assumptions and sources

Provisional · Physical model · reviewed on 25 August 2026

OverviewMolecules released at x = 0 follow independent 1D random walks, drawn from a fixed seed.

Molecules released at x = 0 follow independent 1D random walks, drawn from a fixed seed. The histogram of positions is compared with the Gaussian N(0, 2Dt), of standard deviation √(2Dt), together with the ±2σ envelope and the mean squared displacement divided by 2Dt, expected to be 1. The diffusion coefficient D is an input.

Method & formulasx(t + Δt) = x(t) + ξ, ξ drawn from N(0, 2·D·Δt)
x(t + Δt) = x(t) + ξ, ξ drawn from N(0, 2·D·Δt)density of positions: N(0, 2Dt), exact at every stepσ(t) = √(2Dt)expected MSD = 2Dt, invariant MSD/2Dt expected to be 1

At each step, every molecule receives an independent Gaussian increment of variance 2·D·Δt. Variances add: the position at time t follows N(0, 2Dt), with no discretisation error. The mean squared displacement of the draw (MSD), divided by 2Dt, fluctuates around 1.

Brownian motion
the erratic walk of a particle under the random collisions of its medium.
Diffusion coefficient (D)
the coefficient of the law N(0, 2Dt), in m²/s; it depends on the species and the medium.
Mean squared displacement (MSD)
the average of the squared positions of the draw; its expectation is 2Dt.
2σ envelope
the positions ±2√(2Dt), between which the law places about 95% of the molecules.
Seed
the integer that fixes the pseudo-random sequence of the draw; the same seed gives the same draw on any machine.
AssumptionsHomogeneous, still and unbounded medium.
  • Homogeneous, still and unbounded medium.
  • Non-interacting molecules; D constant in time and space.
  • Gaussian increments at a fixed time step.
Validity domain4 validity limits; the calculation refuses values outside 4 of them

A flow adds bulk transport, a wall truncates the Gaussian, interactions deform it. A few hundred walks are enough for an order of magnitude, not for inference on real data.

  • d ≥ 0physical · refusal

    The diffusion coefficient must be strictly positive.

    Instead · Enter the D of the species in its medium, in m²/s (1e-9 notation accepted).

  • 1e-24 ≤ d ≤ 1practical · refusal

    Display range, not physical: from 10⁻²⁴ to 1 m²/s.

    Instead · At equal seed, changing D only changes the axis graduation, since σ = √(2Dt).

  • 1 ≤ n ≤ 1000practical · refusal

    From 1 to 1000 molecules; beyond that, recomputing on every keystroke would take too long.

    Instead · A few hundred molecules are enough for the Gaussian to appear; compare n = 30 and n = 1000 at equal seed.

  • 1 ≤ t ≤ 60practical · refusal

    Simulated duration between 1 and 60 whole seconds.

    Instead · The envelope grows as √t. For a wider spread, increase D.

Scientific validationProvisional, reviewed on 25 August 2026

The law N(0, 2Dt) follows from the model; no reference is cited and no value of D is supplied. A convergence test compares MSD/2Dt, averaged over thousands of walks, with 1. A diffusion coefficient is measured from the slope of the MSD against time, which equals 2D. On the lower panel, D is half the slope of the 2Dt line.

Scope and limitations

  • The mulberry32 pseudo-random generator (32-bit state) has an envelope measured up to a few million draws per computation; it is neither cryptographic nor designed for precision Monte-Carlo.
  • The grey bundle of the n walks is a visual aid, drawn on the time and position axes and not exported.

Provisional · Sources and assumptions are provided; the documentary review is incomplete.

Physical model. Conventional display to 3 decimal places.

revision 1 · reviewed on 25 August 2026

Revision log

  1. revision 1 · 2026-08-25 · scope change

    Tool created: seeded 1D Brownian walk, histogram of positions compared with N(0, 2Dt), 2σ envelope, MSD/2Dt ratio at every instant.

    No previous value.