Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Thermal equilibrium

The puzzle: what makes two temperatures “the same”?

Walk into a room and touch a metal table leg, then the wooden tabletop beside it. The metal feels distinctly colder, even though a thermometer says both are at exactly the same temperature as the room. Nothing here is a trick of thermometers: your hand is not measuring temperature directly, it is measuring how fast heat leaves it, and metal conducts that heat away far faster than wood does. Temperature itself — the quantity a thermometer reports — is untouched by which material is in your hand.

So what is the quantity that a thermometer reports, precisely enough that two wildly different objects — a table leg and a room full of air — can be said to share it? And why does heat, once two objects are placed in contact, flow spontaneously from the hotter one to the colder one, slow down, and stop exactly at the point where the two temperatures are equal — never before, never after?

The answer starts with something almost too obvious to state, and it is where this module begins.

Predict before you calculate

Commit to an answer for each of these before running anything. Write them down.

  1. A block of copper at 80 ∘C80\,{}^\circ\mathrm{C} is pressed against an identical block of copper at 20 ∘C20\,{}^\circ\mathrm{C}, and the pair is otherwise isolated. Where do you expect the final common temperature to sit? Now suppose the second block is ten times more massive — does the final temperature move toward the hot block’s starting value, the cold block’s, or stay at the midpoint?

  2. Sketch what you expect TA(t)T_A(t) and TB(t)T_B(t) to look like once the two blocks are in contact: straight lines crossing, curves that overshoot and ping back, or curves that bend over smoothly and flatten out? Does the gap between them ever change sign?

  3. At the moment the two blocks reach a common temperature, has heat flow between them stopped, or merely balanced in both directions?

  4. You double both heat capacities while keeping the two starting temperatures fixed. Does the final equilibrium temperature change? Does the time it takes to get there change?

Explore the model

The laboratory notebook lets you set two bodies’ sizes and starting temperatures, then watch individual quanta of energy hop back and forth between them while the two temperatures settle onto a common value.

Here is the phenomenon in one picture: two bodies of unequal size, starting far apart in temperature, relaxing onto a shared value that sits closer to the larger body’s starting temperature than to the smaller one’s.

Two bodies exchanging energy quanta at random, one step at a time. Body A (red) starts hot, body B (blue) starts cold; both curves bend smoothly onto the dashed equilibrium temperature, and the black dashed curve is the analytic prediction derived below. Nothing here was smoothed — the curves are the raw simulation output.

Watch what changes when the two bodies get bigger, at fixed starting temperatures. The three panels below run the identical measurement with the pair’s total size scaled up by roughly a factor of ten each time, plotted as a fraction of the initial temperature gap so the comparison is fair:

The same relaxation, run at three system sizes, each drawn as (TA−TB)/(TA,0−TB,0)(T_A - T_B)/(T_{A,0} - T_{B,0}) against the analytic prediction (dashed). The scatter around the smooth curve does not come from anything getting gentler — it shrinks because there are more energy quanta to average over, the same phenomenon that will return in module 4 as pressure fluctuations and in module 8 as the multiplicity peak.

Run the laboratory now, then come back. Three things are worth doing before you read on:

Derive the result

System and boundary. The pair of bodies A and B, isolated together as a whole; no work is exchanged (the boundary is rigid), so all energy transfer between them is heat.

Independent variables. The two heat capacities CAC_A, CBC_B and the two starting temperatures TA,0T_{A,0}, TB,0T_{B,0}.

Energy conservation gives the equilibrium temperature

The pair is isolated, so whatever energy body A loses, body B gains, and vice versa: there is nowhere else for it to go. Over any heat capacity’s operating range small enough that CC can be treated as constant, a body’s internal energy change is ΔU=C ΔT\Delta U = C\,\Delta T — the working definition of heat capacity. Conservation of the pair’s total energy is then

CA(Teq−TA,0)+CB(Teq−TB,0)=0,C_A (T_{\text{eq}} - T_{A,0}) + C_B (T_{\text{eq}} - T_{B,0}) = 0 ,

which rearranges to

  Teq=CATA,0+CBTB,0CA+CB  \boxed{\; T_{\text{eq}} = \frac{C_A T_{A,0} + C_B T_{B,0}}{C_A + C_B} \;}

a heat-capacity-weighted average of the two starting temperatures — not the plain average unless CA=CBC_A = C_B. This is why the ten-times-more-massive block in prediction 1 pulls the final temperature toward its own starting value: it takes proportionally more energy to move its temperature by one degree, so it “wins” the average.

Newton’s law of cooling gives the relaxation in time

Energy conservation fixes where the pair ends up but says nothing about how fast. The missing ingredient is a statement about the rate of heat flow:

Combining this with CA dTA=δQinto AC_A\,dT_A = \delta Q_{\text{into }A} and the mirror statement for B,

