← SciSim / Chemistry

Gas Laws — Ideal & van der Waals

Physical Chemistry #7

§1 Interactive Simulation

Particle Box
PV Isotherms
Boyle's Law
Charles's Law
van der Waals Gas
P vs V (Isotherms)
PV vs P
Z Compressibility
P vs T (Gay-Lussac)
Virial Deviation
P (atm)
V (L)
T (K)
n (mol)
Z = PV/nRT
P_vdw (atm)



Show velocity vectors
Color by KE
Show ideal vs vdW
Show wall pressure

§2 The Idea, Step by Step

Start: gas is just molecules drumming on the walls

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.

Build: four knobs and one equation

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:

$$PV = nRT$$

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.

Deepen: real gases bend the rule

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:

$$\left(P + \frac{an^2}{V^2}\right)\!\left(V - nb\right) = nRT$$

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.

Try this in the sim above

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.

§3 Equation Derivation

Ideal Gas Law & van der Waals Equation

$$PV = nRT \qquad \text{(Ideal Gas Law)}$$ $$\left(P + \frac{an^2}{V^2}\right)\!\left(V - nb\right) = nRT \qquad \text{(van der Waals, 1873)}$$

Symbol Definitions

SymbolMeaningUnit
$P$Pressureatm, Pa (1 atm = 101.325 kPa)
$V$VolumeL or m³
$n$Amount of substancemol
$R$Universal gas constant0.08206 L·atm·mol⁻¹·K⁻¹ = 8.314 J·mol⁻¹·K⁻¹
$T$Absolute temperatureK
$a$vdW attraction parameterL²·atm·mol⁻²
$b$vdW excluded volume parameterL·mol⁻¹
$Z$Compressibility factor: $Z = PV/nRT$dimensionless

Derivation from Kinetic Molecular Theory

Step 1 — Pressure from momentum transfer
A particle of mass $m$ with x-velocity $v_x$ hitting a wall transfers momentum $2mv_x$. The frequency of hits per unit area is $n_V v_x / 2$ (where $n_V$ = number density). Pressure = force/area = momentum transfer rate per area: $$P = n_V m \langle v_x^2 \rangle$$
Step 2 — Equipartition
By equipartition: $\frac{1}{2}m\langle v_x^2\rangle = \frac{1}{2}k_BT$. Also $\langle v^2\rangle = 3\langle v_x^2\rangle$ by isotropy. Therefore: $$P = \frac{1}{3}n_V m\langle v^2\rangle = \frac{n_V k_B T \cdot 3}{3} = n_V k_B T$$
Step 3 — From number density to moles
$n_V = N/V = nN_A/V$. Substituting: $P = (nN_A/V)k_BT = n(N_Ak_B)T/V = nRT/V$. Rearranging: $$\boxed{PV = nRT}$$
Step 4 — van der Waals corrections
Real gases deviate because: (i) molecules have finite volume → available volume is $V - nb$; (ii) intermolecular attractions reduce wall impact → effective pressure is $P + an^2/V^2$: $$\left(P + \frac{an^2}{V^2}\right)(V-nb) = nRT$$ The $an^2/V^2$ term is the internal pressure due to attractions; $b$ is roughly 4× the actual molecular volume.
Step 5 — Compressibility factor Z
$$Z = \frac{PV}{nRT} = 1 + \left(b - \frac{a}{RT}\right)\frac{P}{RT} + \cdots$$ At low P: Z → 1 (ideal). At moderate P: attractive forces dominate (Z < 1). At high P: repulsive (excluded volume) dominates (Z > 1).

Simulation Variable Mapping

SliderSymbolEffect 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

Worked Example

Problem: 1 mol CO₂ at 40°C in 1 L. Compare ideal and van der Waals pressures. (a = 3.59 L²·atm/mol², b = 0.0427 L/mol)

Ideal: $P = nRT/V = (1)(0.08206)(313)/1 = \mathbf{25.68}$ atm
vdW: $P = nRT/(V-nb) - an^2/V^2 = (1)(0.08206)(313)/(1-0.0427) - 3.59(1)^2/(1)^2$ $= 25.68/0.9573 - 3.59 = 26.82 - 3.59 = \mathbf{23.23}$ atm

Difference: the vdW pressure is ~9.5% below ideal — significant at high pressure/low volume. Z = 23.23/25.68 = 0.905 (attractive forces dominate).
📚 Reference: Atkins & de Paula — Physical Chemistry, 11th Ed., Chapter 1.3: "Real Gases". Levine — Physical Chemistry, 6th Ed., §8.2. McQuarrie & Simon — Physical Chemistry: A Molecular Approach, Chapter 16.

§4 Frequently Asked Questions

📚 FAQ Reference: LibreTexts Chemistry — "Real Gases: Deviations from Ideal Behavior" (chem.libretexts.org); Khan Academy — "Ideal Gas Law"; MIT OCW 5.111 Lecture Notes on Gases

§5 Common Misconceptions

📚 Misconceptions Reference: Nakhleh — J. Chem. Educ. 69, 191 (1992); Coll & Treagust — J. Chem. Educ. 80, 1325 (2003) "Investigation of Secondary and Tertiary Students' Conceptions of the Nature of Gases"; Taber — Chemical Misconceptions, RSC, 2002