A noisy bead, a heat bath, and an honest ledger

Stochastic thermodynamics

Follow one microscopic system as it is jostled by a warm environment. You will see exactly where heat, work, entropy, and irreversibility live: in a single noisy trajectory.

The kernel

Stochastic thermodynamics is just energy bookkeeping for a system too small to be smooth: moving its energy landscape does work; random collisions trade heat; and entropy measures how much more plausible its movie is forward than backward.

Step 1 · the system is small enough to jitter

A bath does two things at once: it pulls back and it kicks

Our one example is a bead in water, held near the center of an optical trap. The trap pulls a displaced bead home. Meanwhile, water molecules hit it unpredictably. A large object averages those hits away; this bead cannot. Its position is therefore a jagged, random path.

The two bath effects have names: friction is the systematic pull that removes motion, and thermal noise is the random kick that restores it. They must come together. A bath with drag but no kicks would cool the bead to a point; kicks with no drag would heat it forever.

W1One bead, many water kicks
staged · play the trajectory

First, the bead receives random kicks. Without a restoring influence, its position wanders farther and farther.

Formal version

In the overdamped limit (inertia is negligible), position \(x\) follows the Langevin equation \(\dot x=-\mu\,\partial_xU(x)+\sqrt{2\mu k_BT}\,\xi(t)\). Here \(U\) is the trap energy, \(\mu\) is mobility, \(T\) is bath temperature, and \(\xi\) is idealized white noise. The linked strengths \(\mu\) and \(2\mu k_BT\) are the fluctuation–dissipation relation.

Step 2 · equilibrium is a balance, not stillness

Warmth decides how widely the bead explores the landscape

Let the trap energy be a bowl, \(U(x)=\tfrac12kx^2\). Far from the middle costs more energy, so the pull favors the center. Noise keeps tossing the bead outward. At equilibrium, these opposing tendencies balance: the bead keeps moving, but its distribution stops changing.

That settled distribution is the Boltzmann rule: a place costs energy \(U\), so it is weighted by \(e^{-U/(k_BT)}\). This is not an extra law pasted onto the motion. It is what the matched kicks and drag produce after a long time.

W2A bowl filled by noisy trajectories
live · change the bath temperature

The curve is the predicted equilibrium density. The dots are positions generated by the actual noisy update; repeated wandering fills the curve.

Why the exponential has this shape

At equilibrium, probability cannot keep flowing from one position to another. The force \(-\partial_xU\) pulls probability downhill; diffusion pushes it from crowded to sparse places. Setting those two flows equal gives \(\partial_xp=-(\partial_xU/k_BT)p\). Dividing by \(p\) and integrating gives \(p(x)\propto e^{-U(x)/(k_BT)}\). For this widget's \(k=1\) and \(T=0.45\), the variance is \(k_BT/k=0.45\), so its standard deviation is \(\sqrt{0.45}=0.671\).

Step 3 · distinguish changing the bead from changing its world

Heat moves the bead; work moves the bowl

Now slide the trap center to the right. There are two ways the bead's energy can change. If the bead shifts around inside an unchanged bowl, energy crossed the bead–bath boundary: that is heat, \(Q\). If the bowl itself shifts while the bead is momentarily where it is, an external hand changed the energy landscape: that is work, \(W\).

This distinction is the whole first law for one trajectory. It does not say each contribution is smooth or positive. It says the ledger closes exactly: \(\Delta U=W+Q\).

W3Dragging a trap through warm water
simulate · choose protocol speed

One stroke moves the bowl a tiny amount (work), then lets the bath jostle the bead inside that fixed bowl (heat). The separate columns add exactly to the bead’s energy change.

The discrete ledger used by the simulation

At each time step first change the center \(\lambda\) while holding \(x\) fixed: \(w=U(x,\lambda_{\rm new})-U(x,\lambda_{\rm old})\). Then update \(x\) in the fixed new bowl: \(q=U(x_{\rm new},\lambda_{\rm new})-U(x,\lambda_{\rm new})\). Adding those definitions telescopes over all steps, so \(W+Q=U_{\rm final}-U_{\rm initial}\) by construction—not approximately.

Step 4 · irreversibility is a statistical arrow

A fast pull leaves a telltale lag

If the trap moves slowly, the bead has time to re-equilibrate and almost follows it. If it moves quickly, the bead lags behind. The extra work paid by that lag is called dissipation: energy that ends up as heat in the bath.

At this scale, a strange thing becomes visible: occasionally a lucky sequence of kicks helps the pull, making the work unusually small. So the second law is not “negative entropy production never happens.” It is sharper: forward-looking movies are exponentially more likely than their time-reversed counterparts. Large systems hide these rare reversals; this bead lets you see why they are allowed.

W4Many pulls: common work and rare lucky pulls
sampling · compare slow and fast protocols

Each bar is a population of genuinely simulated trajectories. Try both speeds: the fast protocol shifts the work distribution right, because a lagging bead costs more to drag.

The trajectory-level second law

For a system starting in equilibrium, Jarzynski’s equality says \(\langle e^{-W/(k_BT)}\rangle=e^{-\Delta F/(k_BT)}\). Our shifted harmonic trap has the same shape before and after, so \(\Delta F=0\). Jensen’s inequality then gives \(\langle W\rangle\ge0\). The exponential average is sensitive to rare low-work trajectories—the very “lucky pulls” that make the equality compatible with a positive mean.

Putting it together

The bookkeeping makes the arrow precise

The bath makes a trajectory noisy, not lawless. Its matched drag and kicks produce the Boltzmann distribution. When we move the landscape, the energy change separates cleanly into work from the hand and heat from the bath. A rushed change leaves extra heat behind, making the forward movie statistically easier to tell from its reverse. That is stochastic thermodynamics: ordinary thermodynamics, but with every fluctuation left in the frame.

Where this shows up