dTAdt=κCA(TB−TA),dTBdt=κCB(TA−TB).\frac{dT_A}{dt} = \frac{\kappa}{C_A}(T_B - T_A) , \qquad \frac{dT_B}{dt} = \frac{\kappa}{C_B}(T_A - T_B) .

Subtracting the second equation from the first gives a single closed equation for the gap ΔT=TA−TB\Delta T = T_A - T_B:

d(ΔT)dt=−κ(1CA+1CB)ΔT=−ΔTτ,τ=CACBκ (CA+CB).\frac{d(\Delta T)}{dt} = -\kappa\left(\frac{1}{C_A} + \frac{1}{C_B}\right)\Delta T = -\frac{\Delta T}{\tau} , \qquad \tau = \frac{C_A C_B}{\kappa\,(C_A + C_B)} .

This is a first-order linear ODE with the standard exponential solution:

  TA(t)−TB(t)=(TA,0−TB,0) e−t/τ  \boxed{\; T_A(t) - T_B(t) = \big(T_{A,0} - T_{B,0}\big)\, e^{-t/\tau} \;}

Note what determines τ\tau: a larger thermal conductance κ\kappa (better contact) makes τ\tau smaller (faster equilibration), while larger heat capacities make τ\tau larger (more thermal mass to move). Both bodies converge on TeqT_{\text{eq}} from the boxed formula above — the shape of the approach is exponential, but the destination was already fixed by energy conservation alone.

Verify computationally

Deriving a formula and trusting it are different things. The laboratory checks the result several ways, and each check is also a test in the project’s test suite, so the claims on this page cannot silently rot.

1. Energy conservation. Every step in the simulation only relabels which body owns one quantum, so the total number of quanta — and hence the total energy — is conserved to the last bit, not approximately.

2. The equilibrium temperature. Averaged over many independent runs, the long-time temperature of body A converges on Teq=(CATA,0+CBTB,0)/(CA+CB)T_{\text{eq}} = (C_A T_{A,0} + C_B T_{B,0})/(C_A + C_B), within the statistical error of the measurement.

3. The relaxation curve. The mean temperature gap across independent runs, measured one relaxation time in, matches the closed-form e−t/τe^{-t/\tau} prediction — not just its shape, but its value.

4. Convergence with system size. Run-to-run scatter around the analytic curve shrinks as the two bodies grow, the same NN-dependent steadying met throughout this course.

The one check no simulation can supply is a real thermal contact, which is what Part 6 of the laboratory asks for: a mug of hot water, a kitchen thermometer, a reading every couple of minutes, and a τ\tau fitted in minutes rather than in steps.

Transfer the idea

The pattern here — two reservoirs exchanging a conserved quantity at a rate proportional to their difference, relaxing exponentially to a weighted-average equilibrium — reappears throughout physics and beyond it.

The two Einstein solids themselves also come back, three times, each visit settling something this module has to leave open:

