Pump up a bike tyre and the plunger gets harder to push the more you squeeze — the trapped air shoves back. Heat a sealed bottle and it can pop. There is nothing mysterious here: a gas is a swarm of tiny molecules flying around and bouncing off the walls. Each bounce is a tiny tap; billions of taps per second, spread over the wall area, is what we feel as pressure. Squeeze the gas into less room and the same molecules hit the walls more often, so the pressure climbs. Warm them up and they fly faster, hitting harder — pressure climbs again.
Four quantities describe a gas: pressure $P$, volume $V$, absolute temperature $T$ (always in kelvin), and amount $n$ (in moles). Three everyday rules connect them. Boyle: squeeze it ($V$ down) and $P$ goes up. Charles: heat it ($T$ up) and it wants to expand ($V$ up). Avogadro: add more gas ($n$ up) and it takes more room. Stitched together they become the single ideal gas law:
with $R = 0.0821\ \text{L·atm·mol}^{-1}\text{K}^{-1}$. One worked number: how much space does $1$ mole of any gas fill at room temperature ($300$ K) and $1$ atm? $V = nRT/P = (1)(0.0821)(300)/1 \approx 24.6$ L — about the volume of a small office bin. That is why a mole is such a handy counting unit for chemists.
Real molecules are not points and they do attract each other, so the ideal law slips at high pressure or low temperature. Van der Waals patched it with two correction terms:
Here $a$ measures the attraction between molecules (it pulls them inward, lowering the wall pressure) and $b$ is the space the molecules themselves occupy (it shrinks the free volume to $V-nb$). The single number that tells you how far a gas strays from ideal is the compressibility factor $Z = PV/nRT$: $Z=1$ is perfectly ideal, $Z<1$ means attractions are winning, and $Z>1$ means crowding (finite size) is winning. The $T$, $V$, $n$, $a$ and $b$ sliders feed straight into these equations, and the readout panel shows $P$, $Z$ and the van der Waals pressure live.
Pick the Ideal Gas preset ($a=b=0$) and drag the volume slider down — watch $P$ shoot up while $P\times V$ stays fixed: that is Boyle's law in action. Next switch to the CO₂ preset and open the Z Compressibility graph; notice $Z$ dipping below $1$ as pressure rises, the signature of intermolecular attraction. Finally, crank the temperature toward $800$ K and watch $Z$ climb back toward $1$ — gases behave most ideally when they are hot and dilute.
| Symbol | Meaning | Unit |
|---|---|---|
| $P$ | Pressure | atm, Pa (1 atm = 101.325 kPa) |
| $V$ | Volume | L or m³ |
| $n$ | Amount of substance | mol |
| $R$ | Universal gas constant | 0.08206 L·atm·mol⁻¹·K⁻¹ = 8.314 J·mol⁻¹·K⁻¹ |
| $T$ | Absolute temperature | K |
| $a$ | vdW attraction parameter | L²·atm·mol⁻² |
| $b$ | vdW excluded volume parameter | L·mol⁻¹ |
| $Z$ | Compressibility factor: $Z = PV/nRT$ | dimensionless |
| Slider | Symbol | Effect on Pressure |
|---|---|---|
| Temperature | $T$ | P = nRT/V: linear increase |
| Volume | $V$ | P = nRT/V: inverse (Boyle's Law) |
| Amount | $n$ | P = nRT/V: linear increase |
| vdW a | $a$ | Decreases P: attractive correction |
| vdW b | $b$ | Increases P: excluded volume correction |