Separate kinetic motion from the configurational count
For a classical monatomic gas at fixed temperature take pair potential \(u(r)\) and total interaction \(\sum_{i<j}u(r_{ij})\). The canonical partition function factors into a Gaussian momentum part and an integral over all allowed particle positions. Divide by \(N!\lambda_T^{3N}\) for indistinguishable particles. In the absence of interactions the configurational integral is \(V^N\). A hard core removes configurations with overlapping particles, while an attractive well increases their equilibrium weights instead of adding geometric space.
Use the Mayer function \(f(r)=e^{-\beta u(r)}-1\). The position-dependent Boltzmann weight is exactly \(\prod_{i<j}[1+f(r_{ij})]\). Expanding the product separates independent particles, terms with one pair bond, and terms involving several bonds. Translation invariance allows each isolated pair integral to be written as \(V\int f(\mathbf r)d^3r\) when boundary corrections are negligible. The logarithm of the configurational partition function retains connected contributions, a crucial step before taking the large-volume limit.
A naive truncation of the full partition function after its first pair term can fail even for small density because there are of order \(N^2\) pairs. The connected expansion organises the intensive free energy, not the sum of all events in a macroscopic gas. Differentiating \(F\) with respect to volume at fixed \(T,N\) gives
It is the smallness of successive density terms that controls the virial prediction. A small accidental value of \(B_2\) does not bound the next coefficient.
Compute excluded volume and attraction as separate contributions
For a spherical hard core of diameter \(\sigma\), \(f=-1\) for \(r<\sigma\), zero otherwise. The second virial coefficient is \(2\pi\sigma^3/3\), four times the physical volume of a sphere of diameter \(\sigma\). The forbidden region for the centre of a second particle has radius \(\sigma\), twice a particle's radius, and each unordered pair is counted once. Treating the excluded volume per particle as merely its physical volume loses both geometric factors.
A square well of depth \(\epsilon>0\) extends from \(\sigma\) to \(\lambda\sigma\). Outside the well the interaction vanishes. Evaluate the shell integrals directly:
The Boyle temperature is the solution \(B_2=0\), namely \(k_BT_B/\epsilon=1/\log[1+1/(\lambda^3-1)]\). At \(T_B\) hard-core and attractive pair contributions cancel in pressure through first order in density. Particles still have nontrivial correlations and excess internal energy. The Boyle point is a pressure cancellation, not a noninteracting gas state. At fixed \(T\) and very low density the absolute pressure correction is small even when \(|B_2|/b\) is large.
For \(\lambda=1.50\) and \(\epsilon/k_B=100\) K, \(T_B\simeq285\) K. At 200 K the ratio \(B_2/b=1-2.375(e^{1/2}-1)=-0.541\). If \(nb=0.030\), the compressibility factor \(Z_p=p/(nk_BT)\) is approximately 0.9838. At \(T=400\) K the ratio becomes 0.325 and the pressure exceeds ideal by about 0.98 percent for the same density. A precise comparison should also estimate \(n^2B_3\), especially when the objective is to infer model parameters from percent-level deviations.
Sweep well range and temperature through the pressure cancellation
An interaction can exchange heat even at the Boyle point
The canonical identity \(U=\partial(\beta F)/\partial\beta\) at fixed volume and particle number gives the leading excess internal energy per particle as \(-k_BT^2n\,dB_2/dT\). For the square well,
This result is negative for an attractive well. Repulsive hard-sphere exclusion instead changes pressure but has no potential energy on any permitted configuration. These contrasting examples show that a pressure deviation alone does not determine an energy deviation without its temperature dependence. Different virial models may pass through the same pressure at one temperature while predicting very different heat capacities.
In the numerical well at 200 K the excess energy per particle equals \(-0.1175\,\epsilon\), or approximately minus \(1.62\times10^{-22}\) J. Compare with the positive translational mean \(3k_BT/2\); the correction is about minus four percent of that kinetic energy. A configuration-based simulation offers a direct independent check: count pairs in the well, assign minus \(\epsilon\) per unordered pair, and average. Counting both neighbours of every pair without halving would double the inferred mean energy.
Thermodynamic consistency supplies another useful cross-check. The identity \((\partial U/\partial V)_T=T(\partial p/\partial T)_V-p\) requires the pressure and energy virial calculations to share the same derivative of \(B_2\). For a hard-sphere gas with temperature-independent core the two sides vanish through this order. For an attraction they do not vanish. If a fitted empirical repulsion diameter depends on temperature, differentiate that dependence as part of the fit and interpret the resulting effective energy with care.
What a pair histogram measures
Choose one particle as origin and count the expected number of other centres in a spherical shell \(4\pi r^2dr\). Define \(g(r)\) by setting this count equal to \(n g(r)4\pi r^2dr\). In the dilute limit a single neighbour at separation \(r\) sees the relative Boltzmann weight \(e^{-\beta u(r)}\), so \(g(r)\to e^{-\beta u(r)}\). A hard core produces an empty inner region, an attractive well a finite elevated shell and large separations approach one. Histograms per unit radius without division by the shell volume grow as \(r^2\) even for an ideal gas.
The leading configurational energy follows by integrating the pair energy weighted by the expected number of neighbours and dividing by two for pair sharing. Similarly, expanding a system uniformly by changing scaled coordinates in the configurational integral gives the virial pressure for a differentiable finite-range pair potential:
The pressure formula includes the radial force, whereas the energy integral includes the potential. Taking the dilute Boltzmann form and integrating by parts returns the second-virial result. For a hard discontinuity ordinary pointwise differentiation of \(u(r)\) is inappropriate. Treat it through contact jump conditions or a limit of a smooth steep interaction. A code that samples a hard-core derivative as zero everywhere it is finite will miss exactly the repulsive momentum transfer it seeks to measure.
An optical or simulated correlation measurement with a finite point spread blurs the exclusion edge and can populate apparent distances below the true diameter. Calibrate spatial resolution and two-particle tracking efficiency, particularly where particle images overlap. In a periodic cube, shells whose radius approaches half the box edge need an appropriate geometric normalisation. Removing the outer shell deficit by an arbitrary normalisation may preserve a pretty asymptote while biasing an integral used for compressibility.
Connect density fluctuations to the integral of the pair structure
For a large observation window in an open homogeneous fluid, total particle-number variance can be calculated in two ways. The diagonal single-particle terms give the mean number. Distinct pairs add the integral of the connected density correlation. Provided correlations decay rapidly enough compared with the window size, one obtains a zero-wavevector structure factor
To leading order \(g-1=f\), so \(S(0)=1-2nB_2\). The compressibility derived by differentiating \(p=nk_BT(1+nB_2)\) is consistent to this order. The factor two relative to the pressure correction arises because pressure contains \(n^2B_2\) before differentiation. A mean pressure near the ideal value therefore need not imply that the full spatial correlation function is nearly flat.
One must specify the counting window. The exactly fixed total number in a sealed simulation box gives zero variance of that total. Measuring number fluctuations in subvolumes or the small-nonzero-wavenumber structure factor can estimate the thermodynamic value, with finite-size corrections. If the correlation length approaches the box size near a transition, extrapolation to zero wavevector using only one or two available modes is poorly conditioned.
An exactly soluble interacting gas as a test of truncation
A one-dimensional gas of hard rods provides a rare opportunity to compare an entire exact equation of state with its virial truncation. Take \(N\) rods of length \(a\) in an interval of length \(L\) with hard end walls. Order them by their left endpoints \(x_1<\cdots<x_N\). The no-overlap constraints become \(x_{j+1}\ge x_j+a\), \(0\le x_1\) and \(x_N+a\le L\). Introduce free coordinates \(y_j=x_j-(j-1)a\). They obey \(0\le y_1\le\cdots\le y_N\le L-Na\). Their configuration volume is consequently \((L-Na)^N/N!\). We have already chosen one ordering sector for indistinguishable rods, so another division by \(N!\) would double-count the symmetry correction.
The momentum integral contributes one thermal wavelength per rod. Differentiating log partition function with respect to length gives the one-dimensional pressure, which has units of force:
In this geometry the second coefficient is \(a\) and successive virial terms are successive powers of the occupied length fraction. At \(na=0.10\) the first two terms give 1.10 rather than the exact 1.111, a one-percent relative pressure error. At \(na=0.40\) they give 1.40 instead of 1.667, a sixteen-percent error. The pressure becomes singular as free length vanishes even though the potential energy of every permitted configuration is zero.
A measurement of the mean internal energy alone would therefore find the same kinetic value as a one-dimensional ideal gas at each temperature and miss the entire excluded-volume pressure. Conversely a pressure fit over a narrow high-density interval can return an effective second coefficient quite unlike its true low-density limit. The exact hard-rod solution makes these two warnings quantitative without relying on a simulation or on a vaguely defined packing parameter.
There is also a contact-force interpretation. An arbitrary ordering gap between neighbouring rods has a broad distribution even if the total free length is strictly fixed. In the large-system limit the probability density for a free gap is exponential with mean \((1-na)/n\). The pressure fixes its inverse scale \(p/(k_BT)\), a one-dimensional illustration of how contact probabilities encode force on a wall. For a finite chain the fixed sum of all gaps correlates them, and their exact marginal distribution has a finite upper bound. A direct histogram of gap sizes is thus an independent test of whether a pressure-inferred excluded length really represents the particle geometry.
Infer a well range and depth from a two-temperature experiment
Suppose the core diameter has been determined from a high-temperature data set, and low-density pressure intercepts determine \(B_2/b=-0.541\) at 200 K and \(B_2/b=0.325\) at 400 K. In the square-well model define \(A=\lambda^3-1\) and \(x=e^{\epsilon/(400k_B)}\). The two observations imply \(A(x^2-1)=1.541\) and \(A(x-1)=0.675\). Divide to obtain
Therefore \(\epsilon/k_B=400\log1.283\simeq99.8\) K, \(A\simeq2.38\), and \(\lambda\simeq1.50\). The algebra retrieves the earlier microscopic model using only two temperatures and a separately known core size.
The ratio calculation also reveals an ill-conditioned regime. At temperatures both high relative to the well depth, \(x\) differs from one by a small amount. A modest relative uncertainty in the measured excess over the hard-core baseline can then dominate \(x-1\), and range and depth will move in opposite directions in a fit. Put the estimated model back into both original pressure values, then predict a third intermediate temperature without refitting. A correlated misestimate of the core diameter shifts both ratios and can survive the first two consistency tests.
Consider an alternative attraction with a smooth tail but the same two measured virial coefficients. Since each coefficient is a weighted integral over all separations, agreement at two temperatures imposes only two scalar constraints on an entire function of distance. Measuring the dilute \(g(r)\) supplies local information and can distinguish a broad shallow well from a narrow deep one. A third highly precise pressure reading cannot guarantee a unique functional form in the absence of a justified parametrisation, though it can falsify a particular two-parameter guess.
When estimating the pressure slope from experiment, do not fit \(Z_p\) at a single density as if the ideal intercept were measured there. Convert density units consistently, include the uncertainty in \(n\) entering both axes, fit several low-density points and test sensitivity to a quadratic term. If the inferred low-density intercept differs from one, check absolute pressure and temperature calibration before interpreting an empirical nonzero intercept as an interaction. No finite pair potential with a conventional dilute classical limit should create a constant deviation from ideality at zero density.
Use reciprocal-space scattering to test density fluctuations
A weak coherent probe scattered elastically by identical particles measures a momentum-transfer dependent structure factor. For positions \(\mathbf r_j\), define \(\rho_{\mathbf q}=\sum_j e^{-i\mathbf q\cdot\mathbf r_j}\). For nonzero \(\mathbf q\) in a uniform sample the dimensionless static factor is \(S(q)=\langle|\rho_{\mathbf q}|^2\rangle/N\), after subtracting coherent mean components where required. Expanding the absolute square gives \(N\) self terms and pair terms. Isotropy then connects the measured angular spectrum to the radial correlation via
At large \(q\) the oscillatory factor tends to cancel smooth pair contributions, approaching the self term for suitable fluids. At very small \(q\) the factor tends to one, giving the compressibility sum rule stated earlier. An experiment rarely measures exactly \(q=0\) because the incident beam itself occupies that direction. Extrapolation from small but finite angles is required. A correlation extending farther in real space produces structure at smaller \(q\), so insufficient low-angle coverage is equivalent to limited knowledge of long separations.
For hard spheres at leading density order, \(g-1=-1\) inside the core and zero outside. Integrate the sine kernel over that sphere to obtain a pair suppression proportional to \([\sin(q\sigma)-q\sigma\cos(q\sigma)]/(q\sigma)^3\). Its limit is one third before multiplication by the geometric coefficient. At \(q=0\) the correction is \(-4\pi n\sigma^3/3=-2nB_2\), exactly the pressure derivative prediction. At finite angle the correction oscillates even though the pair potential contains no oscillatory part. Interpreting every peak in an angular spectrum as a separate preferred particle spacing would overinterpret a Fourier transform.
Actual measured intensity also contains a one-particle form factor, detector background, finite beam shape and instrumental angular response. Determine the form factor in an independently diluted reference, then divide only in bands where it is sufficiently far from zero. Corrected \(S(q)\) should approach one at sufficiently large accessible \(q\) for a simple fluid model. A pressure-based low-\(q\) estimate and a independently estimated real-space core radius give two anchors on the scattering normalisation. Agreement across all three measurements is more discriminating than an arbitrary smooth normalisation of a single spectrum.
Separating exchange from interaction in a dilute virial measurement
An observed second virial correction is not always purely the configuration-space Mayer integral. Even an ideal quantum gas has exchange corrections when the thermal wavelength is appreciable. Expand the fugacity series of an ideal three-dimensional gas at small fugacity. With internal degeneracy one,
where the upper signs are for bosons. Eliminate \(z\) to second order to find
A Bose gas has a negative pressure correction and a Fermi gas positive at fixed density even without a material pair potential.
The relative importance scales as \(n\lambda_T^3\), growing on cooling and for lighter particles. This can be distinguished from a hard-sphere core whose classical second coefficient is temperature independent. A real weakly interacting quantum gas can have both effects, and a full quantum virial coefficient may require scattering phase shifts or bound-state information. A classical configuration integral with an added exchange term is at best an explicitly justified limit, not a universally accurate combination.
Predict a Joule expansion from the measured virial curve
An independently calibrated expansion gives an energy-based test of the low-density pressure law. Suppose an insulated vessel of gas expands freely into a second evacuated chamber. No external work or heat is exchanged, so the total internal energy is constant. For a general single-component simple fluid write \(dU=C_VdT+[T(\partial p/\partial T)_V-p]dV\). This identity follows from the Helmholtz mixed derivative and is testable even if detailed pair potentials are inaccessible. Insert the leading virial pressure at fixed particle number to connect temperature change directly with \(B_2'(T)\).
The excess energy per particle in this approximation is \(-k_BT^2nB_2'(T)\). For weak nonideality use the ideal monatomic per-particle heat capacity \(3k_B/2\) in the leading temperature correction and evaluate \(B_2'\) at the initial temperature. At fixed energy this gives
An attractive well with \(B_2'>0\) cools on expansion: fewer attractive neighbours raise potential energy, reducing the kinetic contribution. Pure hard-core exclusion has \(B_2'=0\) and does not change internal energy at fixed temperature in this model.
In the earlier square-well example the initial excess energy at 200 K and \(n_ib=0.030\) is approximately minus \(11.75k_B\) kelvin per particle. Doubling the available volume at nearly unchanged temperature halves that excess magnitude. The approximate increase in configurational energy is \(5.88k_B\) kelvin per particle, implying a translational temperature drop near 3.92 K. A fuller calculation solves the constant-energy equation with the final temperature inside the well Boltzmann factor; the difference between that and the linear estimate is a measure of the size of the correction itself.
Distinguish this experiment from throttling through a steady porous restriction, where enthalpy rather than internal energy is approximately conserved under idealised insulated flow conditions. A real-gas Joule–Thomson coefficient depends also on thermal expansion and molar volume. Pressure and density units can look almost identical in the two calculations, but the device boundary and the work term differ. Logging the direction of mass transfer and whether the total confined particle number remains fixed prevents a common misidentification.
Repeat the free expansion at several initial densities while controlling chamber heat capacity. A temperature change proportional to the density difference supports the leading pair correction; a constant offset suggests a thermometer or wall heat effect. An accidentally zero pressure deviation at the Boyle temperature need not make the expansion temperature change vanish, because the temperature derivative of the virial coefficient remains finite there. Jointly observing near-ideal pressure and measurable cooling is exactly the distinction between a function crossing zero and its derivative crossing zero.
A useful uncertainty estimate comes directly from the linear expansion thermometer. In the illustrated twofold expansion the roughly four-kelvin temperature shift scales with the initial density and with the temperature derivative of the virial coefficient. If both wall thermometers share a common zero offset, an initial-minus-final temperature difference largely cancels it, but a drifting temperature scale can remain. Use a control expansion of a gas well represented as ideal under the same laboratory conditions; an apparent cooling there bounds residual wall and valve effects. Independently reversing the gas transfer between two matched bulbs changes wall-specific artefacts while retaining the expected sign for true free expansion. Quantitative agreement should involve the gas energy change plus heat transferred to thermometer mounts and vessel walls, not merely two indicated peak temperatures.
Recover a virial coefficient from a pair interaction
Vary the range and temperature of an attractive interaction. Identify where its attractive and excluded-volume contributions cancel.
Tutorial · Determine an effective diameter from high-temperature pressure
A gas at high enough temperature for its attraction to be negligible is dilute. A fit of \(Z_p-1\) versus particle density gives a slope \(1.00\times10^{-28}\) cubic metres. Infer the hard-sphere diameter. A student instead interprets that slope as the volume of one sphere. Quantify the error.
Apply the pair geometry and inspect the fit range
Set the slope equal to \(2\pi\sigma^3/3\), giving \(\sigma=3.63\times10^{-10}\) m. Using the physical sphere volume \(\pi\sigma^3/6\) instead makes the diameter too large by \(4^{1/3}=1.587\), giving 0.576 nm rather than 0.363 nm. Check the fit extrapolated toward zero density and examine curvature as the maximum included density is reduced. A small slope uncertainty based on a linear regression does not include a systematic neglected third virial term.
Tutorial · Use energy to break an attractive-potential degeneracy
At one temperature two square wells with the same core yield the same negative \(B_2\), one deep and narrow, one shallow and broad. Show how an independent calorimetric energy measurement can distinguish them and specify a limiting regime in which the additional measurement becomes weak.
Identify two different combinations of range and depth
At fixed temperature the pressure supplies \((\lambda^3-1)(e^x-1)\), with \(x=\beta\epsilon\). The excess energy divided by \(-nbk_BT\) instead supplies \((\lambda^3-1)x e^x\). Their ratio is \(x/(1-e^{-x})\), a monotone function of positive \(x\). With a known core and sufficiently accurate data it determines \(x\), then the original pressure combination determines range. At \(x\ll1\) the ratio approaches \(1+x/2\); its excess above one becomes small compared with calibration noise. Several temperatures can then be more informative than one highly uncertain difference.
Tutorial · Design an independent histogram check of pressure and energy
A dilute well fluid has measured \(g=0\) in the core, \(g=1.65\) across its attractive shell and \(g=1\) outside. Take \(\lambda=1.5\), \(nb=0.03\) and \(T=200\) K. Infer approximate well depth and mean neighbours in the shell. Compare the resulting potential energy with the thermodynamic prediction.
Integrate the actual shell volume and count unordered pairs
The dilute relation gives
The shell volume is \(2b(\lambda^3-1)\), giving mean shell neighbours per particle \(0.03(2)(2.375)(1.65)=0.235\). Dividing by two gives mean potential energy \(-0.1176\epsilon\) per particle, matching the derivative calculation. Using an unnormalised radial pair histogram or counting the same bond twice would spoil this agreement.
Now repeat at higher density. A measured effective potential \(-k_BT\log g\) is then a potential of mean force containing the effect of other neighbours. Inserting it into the original low-density two-body virial integral as if it were the bare pair potential double-counts many-body correlations. The direct energy integral using a known actual pair potential and the measured full \(g\) remains appropriate for a pairwise-additive fluid.
Cambridge Statistical Physics · interacting classical gases and cluster expansion