Check your understanding

  1. Body A is in thermal equilibrium with body C, and body B is separately in thermal equilibrium with body C. What can you conclude about A and B?

    A. A and B are in thermal equilibrium with each other -- this is exactly what the zeroth law asserts. B. Nothing follows -- equilibrium is not guaranteed to be transitive. C. A and B must have the same heat capacity. D. A and B are each in equilibrium with C, but a thermometer might read differently on A than on B.

    Check your answer

    Correct answer: A — A and B are in thermal equilibrium with each other -- this is exactly what the zeroth law asserts.

    • A. Right. This is precisely why a single calibrated thermometer (playing the role of C) can be trusted on any two objects it touches in turn -- without the zeroth law, matching thermometer readings on two objects would say nothing about whether those two objects agree with each other.

    • B. This is exactly what the zeroth law rules out. It is stated as an empirical axiom precisely because transitivity is not logically forced by anything more basic -- it is a fact about how real thermal contact behaves.

    • C. Heat capacity plays no role here. Two bodies can be at the same temperature while having wildly different heat capacities -- that is exactly why the equilibrium temperature of a pair is a heat-capacity-weighted average, not a statement about C_A and C_B being equal.

    • D. A properly calibrated thermometer reads the same value on any two bodies at the same temperature. That consistency is exactly what the zeroth law guarantees, not something it leaves open.

  2. Two identical metal blocks, one hot and one cold, are pressed together and then isolated from everything else. True or false: they reach the same temperature the instant they touch.

    A. False -- the temperatures approach each other smoothly, over a relaxation time set by the heat capacities and the quality of the contact. B. True -- contact alone is enough to equalize temperature immediately. C. True, but only if the two blocks are made of the same material. D. False -- but only because the blocks are solid; liquids and gases would equalize instantly.

    Check your answer

    Correct answer: A — False -- the temperatures approach each other smoothly, over a relaxation time set by the heat capacities and the quality of the contact.

    • A. Right. Real thermal contact has a finite conductance kappa, so the gap T_A - T_B decays as exp(-t/tau) rather than collapsing to zero the instant the blocks touch.

    • B. This ignores that heat has to actually flow across the contact, at a rate set by kappa. No real contact has infinite conductance, so equilibration always takes a finite relaxation time tau, however short that time may be.

    • C. Matching materials does not remove the need for heat to flow across the contact at a finite rate. It might shorten tau, but it cannot make it exactly zero.

    • D. Every phase of matter transfers heat at a finite rate. Liquids and gases can equilibrate faster once convection helps, but “instantly” is never physically achieved by any phase.

  3. Body A has heat capacity 300 J/K and starts at 80 C. Body B has heat capacity 900 J/K and starts at 20 C. The pair is isolated together. Find the equilibrium temperature in degrees C.

    Check your answer

    Correct answer: 35 (± 0.5)

    T_eq = (C_A T_A + C_B T_B)/(C_A + C_B) = (30080 + 90020)/1200 = 42000/1200 = 35 C. Body B has three times the heat capacity of A, so the equilibrium sits three-quarters of the way from A’s starting value to B’s -- much closer to 20 C than to the plain midpoint, 50 C.

  4. Two bodies with very different heat capacities are brought into contact and allowed to reach equilibrium. Which statement is correct?

    A. T_eq is the heat-capacity-weighted average of the two starting temperatures, so the body with the larger C pulls T_eq closer to its own starting value. B. T_eq is always exactly the arithmetic mean of T_A and T_B, regardless of the two heat capacities. C. T_eq equals whichever starting temperature belongs to the body with the larger heat capacity. D. T_eq depends only on which body started hotter, not on the two heat capacities.

    Check your answer

    Correct answer: A — T_eq is the heat-capacity-weighted average of the two starting temperatures, so the body with the larger C pulls T_eq closer to its own starting value.

    • A. Correct: T_eq = (C_A T_A + C_B T_B)/(C_A+C_B). A larger C_A means body A’s temperature has to move less to conserve the pair’s total energy -- the same way a larger mass moves less in a lopsided lever balance.

    • B. This holds only in the special case C_A = C_B. In general each body’s starting temperature is weighted by its own heat capacity, not counted equally.

    • C. This overcorrects. The larger-C body pulls T_eq toward itself but does not fix it exactly there, unless its heat capacity is effectively infinite compared with the other body’s.

    • D. T_eq always lies between T_A(0) and T_B(0), but exactly where within that range depends on the ratio C_A:C_B, not merely on which body was hotter.

  5. Two bodies start with a temperature gap of 100 K. About how large is the gap after exactly one relaxation time tau has passed?

    A. About 37 K -- a factor of 1/e smaller than the initial gap. B. 0 K -- equilibrium is essentially reached after one relaxation time. C. 50 K -- one relaxation time halves the gap. D. Still 100 K or larger -- the gap does not start shrinking until several relaxation times have passed.

    Check your answer

    Correct answer: A — About 37 K -- a factor of 1/e smaller than the initial gap.

    • A. Right. T_A(t) - T_B(t) = (T_A(0) - T_B(0)) exp(-t/tau), and exp(-1) = 0.368, so after one tau the gap has fallen to about 37% of its starting value -- that ratio is exactly how tau is defined.

    • B. One relaxation time shrinks the gap by a factor of about 1/e, not to zero. The exponential never formally reaches zero; after several tau the gap becomes negligible, but tau itself is not “arrival”.

    • C. Halving the gap takes ln(2)*tau, about 0.69 tau, not exactly one tau. tau is defined by the 1/e factor, not by a factor of one half.

    • D. The gap shrinks continuously from the very first instant; there is no delay before the decay begins.

  6. Before reading the derivation: you double both heat capacities C_A and C_B while keeping the two starting temperatures and the contact’s conductance kappa fixed. Predict what happens to (a) the equilibrium temperature T_eq, and (b) the relaxation time tau.

    Check your answer

    T_eq = (C_A T_A + C_B T_B)/(C_A+C_B) is unchanged: doubling both C_A and C_B scales the numerator and the denominator by the same factor, which cancels. tau = C_A C_B / (kappa(C_A+C_B)) doubles: the numerator C_A C_B scales by 4 while the denominator C_A+C_B scales by only 2, and 4/2 = 2. Physically, doubling both heat capacities leaves the destination alone (the ratio C_A:C_B is unchanged) but doubles the thermal mass that the fixed conductance kappa has to move, so it takes twice as long to arrive.

  7. In two or three sentences, explain what continues to happen microscopically once two bodies reach thermal equilibrium, and why the macroscopic temperatures nonetheless stop changing.

    Check your answer

    A good answer says that energy quanta keep hopping back and forth between the two bodies constantly -- nothing about the microscopic exchange switches off. What stops is the net flow: once q_A/n_A equals q_B/n_B (equal temperatures), a quantum is exactly as likely to move from A to B as from B to A, so the two directions balance and the macroscopic average holds still. Answers that describe the exchange as having “stopped” rather than “balanced” have not distinguished the two cases.

  8. In which situation would this module’s discrete energy-exchange model be least trustworthy for predicting the approach to equilibrium?

    A. Two bodies both close to absolute zero. B. Two bodies at very different starting temperatures, both well above their characteristic quantum scale. C. Two bodies of very different sizes (large N_A, small N_B). D. Two bodies made of the same material.

    Check your answer

    Correct answer: A — Two bodies both close to absolute zero.

    • A. Right. At low temperature the oscillators leave the classical, high-temperature equipartition regime that T = (quanta x quantum)/(n k_B) relies on, and quantum statistics take over -- exactly the model’s stated failure mode.

    • B. A large starting gap is exactly what this module’s derivation handles -- the exponential relaxation law was derived for an arbitrary T_A(0)-T_B(0), and the model stays valid as long as both bodies sit in the classical regime.

    • C. Unequal sizes are exactly what makes the heat-capacity-weighted T_eq formula interesting; the model handles N_A != N_B without any special treatment, as long as both are individually large enough to be called macroscopic.

    • D. Matching materials is not a failure mode of anything in this model -- if anything it makes the shared-quantum-size assumption easiest to justify.

