← Laboratorium

Gas — molecules, temperature and pressure

Hundreds of atoms rush around and collide in a box. Heat them, squeeze them with a piston, and see how simple laws emerge from the chaos of individual collisions: pressure, temperature and the Maxwell distribution.

Gas container

Speed Color t = 0 ps
speed
helium He · 4 u xenon Xe · 131 u large particle · 250 u

Drag the piston (right wall) or use ← →. ↑ ↓ — temperature, Space — pause, 1–5 — experiments, G — gravity, B — divider, + / − — pump in / let out, R — restart. Click a molecule to follow its zigzag path (Esc stops).

Speed distribution

Bars: measured speeds (averaged over about 1 s). Line: the Maxwell–Boltzmann distribution for the measured temperature. Click where the peak is.

Chart

How does it work?

Pressure is a rain of impacts

Each disk is one atom. It flies in a straight line until it hits another atom or a wall. When it bounces, its momentum changes by 2·m·v⊥, and the wall receives exactly that much momentum. A multitude of tiny impacts adds up to a steady push — pressure. This is how the simulation computes it:

p=Σ 2·m·v⊥L · ΔtL — wall length, Δt — averaging time

In a two-dimensional world, “volume” is the area A, and pressure is the force per unit length of wall. That is why we measure it in mN/m.

Temperature is motion

Temperature tells us how energetically the molecules move. In two dimensions an atom has 2 degrees of freedom (horizontal and vertical motion), and each one gets on average ½·k·T of energy:

⟨Ek⟩=⟨½·m·v2⟩=k·Tin 3D: ⟨Ek⟩ = 3/2·k·T · k = 1.380649·10−23 J/K (Boltzmann constant)

At 300 K the average energy of an atom is only about 26 meV. At 0 K (−273.15 °C) thermal motion would stop — that is absolute zero.

The ideal gas law

Impacts (pressure) and motion (temperature) are tied together by one simple law:

p·A=N·k·Tin 3D: p·V = N·k·T = n·R·T

The counter p·A/(N·k·T) checks it live. It comes out slightly above 1 because the disks have their own diameter and take up part of the area. The denser the gas, the bigger the correction. Real gases behave this way (the van der Waals equation contains a similar correction). Next to the counter we also show the prediction of hard-disk theory.

The Maxwell–Boltzmann distribution

Collisions set up the speed distribution on their own, even when all the atoms start equally fast. Most have medium speeds; a few are very slow or very fast. In 2D:

f(v)=m·vk·T·exp(−m·v22·k·T)
vp = kT/m·v̄ = πkT/2m·vrms = 2kT/mmost probable · mean · root mean square

At the same temperature heavy xenon moves √(131/4) ≈ 5.7 times slower than helium, because the average energy is the same for both gases.

Gas processes

LawWhat is constantResult
Boyle–MariotteT (isothermal)p·V = const
CharlesV (isochoric)p/T = const
Gay-Lussacp (isobaric)V/T = const
adiabaticno heat exchangeT·A = const (in 2D)

When extended, the straight lines on the p–T and V–T charts hit 0 K. That is how 19th-century scientists inferred that absolute zero exists. Compression with insulation heats the gas, because the piston knocks back incoming atoms like a racket hitting a ball. Slowly compressing to half the area exactly doubles the temperature, and fast compression heats it even more. We name the laws as Polish textbooks do. In English-language books, “Charles’s law” usually means V/T = const, and the pressure law is often credited to Gay-Lussac.

Diffusion and the arrow of time

Once the divider is removed, each atom wanders randomly and the gases mix. The laws of motion work the same forward and backward, yet the gases never separate on their own. There are simply unimaginably more mixed states. The chance that N atoms happen to gather back in their own halves is (½)N. For 700 atoms that is about 2·10−211.

S=k·ln Wentropy grows as the number of possible arrangements W grows

The “Reverse velocities” button runs the film backward. Right after the divider is removed, the gases return to their places. After a few seconds they no longer do, because the tiniest rounding errors grow like an avalanche (chaos).

Brownian motion

In 1827 the botanist Robert Brown saw under a microscope that tiny particles from pollen grains in water jiggle and wander without stopping. In 1905 Albert Einstein explained that this is caused by uneven impacts from invisible molecules. The mean squared displacement grows in proportion to time:

⟨r2⟩=4·D·tin 2D; D — diffusion coefficient

The “random walk” chart shows r2 for the large particle. A single trajectory is jagged, but on average it grows like a straight line.

Did you know…?

  1. Air molecules in a room rush around at about 470 m/s on average, faster than sound (343 m/s). Each one collides with others several billion times per second.
  2. Two-dimensional gases really exist. A dilute layer of fat or soap molecules on the surface of water (a Langmuir film) obeys the law Π·A = N·k·T, and its “surface pressure” is measured in mN/m, just like here.
  3. In 1908 Jean Perrin tracked Brownian motion under a microscope and used it to determine Avogadro’s number. This convinced the last skeptics that atoms exist. In 1926 he received the Nobel Prize for this work.

Model simplifications

  • The world is two-dimensional, and the atoms are hard, perfectly elastic disks that do not attract each other.
  • We compute collisions in very short steps, rewinding each pair to the moment of contact. Energy and momentum are conserved up to rounding errors.
  • The motion is slowed down about 100 billion times: 1 s on screen is about 10 ps (picoseconds).
  • Gravity is about 4 trillion times stronger than on Earth. Otherwise no density difference would be visible in a box 30 nm tall.
  • The thermostat gently rescales the velocities (Berendsen method). “Warm walls” give bouncing atoms random speeds drawn from the distribution for the wall temperature.
  • In “constant pressure” mode the piston moves slowly until the average gas pressure matches the set value.
  • The large particle has a mass of 250 u. The real particles Brown observed are billions of times heavier and wander much more slowly.