Equations of state: from the ideal gas to a real one
The puzzle: a lighter that sloshes, a cylinder that never does¶
Shake a butane lighter and you can hear it: liquid fuel, sloshing inside a transparent plastic shell, at room temperature, held there by nothing more exotic than the pressure of its own vapour. Beside it, a steel cylinder of compressed nitrogen sits on a workbench. Squeeze its regulator as hard as engineering allows and nothing sloshes — nitrogen at room temperature never liquefies, no matter how hard you compress it.
Both are just gases confined under pressure. Both, at low enough density, obey the same law:
That law has no substance-specific constant in it anywhere — no molecular size, no attraction, nothing that could possibly distinguish butane from nitrogen. A law blind to what the molecules are cannot explain why one of them puddles at room temperature and the other flatly refuses to.
The answer is not exotic. Real molecules attract each other weakly at a distance, and they are not points — they take up room. Putting both effects back into the equation of state, carefully, is this module’s entire content.
Predict before you calculate¶
Commit to an answer for each of these before running anything. Write them down.
You have a gas bottle at . You bring an identical second bottle and open the valve between them, so the two merge into one system at the same — twice the gas, in twice the volume. Which of , , , , change, and which stay the same?
at is compressed slowly at fixed temperature. As the volume shrinks, does the pressure keep climbing, level off at some point, or do something else? Sketch the curve you expect.
Is there a temperature above which no pressure, however large, can turn a gas into a liquid?
Two different gases — say and — are each held at the same reduced temperature and reduced pressure (that is, the same multiple of their own critical temperature and critical pressure, even though those critical points are wildly different numbers). Do the two gases have the same compressibility factor , or does depend on which gas it is?
Explore the model¶
The laboratory notebook for this module lets you build a substance’s van der Waals surface from its constants and , morph it continuously from the flat ideal-gas sheet, drag a state point across it, and watch the three shadows that point casts onto the surrounding walls.
Here is the surface itself, rotating, as and turn on from zero and a fold appears where a flat sheet used to be:
The van der Waals surface, morphing on from the flat ideal-gas sheet as and are turned up to a real substance’s values. The fold that appears below the critical temperature is the geometric signature of liquefaction — nothing in the flat ideal surface could ever produce it.
Now watch a single isotherm sweep down through the critical temperature:
One van der Waals isotherm, replotted as its temperature sweeps from above the critical temperature to below it. Above the curve falls smoothly, just like an ideal gas. Below it develops a non-monotonic wiggle — the van der Waals loop — flagged here and left unexplained; see Verify.
And here is a single state point sliding across the surface, its three shadows tracing an isotherm, an isochore, and an isobar onto the three walls around it:
A state point moves in three legs — constant , then constant , then constant — and its shadow on each wall traces the corresponding named curve: an isotherm, an isochore, an isobar. Every point on the surface is simultaneously all three kinds of curve, depending on which pair of coordinates you hold fixed.
Run the laboratory now, then come back. Three things are worth doing before you read on:
Set and confirm the surface is perfectly flat — the ideal gas, with no fold anywhere, whatever temperature you look at.
Turn on a substance’s and and watch the fold appear below its critical temperature.
Join two identical samples in the doubling-test cell and check which quantities the printed table says changed.
Derive the result¶
The state postulate¶
Intensive versus extensive: the doubling test¶
Pressure had better be intensive for “the pressure of the gas” to mean anything: two adjacent litres of the same gas at the same temperature must report the same pressure, or a single gauge reading would be meaningless. The laboratory verifies this by direct computation for every equation of state below; the doubling test above is the reason it must come out that way.
The ideal gas law, reviewed¶
Two corrections, and the van der Waals equation¶
Excluded volume. A real molecule is not a point; it excludes other molecules from the small region it occupies. Replacing the per-particle volume available to move around in with the reduced volume :
Because the denominator is smaller than , this correction alone always raises the pressure above the ideal value: molecules crowded into less usable room collide with the walls more often.
Adding both corrections to the ideal gas law gives the van der Waals equation of state:
Setting recovers the ideal gas law exactly — not approximately, as
Verify checks directly against gases.ideal_gas_pressure.
Neither correction is derived from first principles here; each is argued physically and
then simply added, which is exactly why the box above is a model-assumption, not a
theorem: the van der Waals equation is a plausible model, not a consequence of the state
postulate the way the ideal gas law can be read as one.
The critical point¶
Look again at the isotherm animation above. Above , pressure falls monotonically as grows — one for every , exactly as for an ideal gas. Below , the curve is no longer monotonic: it rises where it should fall. The boundary between the two behaviours is a single special point, where the isotherm’s slope and its curvature both vanish at once:
Because depends on and alone — no explicit , since is intensive — solving these two equations together (a standard but slightly tedious piece of algebra, omitted here) gives:
Reduced variables and the compressibility factor¶
Define reduced variables , , — pressure, per-particle volume and temperature measured in units of the substance’s own critical point. Substituting the closed forms above into the van der Waals equation and simplifying eliminates , and every substance-specific number entirely:
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. The ideal-gas limit. As , gases.van_der_waals_pressure converges on
gases.ideal_gas_pressure — the same function module 4 and
module 5 already rely on (kinetics.py and paths.py import it from
gases.py rather than each carrying their own copy).
2. The critical point: closed form versus a numerical scan. vdw_critical_point gives
from three lines of algebra. The laboratory also measures a second,
independent way — the kind of procedure an experimentalist without a closed form would actually
run. Note what that procedure cannot be: below the isotherm’s loop makes
cross zero at two perfectly ordinary points, so simply hunting for the
smallest slope anywhere on a grid finds a sub-critical isotherm just as happily as the critical
one. The laboratory instead sweeps down through the supercritical branch, where the isotherm
stays monotonic and its flattest point shrinks continuously toward zero as , and
stops at the first temperature that flattens below a small threshold.
3. Z approaches 1 in the dilute limit. As at fixed , both correction terms in the van der Waals equation vanish and — the formal statement of “ideal gas” as a limit rather than a category.
4. The NIST CO2 isotherm falsifies “the ideal gas law is universal”. data/co2-isotherm-280k.csv
holds representative published values for carbon dioxide’s isothermal pressure-volume
behaviour at — comfortably below 's critical temperature of
. Computing along that isotherm and overlaying the ideal
prediction shows the two diverging sharply as the gas is compressed: the measured
pressure plateaus at the substance’s saturation pressure while a naive
prediction keeps climbing without limit, and falls to a small fraction of 1 deep in the
two-phase region.
Transfer the idea¶
Back to module 4. The empirical box above gets its microscopic derivation there — this module states ; that one derives it from particles bouncing off walls.
Forward to module 6. Every process this course studies from here on is a curve drawn on the surface this module builds; module 6’s work ledger integrates along such curves.
Forward to module 9. , and all doubling together under the doubling test is exactly the extensivity the fundamental relation’s Euler relation depends on.
Forward to module 14, named and dated. The wiggle above is real, checkable, and unexplained here — module 14 names it, resolves it with the Maxwell construction, and reuses these exact isotherms to do it.
Forward to module 17. Even the “ideal” sheet fails eventually — in the cryogenic, quantum-degenerate regime, where stops being the right limit.
Check your understanding¶
The state postulate says a simple compressible substance’s equilibrium states form a single two-dimensional surface in (P, v, T) space. Given the values of any two independent intensive variables -- say P and T -- what does the state postulate say about the rest?
A. v (and every other equilibrium property) is already fixed -- the two you chose pick out one point on the surface, and a point on a surface has no remaining freedom. B. P, v and T are three fully independent knobs, so all three must be measured separately. C. Only extensive variables like V and N determine the state; P and T alone are not enough. D. This is true only for the ideal gas; real gases need a third independent variable.
Check your answer
Correct answer: A — v (and every other equilibrium property) is already fixed -- the two you chose pick out one point on the surface, and a point on a surface has no remaining freedom.
A. Right. That is exactly what “a single two-dimensional surface” means: two coordinates locate a point on it, and the third coordinate is then read off, not separately chosen.
B. This is what the state postulate denies. If P, v and T were independent, equilibrium states would fill a three-dimensional volume, not sit on a two-dimensional surface -- and there would be no such thing as “the equation of state”.
C. Backwards. P and T (both intensive) are exactly what the state postulate says suffices to fix v; N sets how much substance you have, not which point on the per-particle surface it occupies.
D. The state postulate is a general claim about any simple compressible substance’s equilibrium surface -- the van der Waals gas included. It does not add a degree of freedom the ideal gas lacked.
You have a gas bottle at (N, V, T). You open a valve to an identical second bottle at the same state, merging into one system with twice the gas, in twice the volume, at the same T. Which of the following correctly lists what changes?
A. V, N and U (the internal energy) double; P and T stay exactly the same. B. P, V, T and N all double. C. Nothing changes -- joining two identical systems just makes a bigger version of the same state. D. Only T changes, since heat flows between the two halves until they equilibrate.
Check your answer
Correct answer: A — V, N and U (the internal energy) double; P and T stay exactly the same.
A. Correct -- the doubling test: extensive quantities (V, N, U) double, intensive quantities (P, T, and v = V/N) do not move at all.
B. Doubling P and T along with V and N would make “the pressure of the gas” depend on how much gas happened to be in the room -- which cannot be right, since two adjacent litres of the same gas at the same temperature must report the same pressure.
C. V, N and U genuinely double; the two halves really do add up to twice the substance. Only the intensive quantities (P, T, v) stay fixed, not everything.
D. The two halves start at the same T, so there is nothing to equilibrate -- T was never going to move, and neither was P.
A room measures 30 m^3 and holds air at 101325 Pa and 293 K. Using P V = N k_B T with k_B = 1.381e-23 J/K, how many gas particles does the room contain?
Check your answer
Correct answer: 7.51e+26 (± 2e+24)
N = P V / (k_B T) = (101325)(30) / [(1.381e-23)(293)] = 7.51e26 particles -- the same calculation as P V = N k_B T, solved for N instead of P.
CO2 gas at 280 K is compressed slowly at fixed temperature, well past several times its critical volume. Which best describes what a pressure gauge on the container actually reads, compared with the ideal-gas prediction P = k_B T / v?
A. The measured pressure climbs more slowly than the ideal prediction, then plateaus at the substance’s saturation pressure while the ideal prediction keeps climbing without limit. B. The measured pressure tracks P = k_B T / v exactly at any density, since every gas obeys the ideal gas law. C. The measured pressure rises faster than the ideal prediction at every volume. D. The measured pressure drops to zero once the substance starts to condense.
Check your answer
Correct answer: A — The measured pressure climbs more slowly than the ideal prediction, then plateaus at the substance’s saturation pressure while the ideal prediction keeps climbing without limit.
A. Right -- this is exactly what the NIST CO2 isotherm data in this module shows: the real gas departs from P = k_B T / v well before condensation, and then flattens into a plateau the ideal law has no mechanism to produce at all.
B. This is exactly the claim the module’s NIST CO2 data falsifies. The ideal gas law contains no substance-specific constant, so it cannot know that CO2 condenses -- real CO2’s measured pressure departs sharply from the ideal prediction long before the plateau, let alone during it.
C. Attraction dominates over most of the compression, which lowers the measured pressure below the ideal prediction, not raises it -- only deep in the compressed liquid does pressure rise steeply.
D. Condensation holds the pressure at a constant, nonzero value -- the saturation pressure -- not zero. A pressure of zero would mean no gas left at all.
Using a, b fit from CO2’s measured critical point (T_c = 304.13 K, P_c = 7.3773e6 Pa, via a = 27(k_B T_c)^2/(64 P_c), b = k_B T_c/(8 P_c)), compute the van der Waals pressure at a molar volume of 1.2e-3 m^3/mol (per-particle v = V_m/N_A) and T = 280 K. Give the signed fractional deviation from the ideal prediction k_B T/v at the same state (negative if the van der Waals pressure is lower).
Check your answer
Correct answer: -0.094 (± 0.01)
Ideal: P = k_B T/v ~= 1.940e6 Pa. Van der Waals: P ~= 1.758e6 Pa. The attraction term a/v^2 dominates at this density -- the excluded-volume correction 1/(v-b) is still close to 1/v since v is far larger than b here -- so the net shift is negative, about -9.4%, well before condensation is anywhere in sight.
A gas has per-particle van der Waals constants a = 1.0037e-48 Pa m^6 and b = 7.0855e-29 m^3 (converted from independently published textbook molar constants for CO2, not fit from its critical point). Using k_B T_c = 8a/(27b), compute T_c in kelvin.
Check your answer
Correct answer: 304.0 (± 1.0)
T_c = 8a/(27 k_B b) ~= 304.0 K -- within 0.1% of CO2’s measured critical temperature, 304.13 K, even though a and b here came from an independent fit, not from the critical point itself. P_c = a/(27 b^2) ~= 7.40e6 Pa lands within about half a percent of the measured 7.3773e6 Pa the same way.
Two different gases -- say CO2 and N2 -- are held at the same reduced temperature T_r and the same reduced pressure P_r, even though their critical points (and their a, b) are completely different numbers. Do the two gases have the same compressibility factor Z, or does Z depend on which gas it is?
A. The same Z -- the law of corresponding states says any van der Waals substance at a given (T_r, P_r) has the same reduced volume v_r, and Z is built entirely out of reduced quantities once P_c v_c/(k_B T_c) = 3/8 is used to eliminate the substance- specific constants. B. Z depends on the gas’s chemistry, so it is never the same for two different gases. C. The same Z, but only because CO2 and N2 happen to have similar molecular masses -- for a very different pair of gases it would not hold. D. Only if both gases are measured at exactly their own critical points, T_r = P_r = 1.
Check your answer
Correct answer: A — The same Z -- the law of corresponding states says any van der Waals substance at a given (T_r, P_r) has the same reduced volume v_r, and Z is built entirely out of reduced quantities once P_c v_c/(k_B T_c) = 3/8 is used to eliminate the substance- specific constants.
A. Correct. P_r = 8T_r/(3v_r - 1) - 3/v_r^2 has no a, b or N_A left in it at all, so fixing (T_r, P_r) fixes v_r -- and hence Z -- the same way for every van der Waals substance, regardless of its own critical point.
B. This is true of the un-reduced pressure -- two gases at the same (v, T) generally have different P, because a and b differ. But once P, v and T are measured in units of each gas’s own critical point, that substance-specific information cancels out of the reduced equation entirely.
C. The law of corresponding states does not depend on molecular mass, or on any property of the two gases matching -- it follows from a, b cancelling out of the reduced van der Waals equation algebraically, for any pair of substances at all.
D. The reduced equation holds at every (T_r, P_r), not only at the critical point -- T_r = P_r = 1 is just the one point every reduced isotherm is required to pass through, by construction.
In a few sentences: explain why a real substance’s P-v-T surface can fold below its critical temperature while the ideal-gas surface never can, naming the physical role that a and b each play in producing the fold.
Check your answer
The ideal-gas surface P = k_B T/v is smooth and monotonically falling in v at every fixed T, for the simple reason that it has no substance-specific information in it at all -- nothing in the formula can produce a region where pressure rises with volume. The van der Waals correction adds two such pieces of information: b, the excluded volume, which diverges the pressure as v approaches b from above; and a, the mean-field attraction, which pulls the pressure down at larger v. Below T_c, the competition between a rapidly rising 1/(v-b) term at small v and a slowly falling a/v^2 term at larger v produces a genuine non-monotonic region -- the fold, and its wiggle -- that cannot exist without both ingredients: setting either a or b to zero removes the critical point entirely (Problem 5(d) on the problem set makes this precise).
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.
Explain why calling the ideal gas law a “law” can mislead a reader, and say precisely what kind of statement it actually is.
Explain, without writing an equation, why no pressure — however large — liquefies a gas above its critical temperature.
Explain why is intensive although and are each extensive.
Describe what would be physically wrong with a substance whose isotherm had somewhere.
Advanced: the virial expansion¶
The van der Waals equation is one particular, simple model of “real gases differ from ideal ones.” The systematic version of the same idea writes the compressibility factor as a power series in the density :
the virial expansion, whose coefficients can in principle be computed exactly from the intermolecular potential, order by order, rather than guessed at with two constants. Expanding the boxed van der Waals equation in powers of gives its own second virial coefficient in closed form:
At low , — attraction dominates and ; at high , — excluded volume dominates and . The crossover defines the Boyle temperature,
the one temperature at which a van der Waals gas behaves ideally () over the widest possible range of density, because the two corrections cancel to leading order in at every density simultaneously. Real gases have Boyle temperatures too, and the virial expansion — unlike the two-constant van der Waals model — can in principle be pushed to as many terms as the data justify.