Brownian Motion & the Langevin Equation — Stochastic Dynamics
Robert Brown's 1827 observation of pollen grains jittering in water led to one of the most productive theoretical threads in physics. Einstein's 1905 paper turned it into a proof of atoms; Langevin's 1908 equation gave a mechanical model; Wiener's mathematics (1920s) provided rigorous foundations. Today Brownian motion — a continuous-time random walk — underlies financial models, polymer physics, molecular dynamics, and MCMC sampling algorithms.
1. From Random Walk to Brownian Motion
The simplest model: at each step of size δ, the particle moves ±1 with equal probability. After N steps with time increment τ:
2. Einstein's Diffusion Coefficient
Einstein linked the diffusion coefficient to molecular properties via the Einstein-Smoluchowski-Stokes relation:
3. The Langevin Equation
Langevin (1908) wrote Newton's second law for a Brownian particle explicitly:
4. Wiener Process and Itô Calculus
5. Mean-Squared Displacement
6. Fokker-Planck Equation
Instead of trajectories, we can track the probability density P(x,t) of finding the particle at x at time t:
7. JavaScript Langevin Simulator
// Box-Muller transform for Gaussian noise
function gaussianRandom() {
let u, v, s;
do {
u = Math.random() * 2 - 1;
v = Math.random() * 2 - 1;
s = u*u + v*v;
} while (s >= 1 || s === 0);
return u * Math.sqrt(-2 * Math.log(s) / s);
}
/**
* Euler-Maruyama integration of overdamped Langevin equation:
* dX = drift(X) dt + sqrt(2D) dW
* @param {number} D - diffusion coefficient [m²/s]
* @param {number} T - total time [s]
* @param {number} dt - timestep [s]
* @param {function} drift - optional external force / gamma [m/s]
* @returns {Float64Array} trajectory x values
*/
function langevin1D(D, T, dt = 1e-4, drift = () => 0) {
const N = Math.ceil(T / dt);
const x = new Float64Array(N);
const sqrtDt = Math.sqrt(2 * D * dt);
x[0] = 0;
for (let i = 1; i < N; i++) {
x[i] = x[i-1] + drift(x[i-1]) * dt + sqrtDt * gaussianRandom();
}
return x;
}
// Compute MSD from a set of trajectories
function computeMSD(trajectories, maxLag) {
const nTraj = trajectories.length;
const msd = new Float64Array(maxLag);
for (const traj of trajectories) {
for (let lag = 1; lag <= maxLag; lag++) {
let sum = 0;
const count = traj.length - lag;
for (let i = 0; i < count; i++) {
const dx = traj[i+lag] - traj[i];
sum += dx * dx;
}
msd[lag-1] += sum / count;
}
}
return msd.map(v => v / nTraj);
}
// Example: free diffusion
const D = 1e-12; // m²/s, ≈ 1 μm particle water
const dt = 0.01; // 10 ms timestep
const trajs = Array.from({length:100}, () => langevin1D(D, 10, dt));
const msd = computeMSD(trajs, 200);
// msd[i] should equal 2*D*(i+1)*dt (Einstein relation check)
console.log(`MSD[10dt] measured: ${msd[9].toExponential(2)}`);
console.log(`MSD[10dt] expected: ${(2*D*10*dt).toExponential(2)}`);
// Example: Ornstein-Uhlenbeck (harmonic trap)
const kappa = 1e-6; // trap stiffness
const gamma = 1e-8; // drag
const ouTraj = langevin1D(D, 10, dt, x => -(kappa/gamma) * x);
8. Applications
Financial Models
Black-Scholes uses geometric Brownian motion dS = μS dt + σS dW. Ornstein-Uhlenbeck models mean-reverting interest rates (Vasicek model). MCMC samples from complex posteriors.
Molecular Dynamics
Langevin thermostat maintains temperature in MD simulations. Coarse-grained particle dynamics (CGMD) use D from Einstein-Stokes for implicit solvent.
Polymer Physics
Rouse and Zimm models treat polymers as beads connected by springs, each bead undergoing Brownian motion. Predicts viscosity-molecular-weight scaling.
Biophysics
Single-particle tracking measures D of receptors in cell membranes. MSD slope reveals confinement, directed transport, or anomalous subdiffusion in crowded cytoplasm.