The Particle Box: Kinetic Molecular Theory

Heat, squeeze, and cool a live box of atoms to watch pressure, the speed distribution, and even melting and boiling emerge from the collisions. Kinetic theory you can play with.

Everything you see is measured live from the colliding particles. Drag the controls and watch the pressure, the speed curve, and the state of matter respond.

Temperature
0.0
Pressure
0.0
State
Gas

Each dot is an atom; its colour shows its speed (blue = slow → yellow = fast). The indigo bar is a movable piston. Temperature and pressure are in the model's own relative units (proportional to the real quantities, not °C/K or pascals); 0 temperature is absolute zero.

coldhot
smallbig
fewmany
loosesticky
Try an experiment
Speed distribution (Maxwell–Boltzmann)

bars = measured · curve = theory · slides right as you heat · 2D ⇒ Rayleigh form (starts at zero)

Pressure vs Volume (trace as you change volume)

volume → · pressure ↑ · drag Volume at fixed Temperature

A 2D teaching model in relative units, but the physics is real. The atoms attract and repel through a genuine pair potential (Lennard-Jones in spirit), integrated with velocity-Verlet; the underlying dynamics conserve energy, and a thermostat then nudges energy in or out each frame to hold the temperature you set. Pressure (wall hits), the Maxwell–Boltzmann curve, the gas laws, and temperature-driven condensation all emerge, and are verified in the build. "Cohesion" sets how strongly the atoms attract; turn it up and cool down to condense the gas, and pressure correctly drops to ~zero as the clumped atoms stop hitting the walls.

A box of atoms you can play with

Everything about a gas (its temperature, its pressure, whether it’s even a gas at all) comes from one simple picture: tiny particles in constant motion, colliding. That’s the kinetic molecular theory, and this is it, live. The box above isn’t an animation playing back a recording; it’s a real simulation of a few hundred particles bouncing. The pressure and speed distribution are measured straight from those collisions, and the temperature is held at whatever you set on the slider (like a thermostat).

What temperature really measures: kinetic energy

Kinetic energy is the energy a thing has because it is moving. A particle of mass m moving at speed v carries a kinetic energy of

KE = ½ m v²

so a particle that moves twice as fast carries four times the kinetic energy. In this box every atom has the same mass, so kinetic energy comes down to speed alone: the fast yellow atoms carry the most, the slow blue ones the least, and the colour ramp is really an energy map.

Here is the key idea the whole simulator rests on: temperature is the average kinetic energy per particle. Not the energy of any one atom (some are always fast, some slow) but the average across all of them. That’s why dragging the Temperature slider works the way it does: it gently rescales every atom’s speed until the average kinetic energy, the number in the Temperature readout, matches what you asked for. Slide it all the way down and every atom stops dead. That point is absolute zero: zero average kinetic energy, zero motion, zero pressure.

The ideal gas law, one variable at a time

Drag the sliders and the gas laws stop being formulas to memorize and become things you can watch. All of them are pieces of a single equation, the ideal gas law:

P V = n R T

Every symbol in it is something you can see or set in the box:

Read together, the law says P V is proportional to n T. So if you hold two of those quantities still and change a third, the fourth has no choice but to follow. That is exactly how Boyle, Gay-Lussac, and Avogadro each found their gas law: change one thing, hold the rest fixed, watch what moves. Do the same here.

These three results aren’t separate facts to memorize; they are the single equation P V = n R T taken apart one variable at a time. (The box counts individual particles while the textbook law counts moles; that only changes the constant, not the relationship, because chemists simply bundle Avogadro’s number of particles into each mole. That bundling is the whole point of the mole.)

See all of these worked out in real units (atmospheres, liters, kelvin), with a pick-a-law simulator, in the gas laws guide.

Why all speeds aren’t equal: the Maxwell–Boltzmann curve

Temperature is the average kinetic energy, but at any moment the atoms share a whole range of speeds, because every collision reshuffles energy between them. That spread is the Maxwell–Boltzmann distribution, the histogram below the box. Start the box and watch it grow from a single spike (every atom set to one speed) into the lopsided curve, with most atoms near a typical speed and a long tail of fast ones. (Because this box is 2D, the speed curve is the Rayleigh form of Maxwell–Boltzmann: it starts at zero and peaks at a nonzero speed, a little different from the familiar 3D textbook curve, but built from the same Gaussian velocity components.)

From gas to liquid to solid

