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.
A block of copper at is pressed against an identical block of copper at , 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?
Sketch what you expect and 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?
At the moment the two blocks reach a common temperature, has heat flow between them stopped, or merely balanced in both directions?
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 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:
Start the two bodies at the same size but different temperatures, then repeat with one body ten times larger than the other. Watch which starting temperature the equilibrium value sits closer to.
Watch the gap over time. Note whether it ever crosses zero and keeps going, or only ever shrinks toward it.
Compare a small pair of bodies against a much larger pair, and watch how much noisier the approach to equilibrium looks for the small one.
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 , and the two starting temperatures , .
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 can be treated as constant, a body’s internal energy change is — the working definition of heat capacity. Conservation of the pair’s total energy is then
which rearranges to
a heat-capacity-weighted average of the two starting temperatures — not the plain average unless . 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 and the mirror statement for B,
Subtracting the second equation from the first gives a single closed equation for the gap :
This is a first-order linear ODE with the standard exponential solution:
Note what determines : a larger thermal conductance (better contact) makes smaller (faster equilibration), while larger heat capacities make larger (more thermal mass to move). Both bodies converge on 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 , 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 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 -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 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.
Calorimetry. Mixing a measured mass of hot water into a measured mass of cold water and reading off the final temperature is a direct application of the boxed formula, with heat capacities in place of , — the standard method for measuring an unknown heat capacity.
Forensic cooling. A body’s temperature after death follows the same exponential relaxation toward ambient room temperature; estimating time of death from a single temperature reading is exactly the inverse problem of solving for .
RC circuits. A charged capacitor discharging through a resistor obeys the identical linear equation, with charge in place of energy and in place of — the same mathematics wherever a quantity flows down its own difference.
Building heat loss. A building’s indoor temperature relaxes toward the outdoor temperature with a time constant set by its thermal mass and insulation — the same structure, now with one “body” (outdoors) so large that its own temperature barely moves.
The two Einstein solids themselves also come back, three times, each visit settling something this module has to leave open:
The entropy ledger (module 9). The very trajectories the laboratory generates here are replayed there with an entropy ledger attached, hop by hop. That ledger answers the question this module poses and cannot yet answer: energy conservation fixes where the pair may settle, but says nothing about why it settles there rather than at some other balance. The answer is that the pair’s total entropy climbs while a temperature difference remains and stops climbing exactly when that difference vanishes.
The partition function (module 12). The same oscillators are handed to the machinery of the canonical ensemble, and the temperature map used throughout this module, , drops out of the partition function alone — the same number, reached from a direction that assumes no equipartition.
Heat capacity that varies (module 16). The Einstein solid’s is derived there, which is what finally pays off the constant- approximation box above: it says how large that approximation’s error is, and at what temperature the approximation stops being safe.
Check your understanding¶
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.
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.
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.
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.
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.
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.
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.
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.
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.
Explain, without writing an equation, why a much larger heat capacity on one side pulls the equilibrium temperature toward that side’s starting value.
Two pairs of bodies start with identical heat capacities and identical starting temperatures, but pair 2 has better thermal contact (a larger ) than pair 1. Compare their equilibrium temperatures and their relaxation times.
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 and be the number of quanta held by bodies A and B, with , their oscillator counts and the (conserved) total. At each step, one of the quanta is chosen uniformly at random to move, so the chance it currently belongs to A is ; it is then reassigned to a uniformly random oscillator among the available, landing back in A with probability . The expected change in over one step is therefore
which is exactly linear in — not approximately, and not only near equilibrium, because never changes. A linear recursion of this form has the geometric solution
Converting quanta to temperatures ( for quantum size ) leaves the shape of the decay unchanged, because is itself a linear function of at fixed . The result is
which becomes the continuous exponential once , with — the discrete-step analogue of the Newton’s-law-of-cooling time constant, with this model’s implicit conductance per step.