Fundamentals / Physics / Thermodynamics and statistical physics

Counting states and defining temperature

Use a model of discrete energy sharing to derive thermodynamic temperature and distinguish a most probable configuration from one microscopic state.

From first principles

Derive thermal equilibrium by counting possible energy divisions

For an isolated system with a fixed energy range, assume all accessible microscopic states in that range have equal probability. Its multiplicity \(\Omega(E)\) counts those states. Entropy is

\[S=k_B\ln\Omega;\]

the logarithm makes entropy additive when independent state counts multiply. Put systems A and B into weak thermal contact so they share a fixed total energy without exchanging particles or doing work. The number of states compatible with an energy \(E_A\) is

\[\Omega_{\rm total}(E_A)=\Omega_A(E_A)\Omega_B(E_{\rm total}-E_A).\]

The most probable energy division maximizes this product. For large systems with smooth entropy curves, take its logarithm and differentiate. A gain of A is a loss of B, so at an interior maximum

\[0=\frac{d(S_A+S_B)}{dE_A}=\left(\frac{\partial S_A}{\partial E_A}\right)_{V,N}-\left(\frac{\partial S_B}{\partial E_B}\right)_{V,N}.\]

The common quantity is the inverse thermodynamic temperature,

\[1/T=(\partial S/\partial E)_{V,N}.\]

This definition relates a counting problem to the observed absence of net energy exchange at equilibrium. Positive heat capacities give a locally stable maximum and set the width of the energy-sharing fluctuations.

Background · Multiplicity and entropy
\[S=k_B\ln\Omega\]

Count microstates compatible with the macroscopic constraints. Distinguishable particles, indistinguishable occupations and a changed energy window need distinct counts.

A three-by-three table gives multiplicities for two samples containing two independent two-state sites each. The fixed-total diagonal contains one, four and one states.Open full-size diagram
A counting diagram for a finite reservoir Prepare the four equivalent sites independently with the same excitation probability strictly between zero and one. Keep only records with two excitations. Every such microscopic pattern then has the same probability. Only the outlined diagonal survives this constraint. The middle cell represents two choices in A times two in B. The probabilities for A to contain zero, one or two excitations are therefore 1/6, 4/6 and 1/6. Treating the three macroscopic outcomes as equally likely would give a different experiment.

Explore the related parameter study beside the computed figure.

Derivation and applications

Find the width of the most probable energy division

An isolated pair of subsystems can have sharply defined total energy while the energy in each part fluctuates. Let \(E_A+E_B=E_{\rm tot}\), and assume weak coupling, rapid internal equilibration and equal statistical weights of accessible microstates. For two macroscopic subsystems with smooth entropies, the probability density of a particular division of energy is proportional to its state count,

\[P(E_A)\propto\exp\!\left(\frac{S_A(E_A)+S_B(E_{\rm tot}-E_A)}{k_B}\right).\]

At its interior maximum \(d(S_A+S_B)/dE_A=1/T_A-1/T_B=0\). The temperatures there equal \(T\). To examine nearby divisions, differentiate again. Each subsystem at fixed volume and particle number has \(d(1/T)/dE=-1/(T^2C)\), with heat capacity \(C\). Squaring the chain derivative of \(E_B\) makes the two curvature contributions add,

\[\frac{d^2(S_A+S_B)}{dE_A^2}=-\frac{1}{T^2}\left(\frac1{C_A}+\frac1{C_B}\right).\]

For positive heat capacities the maximum is stable. Write \(\delta E=E_A-E_A^*\) relative to the most probable energy. A quadratic expansion of the entropy about the maximum yields a Gaussian with variance

\[P(\delta E)\propto e^{-\delta E^2/(2\sigma_E^2)},\]
\[\sigma_E^2=k_BT^2\frac{C_A C_B}{C_A+C_B}.\]

The finite partner reduces the width because it must undergo exactly the opposite energy fluctuation. For \(C_B\gg C_A\) the canonical variance \(k_BT^2C_A\) is recovered. A temperature inferred from the subsystem energy has fluctuation scale \(\sigma_E/C_A\) when its heat capacity is locally constant. A macroscopic state's relative fluctuations shrink because heat capacity is extensive.

Worked example

Estimate fluctuations of a small calorimeter

