Skip to content

How does a gas push on its container?

Watch gas molecules bounce in a box, change the temperature and the number, and compare the pressure with the ideal gas law.

Gas particles in a box

Key values as a table
QuantityValue
Molecules150
Temperature300 K
Ideal gas law, P = NkT/A414 µN/m
Measured from the wall collisions—

Result

How hard the molecules push on the walls: 414 µN/m Nitrogen at 300 K: the molecules move at 374 m/s on average and most often at 298 m/s.
Gas
K

Box

Watch gas molecules bounce in a box, change the temperature and the number, and compare the pressure with the ideal gas law.

The box fills the screen with play, step and speed controls on it, zoom in on the molecules, and the speed curve sits in its own tab.

How to use

  1. Press Play on the picture and watch the molecules bounce around the box. Set the temperature, the gas, the number of molecules and the width of the box in the panel under it.
  2. Drag the right wall of the box to squeeze the gas, or drag the peak of the speed curve to change the temperature.
  3. Compare the pressure measured from the wall collisions with the ideal gas law, and watch the histogram of the speeds settle on the curve.

How it works

A gas is a crowd of molecules flying in straight lines and bouncing off the walls. Each bounce pushes the wall a little; billions of bounces a second add up to a steady pressure. A hotter gas has faster molecules, so each bounce pushes harder and more often. A smaller box makes the bounces more frequent.

Kinetic theory puts numbers on it. The molecules do not all move at the same speed: their speeds follow the Maxwell–Boltzmann distribution, which gives the most probable speed √(kT/m) in this flat box, with k the Boltzmann constant, T the temperature and m a molecule's mass. Light molecules such as hydrogen are faster than heavy ones such as carbon dioxide at the same temperature. The ideal gas law says that pressure times area equals N·k·T, with N the number of molecules.

For example, 150 nitrogen molecules at 300 K in this box press on the walls with 414 µN/m. The simulation is a flat, two-dimensional box, so pressure is a force per length instead of per area, the molecules do not collide with each other (an ideal gas) and time is slowed down by a factor of about ten trillion. Source: OpenStax University Physics, volume 2, chapter 2.

Worked example

What pressure do 150 nitrogen molecules make at 300 K in this box?

  1. P = N·k·T / A, with the box area A = 1,500 nm².
  2. That is 414 µN/m.
  3. The molecules' root-mean-square speed is 422 m/s.

414 µN/m, with the molecules moving at about 422 m/s.

Frequently asked questions

Why does the measured pressure wobble?

The pressure comes from a finite number of bounces over a short time, so it jitters around the ideal value. More molecules and a longer wait make it steadier.

Do all molecules move at the same speed?

No. Collisions spread the speeds out into the Maxwell–Boltzmann distribution: a few are slow, most are near the peak and a few are fast. The temperature only fixes the overall scale.

Why are helium and hydrogen faster than nitrogen?

At one temperature all gases have the same average kinetic energy, so lighter molecules must move faster to carry the same energy.

Why is the pressure in newtons per metre?

The box is flat, a two-dimensional world, so the walls are lines. Pressure there is a force per length. In a real three-dimensional box it would be a force per area, in pascals.

Is time really that slow?

Molecules move at hundreds of metres per second, but a box 50 nanometres wide is crossed in about 50 picoseconds. The animation runs about ten trillion times slower than reality so that you can see it.

Send feedback