M3.3 7 min read Oct 2026

M3.3 Random Walkers in a Valley: Langevin Dynamics and Stationarity

Builds on2 notes

A valley and a thousand lost walkers

A thousand walkers start together on one side of a foggy valley. Their motion is random but biased downhill, more strongly on steeper slopes.

Where are they an hour later? How would a wider valley, or a flat-bottomed valley with steep sides, change the result?

Downhill motion concentrates walkers; noise spreads them. Can these effects maintain a fixed density without freezing the walkers? First find a law with balanced flux, then ask whether other initial laws approach it.

DiscussionQ1

Represent terrain, downhill preference, random motion, and the proposed long-time distribution mathematically.

Show the reasoning

Let V(x)V(x) be height or potential. The negative gradient −∇V(x)-\nabla V(x) points steeply downhill, with magnitude determined by slope, so it supplies the drift.

Add the noise from M3.1:

dxt=−∇V(xt) dt+2 dWt.dx_t=-\nabla V(x_t)\,dt+\sqrt2\,dW_t .

This is overdamped Langevin dynamics. The conventional coefficient 2\sqrt2 simplifies equilibrium. More generally use 2τ\sqrt{2\tau}, with temperature or noise intensity τ\tau.

A stationary distribution stays unchanged when used as the initial law. Individual particles still move. Existence, uniqueness, and convergence from other starting laws require separate arguments.

Restoring drift versus spreading

In a confining single valley, drift pulls toward lower potential while diffusion spreads the density, as described by M3.2.

A cloud high on a slope first moves downhill. Near the bottom, weaker drift lets noise broaden it, while particles reaching steep slopes are pulled back. Under suitable ergodicity conditions, these effects reach a balance that eventually forgets the starting law.

Widening the potential horizontally weakens its slopes and widens its equilibrium density correspondingly. A narrow valley concentrates it. A flat bottom and rapidly rising sides instead produce a flatter center and thinner tails.

Restoring drift and spreading noise balance according to the valley shape.

Negative potential gradient pulls inward; noise spreads mass. Their zero-flux balance has density proportional to e−Ve^{-V}.

Substitute the candidate into Fokker–Planck

Here f=−∇Vf=-\nabla V and g=2g=\sqrt2, giving

∂tp=∇⋅(p ∇V)+Δp=∇⋅(p ∇V+∇p).\partial_tp=\nabla\cdot(p\,\nabla V)+\Delta p=\nabla\cdot\big(p\,\nabla V+\nabla p\big).

Stationarity requires a zero right-hand side. Guess p∞=e−V/Zp_\infty=e^{-V}/Z, assuming Z=∫e−VdxZ=\int e^{-V}dx is finite. In one dimension:

∂xp∞=−V′ p∞⟹p∞V′+∂xp∞=p∞V′−V′p∞=0.\partial_xp_\infty=-V'\,p_\infty \quad\Longrightarrow\quad p_\infty V'+\partial_xp_\infty=p_\infty V'-V'p_\infty=0 .

The expression inside the spatial derivative vanishes pointwise, so its derivative vanishes and ∂tp∞=0\partial_tp_\infty=0. □\square

The actual probability flux is J=−p∇V−∇pJ=-p\nabla V-\nabla p, because ∂tp=−∇⋅J\partial_tp=-\nabla\cdot J. The displayed expression is −J-J; both vanish for the candidate. Appropriate boundary behavior is also required.

Will it be reached? Nonexplosion, ergodicity, and related conditions must be checked separately. Finite ZZ normalizes the candidate but does not imply exponential convergence. Roberts and Tweedie [2] analyze relevant tail conditions. The quadratic case is directly solvable.

For V=x2/2V=x^2/2, equilibrium is N(0,1)\mathcal N(0,1). Widening to V=x2/8V=x^2/8 gives N(0,4)\mathcal N(0,4); V=x2V=x^2 gives standard deviation 1/21/\sqrt2. For V=x4/4V=x^4/4, the density is proportional to e−x4/4e^{-x^4/4}, with a flatter center, thinner tails, and standard deviation about 0.820.82. At temperature τ>0\tau>0, the candidate becomes e−V/τ/Zτe^{-V/\tau}/Z_\tau.

DetailsExact finite-step bias for V=x²/2

Euler–Maruyama gives xₙ₊₁=(1−h)xₙ+√(2h)εₙ. A stationary variance s must satisfy s=(1−h)²s+2h, so s=1/(1−h/2). This requires 0 less than h less than 2. Variances are approximately 1.05 at h=0.1, 1.33 at h=0.5, and 2 at h=1. At h≥2 no finite stationary variance exists. The bias here is O(h); nonlinear explicit Euler chains need their own stability and invariant-measure analysis [2].

How long is long enough?

If enough time has passed and the required convergence conditions hold, the cloud approaches the equilibrium shaped by VV. The formula quantifies the intuitive widening effect, but it does not tell us that one hour is sufficient.

Two distinct limitations matter:

  • Finite time: a double-well potential can trap walkers on one side. In the appropriate barrier-crossing regime, escape times have an Arrhenius factor of order eΔV/τe^{\Delta V/\tau}, with further prefactors and assumptions. A stationary two-well law need not be well represented by a short simulation.
  • Finite step: even a stable numerical chain can have a biased stationary law. The quadratic variance above is 1/(1−h/2)1/(1-h/2), while nonlinear problems need separate checks. Stability alone does not establish negligible bias.

Separate mixing and discretization effects

import numpy as np
rng = np.random.default_rng(0)
def langevin(gradV,x0,T,h,n=20000):
    x = np.full(n,x0,float)
    for _ in range(int(T/h)):
        x = x-h*gradV(x)+np.sqrt(2*h)*rng.standard_normal(n)
    return x
x = langevin(lambda x:x,3.,20.,.01)
print(x.mean(),x.var())
for h in [.1,.5,1.]:
    print(h,langevin(lambda x:x,3.,20.,h).var(),1/(1-h/2))
# An explicit scheme for a quartic double well requires extra stability checks.
xb = langevin(lambda x:32*x*(x**2-1),-1.,20.,.01)
print('finite:',np.isfinite(xb).all(),'right-well fraction:',(xb>0).mean())
# Compare smaller h as well as longer T before attributing a mismatch to mixing.

The quadratic example should match the predicted finite-step variance after sufficient relaxation. A double well can retain strong initial-side bias at short times, but its explicit nonlinear discretization can also fail. Check finite values, refine the step, and compare the scheme before interpreting a histogram as evidence of slow mixing alone.

Check your understanding

Check your understanding

In an ideal constant-temperature model with potential V(z)=mgzV(z)=mgz for z≥0z\ge0 and a reflecting ground boundary, what is the equilibrium height density?

Check your understanding

Assume continuous Langevin converges and numerical errors are checked. Almost no walkers cross from the left to the right well during a finite run. What is plausible?

Check your understanding

For V=x2/2V=x^2/2, remove the noise. What happens to a starting law with finite second moment?

References

  1. Pavliotis, G. A. Stochastic Processes and Applications: Diffusion Processes, the Fokker–Planck and Langevin Equations. Springer, 2014.
  2. Roberts, G. O., Tweedie, R. L. Exponential Convergence of Langevin Distributions and Their Discrete Approximations. Bernoulli 2(4), 1996.
  3. Gardiner, C. Stochastic Methods: A Handbook for the Natural and Social Sciences. Springer, 4th ed., 2009.
  4. Särkkä, S., Solin, A. Applied Stochastic Differential Equations. Cambridge University Press, 2019.