At \(T=300\,\mathrm K\), let \(C_A=1.00\times10^{-12}\,\mathrm{J/K}\) and \(C_B=3.00\times10^{-12}\,\mathrm{J/K}\). The effective capacity in the variance is \(0.750\times10^{-12}\,\mathrm{J/K}\). With \(k_B=1.381\times10^{-23}\,\mathrm{J/K}\), the root-mean-square energy fluctuation is \(9.65\times10^{-16}\,\mathrm J\), equivalent to \(0.965\,\mathrm{mK}\) of inferred temperature in A.

Second application

Determine whether the partner acts as a reservoir

Another apparatus measures an energy standard deviation for A of \(0.800\) times the value predicted for an infinite bath. The variance ratio is

\[0.640=C_B/(C_A+C_B).\]

Thus

\[C_B/C_A=0.640/0.360=1.78.\]

For \(C_A=2.00\,\mathrm{nJ/K}\) this implies \(C_B=3.56\,\mathrm{nJ/K}\). Using the standard-deviation ratio directly in the variance formula would substantially overestimate the partner capacity.

Try it · Finite reservoir variance

Vary the physical parameters in the derived relation. Use the units and assumptions in the readout to connect the curves to the two worked examples. A parameter study can test the forward prediction; the same relation can then be inverted to infer a parameter from a measurement.

OneSimulation laboratory

Separate the equilibrium temperature from the relaxation time

Start from this chapter. A small transfer δQ changes the total entropy by δQ(1/Tcold − 1/Thot). Follow that sign during the computed relaxation and find the temperature at which the derivative vanishes.

Compare recorded OneSimulation runs on this page. To test your own inputs, download the notebook and model files and run the model in an activated OneSimulation environment.

The notebook couples two thermal capacities through their temperature inputs. Run its parameter, solve and comparison cells for each setting. The log-slope of \(T_1-T_2\) provides a measured decay rate. Its inverse is the measured relaxation time. Use the capacity-weighted mean at every stored time to estimate \(T_*\), since the two temperatures still differ at the final stored sample. Two-body thermal exchange model.

  1. Baseline. Start with heat capacities of 500 and 1500 J/K, initial temperatures of 360 and 300 K, and a 2 W/K bridge. Compare the time for the initial temperature difference to fall by a factor \(e\) with 187.5 s. Check entropy by calculating \(C_1\ln(T_1/T_{1,0})+C_2\ln(T_2/T_{2,0})\) across the stored history.
  2. Improve the bridge. Change conductance from 2 to 4 W/K and rerun. Predict which of the weighted mean and decay rate will double.
  3. Change the hot body. Restore the conductance and set heat_capacity_1 = 1500.0 J/K. Examine how the fitted rate and weighted mean both change. For each run compare the fitted rate with \(1/\tau\) within 0.1%, and check that the weighted mean drifts by less than 0.001 K.
Stored temperature histories from the coupled model
Thermal contactWeighted mean (K)Fitted decay rate (s⁻¹)Relaxation time (s)
500 J/K hot block, 2 W/K bridge315.000.005333187.50
500 J/K hot block, 4 W/K bridge315.000.01066793.75
1500 J/K hot block, 2 W/K bridge330.000.002667375.00
Doubling the bridge conductance cuts the relaxation time from 187.5 to 93.75 s. Increasing the hot block’s heat capacity instead doubles the time to 375 s.
Doubling the bridge conductance cuts the relaxation time from 187.5 to 93.75 s. Increasing the hot block’s heat capacity instead doubles the time to 375 s.
Download experiment files (ZIP) Extract the files together and open two_mass_thermal_exchange.ipynb in a local OneSimulation environment.
Try it · Two blocks approaching thermal equilibrium

The initial temperatures are the notebook’s 360 K and 300 K, with heat capacities 500 and 1500 J/K and conductance 2 W/K. Double the conductance to halve the relaxation time; restore it and set the first capacity to 1500 J/K to move the equilibrium to 330 K. These curves solve the same constant-property ODE analytically.

Open the corresponding OneSimulation notebook, code and output

Problem sheet 6 · Identify a heat capacity and a bridge conductance

Read the model setup and preparatory problems

State exactly what is counted

Consider \(N\) independent distinguishable vibrational modes, all of angular frequency \(\omega\), with a common energy quantum \(\varepsilon=\hbar\omega\). Suppose they contain \(q\) excitation quanta in total. A microstate is an ordered list of occupation numbers \((q_1,\ldots,q_N)\) with nonnegative integers adding to \(q\). Giving two quanta to mode 1 differs from giving the same two quanta to mode 2, while exchanging two identical quanta within one mode creates no new microstate. An additive ground-state energy plays no role in the counting below.

