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.
The walk and its statistics
45 s of draw, in real timePlayback 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- Predicted standard deviationσ
- 300 µm
- Observed mean squared displacementMSD
- 80 200 µm²
- Molecules within the field±3σ
- 399 of 400
- Displayed instantt
- 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)
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 log
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.