A cylinder you can see inside
The simulation shows a gas as a few dozen particles in a metal cylinder with a glass front. A piston with a handle seals the right-hand end, a heater sits underneath, a dial gauge shows the pressure and a digital thermometer shows the temperature. Each particle is coloured by its speed, from blue for slow to red for fast, and a small histogram beside the cylinder shows how the speeds are spread.
The particles travel in straight lines until they meet a wall or one another. Every collision is perfectly elastic, so no kinetic energy is lost when they bounce. Nothing is faked: the gauge, the thermometer and the graphs all come from these collisions.
Where the pressure comes from
Watch a wall closely and you will see tiny flashes. Each one marks a particle bouncing back. As it reverses, its momentum changes, and the wall receives an equal push the other way. The meter adds up all of these pushes over a short time (one second for the gauge needle, four seconds for the Pressure card), then divides by the time and by the size of the walls. That gives the force per unit area, which is the pressure. With only sixty particles the reading wobbles slightly, and that is honest too. A real gas holds so many molecules that its pressure looks perfectly steady.
Squeezing at constant temperature
In the first experiment a thermostat holds the temperature fixed while you move the piston. Push it in and the particles, still moving at the same average speed, have less room. Every stretch of wall now takes more hits per second, so the pressure rises. Halving the volume doubles the pressure, which is the rule , often written , for a fixed mass of gas. Record several readings and plot pressure against 1/V: the points lie close to a straight line through the origin. Plotting pressure against volume gives a curve instead.
Heating at constant volume
In the second experiment the piston stays still while the heater or the cooling plate changes the temperature. Hotter particles move faster, so they arrive at the walls more often and strike them harder. The pressure is proportional to the temperature in kelvin, found with . Plot your results against the Celsius temperature and extend the line backwards: it reaches zero pressure close to −273 °C. That is absolute zero, where the particles would have the least kinetic energy they can.
Doing work on a gas
The third experiment switches the thermostat off, so no energy can flow in or out as heat. Push the piston in quickly. Particles that meet the moving piston rebound faster, like a ball struck by a swinging bat. The work done by the piston raises the internal energy of the gas, and the thermometer climbs. This is why a bicycle pump warms up. Pull the piston out and the gas does work on it instead, so the gas cools.
What the model leaves out
The box is flat, so its particles move in only two directions. It stands for a real cylinder through a stated scale: the full box is shown as 300 cm³, and pressures are scaled so that sixty particles at 300 K read 100 kPa for an ideal gas. Because the particles take up a little of the space, the reading sits slightly above that ideal value, which is shown beside it. A flat gas also warms far more than real air when squeezed. Finally, the particles move much more slowly than real air molecules, which travel at hundreds of metres per second, so that your eyes can follow them.