Represent a distribution by writing \(q\) dots and separating the modes with \(N-1\) dividers. The locations of the dividers among all \(q+N-1\) symbols determine the occupations, including a zero when two dividers coincide in succession. The multiplicity is therefore

\[\Omega(N,q)=\binom{q+N-1}{q}.\]

It counts the microscopic realisations of a specified macroscopic energy, not different possible values of that energy.

Allow subsystems to exchange energy

Put two such solids into weak thermal contact but isolate the pair from the environment. For a fixed division \(q_A\) and \(q_B=q-q_A\), weak coupling makes the joint multiplicity the product \(\Omega_A(q_A)\Omega_B(q_B)\). Under the microcanonical hypothesis of equal probabilities for accessible microstates of the pair, this product sets the probability weight for an observed division. The most probable division maximises the product, though for finite systems other divisions retain nonzero probability.

As a concrete small system take \(N_A=N_B=2\) and \(q=4\). Each solid has multiplicity \(q_i+1\). The weights for \(q_A=0,1,2,3,4\) are \(5,8,9,8,5\) with sum 35. Equal sharing is the most probable single division, yet it occurs only \(9/35=0.257\) of the time. Any one specific occupation list still has probability \(1/35\). The distinction between a microstate and a macrostate resolves the apparent tension between equal probabilities and a preferred energy division.

Obtain temperature from an entropy slope

Introduce \(S=k_B\ln\Omega\) so that independent multiplicities produce additive entropy. For macroscopic \(N\) and \(q\), use Stirling’s approximation \(\ln n!\simeq n\ln n-n\) and drop corrections small relative to \(N\). Writing \(U=q\varepsilon\) and holding \(N\) fixed gives

\[S/k_B\simeq(q+N)\ln(q+N)-q\ln q-N\ln N,\]
\[\frac1T=\frac{k_B}{\varepsilon}\ln(1+N/q).\]

This derivative defines an equilibrium temperature from how quickly the number of ways to store energy grows. The entropy maximum of two systems in contact then requires equal inverse temperatures, even if the systems have different numbers of modes. Heat flows towards the subsystem gaining more entropy per added energy. The equilibrium criterion concerns equality of slopes; the two subsystems need not contain the same total energy.

Solving the derivative for energy per mode yields

\[U/N=\varepsilon/[\exp(\varepsilon/k_BT)-1].\]

At high temperature the exponential in the denominator expands to first order, giving energy near \(k_BT\) for one harmonic mode. At low temperature only a small fraction of modes carry excitations. The energy and heat capacity above their ground values are then strongly suppressed.

Connect the count with a thermometer

For a set of modes with \(\varepsilon/k_B=240\) K, an observed mean occupation \(q/N=0.50\) gives

\[T=240/\ln 3=218\,\mathrm{K}.\]

Packing the same excitations into twice as many identical modes changes \(q/N\) to 0.25 and gives

\[T=240/\ln5=149\,\mathrm{K}.\]

Equal quantities of excitation energy therefore need not indicate equal temperatures. The reservoir of available modes matters.

These estimates assume the modes have a common frequency and have explored accessible distributions sufficiently for the statistical description to apply. A newly driven single mode could contain nearly all the energy while a thermometer responds differently from the occupation-based estimate. As the sample size increases the spread of typical energy per mode narrows, but finite-time preparation and weak internal relaxation still determine whether equilibrium counting is an appropriate description of a measurement.

The entropy curvature also determines whether sharing energy is stable. Near the maximum, expand the combined entropy to second order in a small transfer between subsystems. A negative summed curvature makes the probability fall on either side of the most likely energy. For ordinary positive heat capacities, each entropy curvature is negative, so the two bodies return statistically towards equal temperature after a small redistribution.

A bounded energy spectrum reverses the entropy slope

An assembly of independent localized two-state units supplies a finite system in which the sign of temperature can be read directly from multiplicity. Take \(N\) units with low energy zero and high energy \(\varepsilon\). If \(n\) are excited, total energy is \(n\varepsilon\) and the multiplicity of that sharp-energy macrostate is \(\binom Nn\). It grows up to half occupancy and decreases when nearly all units are forced into the high state. This assumes the ensemble is internally equilibrated over the available states near its specified energy.