Exam-style problems for this module — the ones worth doing with a pen — are collected in the problem set.

Explain it in your own words

Answer in a few sentences each. These are the questions that reveal whether the ideas landed; no number will save you.

  1. A student says: “The two bodies reach the same temperature because heat stops flowing once they touch.” Improve this sentence so that it is actually correct, and say precisely what was wrong with it.

  2. Explain, without writing an equation, why a much larger heat capacity on one side pulls the equilibrium temperature toward that side’s starting value.

  3. Two pairs of bodies start with identical heat capacities and identical starting temperatures, but pair 2 has better thermal contact (a larger κ\kappa) than pair 1. Compare their equilibrium temperatures and their relaxation times.

  4. Explain why “the two bodies are at equilibrium” does not mean the exchange of energy quanta between them has stopped.

Advanced: from a random hop to an exact exponential

The laboratory’s exchange rule looks arbitrary until its consequence is traced through exactly. Let qAq_A and qBq_B be the number of quanta held by bodies A and B, with nAn_A, nBn_B their oscillator counts and Q=qA+qBQ = q_A + q_B the (conserved) total. At each step, one of the QQ quanta is chosen uniformly at random to move, so the chance it currently belongs to A is qA/Qq_A/Q; it is then reassigned to a uniformly random oscillator among the nA+nBn_A + n_B available, landing back in A with probability nA/(nA+nB)n_A/(n_A + n_B). The expected change in qAq_A over one step is therefore

E[ΔqA]=nAnA+nB−qAQ,\mathbb{E}[\Delta q_A] = \frac{n_A}{n_A+n_B} - \frac{q_A}{Q} ,

which is exactly linear in qAq_A — not approximately, and not only near equilibrium, because QQ never changes. A linear recursion of this form has the geometric solution

E[qA(n)]−qAeq=(qA(0)−qAeq)(1−1Q)n,qAeq=Q nAnA+nB.\mathbb{E}[q_A(n)] - q_A^{\text{eq}} = \big(q_A(0) - q_A^{\text{eq}}\big)\left(1 - \frac{1}{Q}\right)^{n} , \qquad q_A^{\text{eq}} = \frac{Q\,n_A}{n_A+n_B} .

Converting quanta to temperatures (T=q ε/(nkB)T = q\,\varepsilon/(n k_B) for quantum size ε\varepsilon) leaves the shape of the decay unchanged, because TA−TBT_A - T_B is itself a linear function of qAq_A at fixed QQ. The result is

E[TA(n)−TB(n)]=(TA(0)−TB(0))(1−1Q)n,\mathbb{E}[T_A(n) - T_B(n)] = \big(T_A(0) - T_B(0)\big)\left(1 - \frac{1}{Q}\right)^{n} ,

which becomes the continuous exponential e−n/τe^{-n/\tau} once Q≫1Q \gg 1, with τ=−1/ln⁡(1−1/Q)→Q\tau = -1/\ln(1 - 1/Q) \to Q — the discrete-step analogue of the Newton’s-law-of-cooling time constant, with this model’s implicit conductance κ=kB/Q\kappa = k_B / Q per step.