The question
A drop of ink is placed in still water. With no stirring and no flow, the ink still spreads: its molecules move from where they are concentrated to where they are not. This is diffusion. It is caused by Brownian motion, the random jostling of every molecule by the water molecules around it.
Let d be the width of the spreading drop. Which curve describes d against time t? (∝ means "is proportional to".)
A: d ∝ t B: d ∝ t² C: d ∝ 1 − e−t D: d ∝ √t
The buttons A, B, C and D above the spread plot fit each curve to the simulation and draw it to the end of the run. Curve C is fitted as 1 − e−t/τ, with the time constant τ chosen by the fit.
The 1D random walk
A molecule can sit only at the points 0, ±a, ±2a, ... (a is the step length). At every time step Δt it moves one step right or one step left, each with probability 1/2, whatever it did before:
x(t + Δt) = x(t) + a with probability 1/2
x(t + Δt) = x(t) − a with probability 1/2
After n steps the time is t = nΔt and the position is the sum of the steps:
xn = Δx1 + Δx2 + Δx3 + ... + Δxn
Mean position
The expected value of a sum is the sum of the expected values, and every step has expected value zero:
E[Δxi] = a(1/2) + (−a)(1/2) = 0 ⇒ E[x(t)] = Σ E[Δxi] = 0
On average a molecule goes nowhere. The plot "Average position against time" shows this.
Variance: how far molecules spread
Because E[x] = 0, the variance is Var[x(t)] = E[x(t)²] − (E[x(t)])² = E[x(t)²]. Squaring the sum gives squared terms and cross terms:
E[x(t)²] = Σi E[Δxi²] + Σi≠j E[Δxi Δxj]
Each squared step is a² whichever way the molecule moved: E[Δxi²] = a²(1/2) + (−a)²(1/2) = a². The steps are independent events, so each cross term splits into E[Δxi] E[Δxj] = 0 × 0 = 0. Therefore, with n = t/Δt,
Var[x(t)] = n a² = t a² / Δt
The table shows both pieces live: "Average of Δx² for the latest step" stays at a², and the cross term stays near 0.
The spread grows as √t
The spread is the standard deviation, the square root of the variance:
σ = √(t a² / Δt) = (a / √Δt) · √t
a/√Δt is a constant, so the spread grows as √t: curve D. It grows fast at first and then more and more slowly, because a molecule keeps stepping back over ground it has already covered.
The diffusion coefficient
The constant D = a²/(2Δt) is called the diffusion coefficient (not to be confused with curve D). With it the results read:
Var[x(t)] = 2Dt σ = √(2Dt) time to spread a distance L: t = L² / (2D)
Twice the distance takes four times as long. Small molecules in water have D of roughly 0.5 to 2 × 10−9 m²/s. With the default a = 1 µm and Δt = 1 ms, the simulation has D = 500 µm²/s = 5 × 10−10 m²/s.
2D and 3D
r is the distance of a molecule from where it started (r² = x² + y² in 2D, x² + y² + z² in 3D). The step rule in Settings decides how a molecule steps:
- Each coordinate moves ±a (default). Every coordinate takes its own independent 1D step, so each coordinate obeys the 1D result Var = n a², and E[r²] = 2 n a² in 2D and 3 n a² in 3D.
- Move ±a along one randomly chosen axis. The molecule jumps to one of its nearest lattice points (4 in 2D, 6 in 3D). Each step adds exactly a² to r², so E[r²] = n a², and each coordinate gets n a² divided by the number of dimensions.
- Move a distance a in a random direction. Again E[r²] = n a².
In every case E[r²] grows in proportion to t, so the spread grows as √t. Only the constant in front changes.
What to look for
- Follow the blue dot. It is one molecule (molecule 1 of the run), picked out from the others only so you can watch it; it moves by exactly the same rules. The blue line is the path it has taken. Its path cannot be predicted, and it loops back over itself many times. Set N = 1 to see it alone, then N = 5000: the average over many molecules follows the prediction closely, although each molecule's path does not.
- The cloud stays centred on the start: the average position stays near 0, inside the grey band of chance variation.
- Watch the orange (measured) circle or sphere grow quickly at first, then slowly. Press A, B, C and D: curve D fits with the smallest gap.
- Tick "Squared distance": the mean squared distance grows as a straight line in t.
- The concentration profile becomes a bell-shaped normal distribution, highest at the start and falling off on both sides. Molecules move from high to low concentration with no force pushing them.
- Double a and the spread doubles. Make Δt four times smaller and the spread at a given time doubles.
- Compare 1D, 2D and 3D: the variance of one coordinate is n a² in every dimension (default rule), and each extra dimension adds n a² to E[r²].
Practical problem: how long does diffusion take?
A dye in still water has the diffusion coefficient D = a²/(2Δt) = 1.0 × 10−9 m²/s.
- Show that the spread is σ = √(2Dt), so the time to spread a distance L is t = L²/(2D).
- How long does the dye take to spread across a cell, L = 10 µm, and across a beaker, L = 1 cm?
- Two streams flow side by side at U = 1 mm/s in a microfluidic channel w = 100 µm wide. How long must the channel be for the dye to spread across its width?
- Repeat (c) for a channel 10 times narrower, w = 10 µm.
Show the solution
(a) From the random walk, Var[x(t)] = t a²/Δt, and the definition of D gives a²/Δt = 2D. So Var = 2Dt and σ = √(2Dt). Spreading a distance L means σ = L, so L² = 2Dt and t = L²/(2D).
(b) Cell: t = (1 × 10−5 m)² / (2 × 1.0 × 10−9 m²/s) = 0.05 s. Beaker: t = (1 × 10−2 m)² / (2 × 1.0 × 10−9 m²/s) = 5 × 104 s, about 14 hours. Going 1000 times farther takes 106 times longer: inside a cell diffusion is fast enough, but a beaker must be stirred.
(c) t = w²/(2D) = (1 × 10−4 m)² / (2 × 1.0 × 10−9 m²/s) = 5 s. In that time the fluid moves Ut = (1 × 10−3 m/s)(5 s) = 5 mm along the channel, so the channel must be about 5 mm long.
(d) t = (1 × 10−5 m)² / (2D) = 0.05 s, so the length is Ut = 50 µm. A channel 10 times narrower needs a time and a length 100 times smaller.
Based on the ChE Analysis 3020 lecture notes on diffusion and the random walk.