A gas is just a swarm of tiny particles bouncing off the walls — and that picture is enough to explain PV = nRT. In this box the particles fly and rebound elastically; the tool reads their average kinetic energy as the temperature, measures the pressure from the momentum they hand to the walls, and takes the volume from a piston you can slide. Add particles, heat the gas or squeeze the box and watch the pressure respond — while the readouts show PV and NkT tracking each other and a live Maxwell–Boltzmann speed histogram broadens as it warms. The law is not built in; it emerges from the collisions. It all runs on your device.
You are in the Physics lab.
What the flashing walls, the speed colours and the two matching readouts are telling you.
Every time a particle strikes a wall it bounces back and hands the wall a kick of momentum — you see each kick as a white flash, and each wall glows brighter the harder the gas is hammering it. The Pressure P readout adds up all those kicks per second over the wall length. Add particles or heat the gas and the flashes come faster and the pressure climbs; there is no formula behind it, just the collisions being counted.
The particles are tinted by speed — blue for slow, magenta and warm red for fast — and the lower panel shows their full Maxwell–Boltzmann speed distribution as bars, with the theoretical curve drawn on top. Drag the Temperature up and the whole histogram broadens and slides to the right, and the RMS speed readout grows with the square root of T. Temperature simply is the average kinetic energy of this motion.
The P·V and N·k·T readouts sit side by side, and their ratio PV / NkT stays pinned near 1 no matter what you change. Slide the piston in to halve the Volume at fixed T and N and each particle reaches the walls twice as often, so the Pressure roughly doubles and the P·V product barely moves — that inverse trade is Boyle's law and a slice of the ideal gas law PV = NkT.
Bouncing particles, three measured quantities, and a ratio that refuses to change.
The particles fly in straight lines and rebound elastically off the walls, never losing energy. The gas's temperature is nothing more than the average kinetic energy of that motion — hotter means faster. Drag the temperature slider and every particle is rescaled to match, so you can watch a cold, sluggish gas turn into a fast, hot one.
Every time a particle strikes a wall it bounces back, handing the wall a kick of momentum. Add up all those kicks over a second and divide by the wall area and you have the pressure — measured here directly from the collisions, not assumed. More particles, faster particles, or a smaller box all mean more kicks per second and a higher pressure.
Watch the P·V and N·k·T readouts as you change things. Double the temperature and the pressure doubles; add particles and it climbs; slide the piston in and it rises as the volume falls — yet P·V and N·k·T stay equal, so their ratio PV / NkT holds near 1. That constant is Boltzmann's constant in these units, and its steadiness is the ideal gas law PV = NkT appearing on its own from a box of bouncing balls.
Teaching or blogging about thermodynamics? You can embed this simulator on your own site free — one line of code, no sign-up.