Use the entropy of a narrow energy shell \(S=k_B\ln\Omega\). Adding one excitation changes its entropy by \(k_B\ln[(N-n)/(n+1)]\). Dividing by the associated energy increment defines a finite-difference inverse temperature. For large \(N\) with neither level nearly empty, replacing \(n+1\) by \(n\) gives

\[\frac1T\simeq\frac{k_B}{\varepsilon}\ln\frac{N-n}{n},\]
\[\frac nN=\frac{1}{1+e^{\varepsilon/(k_BT)}} .\]

Ordinary positive temperatures have more units in the lower state. Approaching equal populations from below sends inverse temperature toward zero. Above half occupancy the entropy falls as energy increases, giving a negative shell temperature. Such an internally equilibrated population inversion requires a bounded spectrum and isolation from unbounded energy reservoirs on the observation timescale. It cannot describe an unrestricted equilibrium ideal gas with arbitrarily high translational energies.

Predict the direction of exchange

Consider \(N=10,000\) units with \(\varepsilon/k_B=120\) K. A preparation with 2500 excited units has \(T\simeq120/\ln3=109\) K. A preparation with 7500 excited units has \(T\simeq120/\ln(1/3)=-109\) K. Join the inverted system through weak energy exchange to a large positive-temperature reservoir at 300 K. If the system loses positive energy \(\delta E\) to the reservoir, the combined entropy change is \(\delta E(1/300-1/(-109))>0\). Net energy therefore leaves the inverted sample even though comparing the signed temperature numbers as ordinary magnitudes would suggest otherwise.

For \(\delta E=1.00\times10^{-20}\) J, the first-order change is about \(1.25\times10^{-22}\) J/K, or nine Boltzmann constants. This uses an exchange small relative to the original ensemble energy so that the temperature slopes stay nearly constant. At exactly half occupancy the inverse temperature is zero in the large-system limit. Pumping a system into an inverted population and allowing it to equilibrate internally are separate experimental steps. A measured majority of excited units alone is evidence for inversion; additional checks on internal energy exchange are needed before assigning a thermodynamic temperature to that preparation.

The preparation also shows why inverse temperature is often more convenient than temperature itself. Moving the upper-state fraction continuously from slightly less than one half to slightly more than one half sends temperature through positive and negative infinity, while inverse temperature crosses zero smoothly. A weak probe with the same small level spacing can test the slope through the relative probabilities of up and down transitions when equilibrated with the sample. A probe with unrestricted kinetic energy, in contrast, can drain the inversion before it becomes a useful thermometer. The compatibility of thermometer and sample therefore matters near a bounded-spectrum population inversion.

Why is a shared-energy macrostate overwhelmingly likely?

Twenty distinguishable sites each have two possible energies. For independent excitation probability \(p\), the macrostate probability includes both its multiplicity \(\binom{20}{n}\) and the probability of one such arrangement. Compare changing the energetic bias with changing the counting rule.

Why is a shared-energy macrostate overwhelmingly likely?. Horizontal axis: Number of excited independent sites. Vertical axis: Probability. Data follow the figure.
At p = 1/2 the central probability is about 0.176, whereas the all-excited state has probability less than one in a million. Each individual configuration remains equally probable at this p; it is the number of configurations that differs.
Try it · Physics lab counting limit

Explore the same physical relation with adjustable inputs. This independent parameter study has its own displayed reference settings; compare its assumptions and units before matching the static example.

Read values from the plot
Probability at selected values of Number of excited independent sites.
Number of excited independent sitesExcitation probability 0.25Excitation probability 0.5Excitation probability 0.75
00.00317129.5367e−79.0949e−13
50.202330.0147863.4265e−6
100.00992230.17620.0099223
153.4265e−60.0147860.20233
209.0949e−139.5367e−70.0031712

Download all 21 plotted samples (CSV)

Study the full derivation

Counting, absolute entropy and the entropy of mixing · Statistical mechanics from microscopic counting to material response

An ideal gas expands into an evacuated bulb and its temperature can remain essentially unchanged. What changed if a thermometer reports the same value? Begin by specifying a microscopic count, recover the pressure and temperature of the gas, and test the meaning of distinguishability by removing a partition between two samples. The calculation also explains why the classical formula for absolute entropy needs a microscopic action scale.