LocusBlog

Ideal gas law

The ideal gas law ties the four things you can measure about a gas into one equation:

$$pV = nRT$$

$p$ is the absolute pressure in pascals, $V$ the volume in cubic metres, $n$ the amount in moles, $T$ the absolute temperature in kelvin, and $R$ the universal gas constant, $8.314$ J/(mol$\cdot$K). OpenStax rounds it to $8.31$, which costs nothing at three significant figures.

Read the units of $R$ and the equation explains itself. J/(mol$\cdot$K) times mol times K is joules, and $pV$ in Pa$\cdot$m$^3$ is (N/m$^2$)(m$^3$) = N$\cdot$m, also joules. Both sides are an energy. That dimension check is worth doing once by hand, because it is the fastest way to catch a volume left in litres.

The temperature must be absolute

Every other quantity in $pV = nRT$ tolerates a change of units. Temperature does not, and this is where the wrong answers live.

Seal a rigid container of gas at $1.00$ atm and $27.0^\circ$C, then heat it to $54.0^\circ$C. Volume and amount are fixed, so $p \propto T$, and the Celsius reading has doubled. A gas that was at one atmosphere is now at two.

It is not. Convert first: $T_1 = 27.0 + 273.15 = 300.15$ K and $T_2 = 54.0 + 273.15 = 327.15$ K. The ratio is $327.15/300.15 = 1.0900$, so

$$p_2 = 1.00 \times 1.0900 = 1.09\ \text{atm}$$

A nine percent rise, not a hundred. The Celsius answer is 83 percent too high, and it gets worse near room temperature and absurd near $0^\circ$C, where a ratio against zero is undefined outright.

The reason is in the law itself. $pV = nRT$ says that at $T = 0$ a gas at fixed volume has zero pressure. Gas at $0^\circ$C plainly has pressure, so $0^\circ$C is not the zero of the scale the equation means. Celsius is an interval scale with an arbitrary origin: differences on it are meaningful, ratios are not. Any time the gas law asks you to divide one temperature by another - which the combined form below does every time - the temperatures have to be kelvin.

Counting molecules in one step

A cylinder of $0.0500$ m$^3$ holds oxygen at $15.0$ MPa and $295$ K. How much gas is in it?

$$n = \frac{pV}{RT} = \frac{15.0\times10^{6} \times 0.0500}{8.314 \times 295} = \frac{7.50\times10^{5}}{2452.6} = 306\ \text{mol}$$

Oxygen is $32.0$ g/mol, so that is $9.79$ kg of gas. The dimension check from the opening confirms the arrangement: J divided by J/(mol$\cdot$K) and by K leaves mol, so the answer came out in the right thing without anyone hoping it would.

Open the valve and let it all out into the room at $101.325$ kPa, still at $295$ K. Now $n$, $R$ and $T$ are all unchanged, so $pV$ must be too:

$$V_2 = V_1\frac{p_1}{p_2} = 0.0500 \times \frac{15.0\times10^{6}}{101325} = 7.40\ \text{m}^3$$

Check by going back to the full law with the unrounded amount, $305.8$ mol: $V_2 = nRT/p_2 = 305.8 \times 8.314 \times 295 / 101325 = 7.40$ m$^3$. The same number by a route that never assumed $n$ stayed put.

Two states, and why the combined form is easier

That second calculation used a shortcut worth stating on its own. If the amount of gas does not change, $pV/T = nR$ is the same constant before and after, so

$$\frac{p_1V_1}{T_1} = \frac{p_2V_2}{T_2}$$

This is almost always the cleaner tool, for two reasons. You never have to know $n$, which most problems do not tell you. And because every quantity appears as a ratio, $p$ and $V$ only need consistent units, not SI ones - atmospheres and litres work, as long as both sides use the same. $T$ is the exception, again, because kelvin is the only temperature scale on which those ratios mean anything.

Molar volume at standard conditions is worth computing rather than memorising, because it shows where the familiar number comes from. Set $n = 1$ and solve for volume:

$$V_m = \frac{RT}{p} = \frac{8.314 \times 273.15}{101325} = 2.2413\times10^{-2}\ \text{m}^3 = 22.41\ \text{L}$$

That is the $22.4$ litres per mole that gets quoted, and it belongs to $273.15$ K and one atmosphere. Run it again at $100$ kPa, the round number that some conventions use for standard pressure, and you get $8.314 \times 273.15/100000 = 2.2710\times10^{-2}$ m$^3$, or $22.71$ L. The two differ by 1.3 percent, which is exactly the ratio of the two pressures, so a problem that quotes $22.4$ and a problem that quotes $22.7$ are not in conflict - they disagree about what “standard” means, and the law does not care.

Where “ideal” stops being true

The derivation behind $pV = nRT$ treats gas molecules as points with no volume of their own, exerting no force on each other except during instantaneous elastic collisions. Both assumptions are approximations, and both fail in ways you can predict.

Molecular volume matters when the gas is dense. Go back to the oxygen cylinder: $0.0500$ m$^3$ shared among $306$ mol is $1.64\times10^{-4}$ m$^3$ per mole, or $0.164$ L/mol. Compare that with $22.41$ L/mol at standard conditions and the gas in the cylinder is 137 times denser. The molecules’ own volume is a negligible fraction of $22.41$ L; it is not a negligible fraction of $0.164$ L. This is why filling and emptying high-pressure cylinders is done with measured compressibility factors rather than with $pV = nRT$, and why the $306$ mol above should be read as a first estimate.

Intermolecular attraction matters when the gas is cold, which in practice means near the temperature where it would condense. Attraction pulls molecules slightly away from the walls as they arrive, so the measured pressure is below the ideal prediction. A gas that is about to become a liquid is a gas whose molecules are noticeably interested in each other, and the ideal model has declared in advance that they are not. Steam near $100^\circ$C departs from ideality far more than nitrogen at room temperature does, at the same pressure.

The standard repair is the van der Waals equation, which subtracts an excluded volume from $V$ and adds a correction to $p$, with two constants fitted per gas. Away from those two regimes - roughly, a gas at ordinary pressures and well above its boiling point - the ideal gas law is good to a percent or better, and it stays the right first move. Running a batch of ideal gas problems is mostly practice at deciding which of the two forms a question wants, and the simulations let you change one variable and watch the other three settle.

References