Understanding the compressibility factor (Z) calculator — concept and principle
The compressibility factor Z tells you how far a real gas departs from ideal-gas behaviour. This calculator finds Z from measured pressure, volume, amount and temperature, and compares it with the van der Waals equation for a chosen gas.
How it is calculated
- Z = PV ÷ (nRT), with R = 0.082057 L·atm/(mol·K) and T in kelvin.
- Ideal-gas pressure = nRT ÷ V.
- Van der Waals: P = nRT ÷ (V − nb) − an² ÷ V², with a and b for the chosen gas (CO₂: a = 3.59 L²·atm/mol², b = 0.0427 L/mol).
- Molar volume = V ÷ n; deviation = Z − 1.
- 1 atm = 101.325 kPa = 1.01325 bar; 1 psi = 6.894757 kPa.
The principle
The ideal gas law assumes molecules have no size and do not attract each other. Real molecules do both. Attractions pull molecules together and lower the pressure on the walls, making Z less than 1. The molecules' own volume leaves less free space and raises the pressure, making Z greater than 1. Which effect wins depends on temperature and pressure. Van der Waals added two constants to capture these effects: a for attraction and b for size.
Worked example
Default inputs: 32.4 atm, 4.25 L, 3.46 mol, 228.85 °C (502.0 K), CO₂.
- Ideal pressure = 3.46 × 0.082057 × 502.0 ÷ 4.25 ≈ 33.536 atm.
- Z = 32.4 ÷ 33.536 ≈ 0.9661: attractive forces dominate; deviation −3.39%.
- Van der Waals: 142.53 ÷ (4.25 − 0.1477) − 3.59 × 3.46² ÷ 4.25² ≈ 34.744 − 2.379 ≈ 32.364 atm; van der Waals Z ≈ 0.9651.
- Molar volume = 4.25 ÷ 3.46 ≈ 1.2283 L/mol.
| Amount of gas (mol) | Compressibility factor Z |
|---|---|
| 0.865 | 3.8645 |
| 1.73 | 1.9323 |
| 2.6 | 1.2882 |
| 3.46 | 0.9661 |
| 4.33 | 0.7729 |
| 5.19 | 0.6441 |
| 6.92 | 0.4831 |
How to read the result
Z within a few per cent of 1 means the ideal gas law is a reasonable approximation. Larger deviations occur at high pressure and near the gas's condensation conditions. Here the van der Waals pressure agrees with the measurement to about 0.1%, showing that the model captures this case well.
Common mistakes
- Using Celsius instead of kelvin.
- Mixing pressure units with the wrong R value.
- Using total volume instead of molar volume when comparing with charts.
- Applying van der Waals constants for a different gas.
Frequently asked questions
What does Z less than 1 mean?
Attractions between molecules make the gas occupy less volume (or exert less pressure) than an ideal gas.
When is a gas close to ideal?
At low pressure and high temperature relative to its critical point.
What do a and b mean in van der Waals?
a corrects for attraction between molecules; b corrects for the volume the molecules occupy.
Sources: Atkins, P. & de Paula, J., Physical Chemistry (real gases, van der Waals equation) · CRC Handbook of Chemistry and Physics, van der Waals constants for gases