← Lab

Gas chamber
Pressure: 0 kPa
Volume: 0 L
Temperature: 300 K
Particles: 0
P vs V (Boyle's law)
P vs T (Gay-Lussac's law)
Speed distribution
Temperature 300 K
Piston position 75%

Or drag the piston wall directly on the canvas.

Count 100
PV = nRT
Predicted P: -- kPa
Measured P: -- kPa

Kinetic theory of gases

The kinetic theory models a gas as a large number of tiny particles in constant, random motion. The particles collide elastically with each other and with the walls of the container. Temperature is a measure of the average kinetic energy of the particles: higher temperature means faster-moving molecules. Pressure arises from the cumulative force of particles bouncing off the container walls.

The ideal gas law

The ideal gas law, PV = nRT, connects four macroscopic quantities: pressure (P), volume (V), amount of substance (n), and temperature (T), through the universal gas constant R. It assumes particles have negligible volume and no intermolecular forces — assumptions that hold well at low densities and high temperatures.

Boyle's law and Gay-Lussac's law

Boyle's law (1662): at constant temperature and particle count, pressure is inversely proportional to volume (PV = constant). The P vs V graph shows this hyperbolic relationship. Gay-Lussac's law: at constant volume, pressure is directly proportional to temperature (P/T = constant). The P vs T graph shows this linear relationship.

Maxwell-Boltzmann distribution

In thermal equilibrium, particle speeds follow the Maxwell-Boltzmann distribution — a characteristic skewed bell curve. The peak shifts rightward and broadens as temperature increases. The histogram on the right updates in real time from the simulated particle speeds, converging toward the theoretical prediction as the system equilibrates.

Limitations of ideal gas assumptions

Real gases deviate from ideal behavior at high pressures (where particle volumes matter) and low temperatures (where intermolecular attractions become significant). The van der Waals equation adds corrections for both effects. In this simulation, particles are point-like and interact only through elastic collisions, matching the ideal gas assumptions.