Real particles tug on each other a little, the same attractions behind bond polarity and intermolecular forces. Turn up the Cohesion slider and that pull switches on. While the particles are hot they ignore it and stay a gas; cool them down and the attraction wins. These are the three states of matter, and the energy it takes to switch between them is the same contest of energy versus attraction that drives the water cycle, where heat boils water into vapour and cooling condenses it back to liquid.

An honest model

This is a 2D teaching model in relative units, but the physics is real, not faked. The atoms move by velocity-Verlet integration under a genuine pair potential: a soft repulsive core plus a short-range attractive well (Lennard-Jones in spirit). The underlying dynamics are conservative (velocity-Verlet on that potential conserves energy), and a thermostat then gently adds or removes energy each step to hold the temperature you set (that’s also how the box sheds its “latent heat” as it condenses). Everything you watch then emerges from those rules: pressure from wall impacts, the Maxwell–Boltzmann speed curve, the gas laws (P V ∝ N T), and condensation itself, because thermal motion genuinely competes with the attraction. We verify all of it in the build. The honest caveats: it’s 2D and in relative units (not a predictor of real pressures or melting points); the solid-vs-liquid label is read from how tightly the atoms pack and how cold they are; and “absolute zero” here means the classical limit where all motion stops (real matter keeps a little quantum zero-point motion). When the gas condenses, the pressure correctly drops toward zero: the clustered atoms stop hitting the walls (that’s the point, not a glitch).

It’s free to embed on your own site or LMS. Build a molecule over in the molecule builder, or see what happens when those molecules react in balancing equations.

Frequently asked questions

What is the kinetic molecular theory?
It's the idea that matter is made of tiny particles in constant motion. Their motion and collisions explain temperature (a measure of average kinetic energy per particle), pressure (particles hitting the walls), and why matter is a solid, liquid, or gas. In this simulator every one of those properties comes straight from the moving particles.
What is kinetic energy, and how is it related to temperature?
Kinetic energy is the energy something has because it is moving: a particle of mass m moving at speed v has kinetic energy equal to one-half m times v squared, so faster particles carry more. Temperature is the average kinetic energy per particle, not the energy of any single one. That is why heating a gas speeds its particles up, and why all motion stops at absolute zero, where the average kinetic energy reaches zero.
How does the ideal gas law PV = nRT work?
It ties together the four things you can measure about a gas: pressure P, volume V, amount n (in moles), and temperature T, with R a fixed constant. Read together, PV is proportional to nT. Hold two of them fixed and the rest follow: at constant temperature and amount, squeezing the volume raises the pressure (Boyle's law); at constant volume and amount, heating raises the pressure (Gay-Lussac's law). In the Particle Box, P, V, n, and T are the pressure readout, the Volume slider, the Particles slider, and the temperature, so you can change one and watch the others respond.
Why does heating a gas increase its pressure?
Heating raises the particles' average kinetic energy, so they move faster. Faster particles hit the walls harder and more often, and more wall collisions per second means higher pressure. Compress the box (less volume) and you also get more collisions per second; that's Boyle's law.
What is the Maxwell–Boltzmann distribution?
Even at one temperature, particles don't all move at the same speed; collisions spread them across a range. The Maxwell–Boltzmann distribution describes that spread: most particles are near a typical speed, with a long tail of fast ones. Heat the box and the whole curve shifts to faster speeds.
Why do gases turn into liquids and solids when cooled?
Particles weakly attract each other. When they move fast (hot) that attraction barely matters and they fly apart as a gas. Cool them down and the attraction can hold them together: they clump into a liquid, and colder still, lock into a solid. Raise the 'cohesion' slider and drop the temperature to see it.
What are the temperature and pressure units in the simulator?
They're the model's own relative units, not Kelvin or pascals. Temperature is a measure of the average kinetic energy per particle (here, with Boltzmann's constant set to 1 in 2D, it's numerically equal to it), so it's directly proportional to real absolute temperature, and 0 on the slider is absolute zero, where all motion stops (in this classical model; real matter keeps a little quantum 'zero-point' motion even at 0 K). There is no maximum temperature: the top of the slider is just an arbitrary high-energy cap, not a physical limit. Pressure is the average force the particles exert on the walls per unit length of wall, the 2D version of pressure. The numbers are arbitrary, but every relationship between them (PV ∝ NT, the speed curve, condensation) is real.

Sources

Last reviewed: 2026-06-30

Embed this on your site

Free to use. Paste this anywhere; a link back to PrepOK is included.

Related