Article
Probability · Statistical Physics · ⏱ ≈ 13 хв читання

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 τ:

1D discrete random walk: X(t) = δ · Σᵢ ξᵢ where ξᵢ ∈ {−1, +1} each with p=½ Statistics: E[X(t)] = 0 (unbiased) Var[X(t)] = δ² · N = δ² · t/τ Brownian motion (limit δ→0, τ→0, δ²/τ = 2D fixed): B(t): continuous, nowhere differentiable B(0) = 0 B(t) − B(s) ~ Normal(0, 2D(t−s)) for t > s Increments on non-overlapping intervals are independent

2. Einstein's Diffusion Coefficient

Einstein linked the diffusion coefficient to molecular properties via the Einstein-Smoluchowski-Stokes relation:

Einstein (1905): D = k_B T / γ where: k_B = 1.380 × 10⁻²³ J/K (Boltzmann constant) T = temperature [K] γ = drag coefficient [N·s/m] For a sphere of radius r in fluid of viscosity η (Stokes drag): γ = 6πηr Einstein-Stokes diffusion coefficient: D = k_B T / (6πηr) Example: 1 μm particle in water at 25°C: η = 8.9×10⁻⁴ Pa·s, r = 0.5×10⁻⁶ m D = (1.38e-23 × 298) / (6π × 8.9e-4 × 0.5e-6) D ≈ 4.9 × 10⁻¹³ m²/s → in 1 s: √(2Dt) ≈ 1 μm displacement

3. The Langevin Equation

Langevin (1908) wrote Newton's second law for a Brownian particle explicitly:

m · dv/dt = −γ·v + F_stochastic(t) Stochastic force properties: ⟨F(t)⟩ = 0 (zero mean) ⟨F(t)·F(t')⟩ = 2γk_BT · δ(t−t') (white noise, fluctuation-dissipation) Overdamped limit (inertia negligible, most colloidal biology): γ·(dx/dt) = F_external(x) + √(2γk_BT) · ξ(t) ξ(t) ~ N(0,1) white noise Or in SDE notation: dX = μ(X,t)·dt + σ·dW(t) μ = F_ext / γ (drift) σ = √(2D) (diffusion coefficient = noise amplitude)

4. Wiener Process and Itô Calculus

Wiener process W(t): W(0) = 0 dW(t) ~ Normal(0, dt) i.e. dW = √dt · N(0,1) dW² = dt (quadratic variation, non-zero unlike smooth functions!) Itô's lemma — chain rule for stochastic functions: If dX = μ dt + σ dW, and f(X,t) is smooth, then: df = (∂f/∂t + μ·∂f/∂X + ½σ²·∂²f/∂X²) dt + σ·∂f/∂X dW Key difference vs ordinary calculus: the extra ½σ²·f'' term comes from (dW)² = dt, which is NOT negligible at stochastic level. Euler-Maruyama (simplest SDE integrator): X(t+dt) = X(t) + μ(X,t)·dt + σ·√dt·N(0,1) Order ½ strong convergence.

5. Mean-Squared Displacement

Free diffusion: MSD(τ) = ⟨|r(t+τ) − r(t)|²⟩ = 2d·D·τ (d = spatial dimension) Log-log plot: straight line slope 1 → normal diffusion Anomalous diffusion: MSD ∝ τ^α α < 1 → subdiffusion (crowded environments, membranes) α > 1 → superdiffusion (active particles, Lévy flights) With an external force F (harmonic trap κ·x): dX/dt = −(κ/γ)·X + √(2D)·ξ(t) ← Ornstein-Uhlenbeck process MSD(τ) = (2k_BT/κ)(1 − e^(−κτ/γ)) → saturates at 2k_BT/κ

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:

Fokker-Planck (equivalent deterministic PDE to Langevin SDE): ∂P/∂t = −∂/∂x [μ(x)·P] + D·∂²P/∂x² For free diffusion (μ=0): ∂P/∂t = D·∂²P/∂x² ← diffusion equation! Solution (starts at x=0, t=0): P(x,t) = 1/√(4πDt) · exp(−x²/(4Dt)) Width σ = √(2Dt) grows as √t Steady-state in harmonic trap: P_∞(x) ∝ exp(−κx²/(2k_BT)) ← Boltzmann distribution ✓

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.

⚛️ Open Molecular Dynamics →