Ideal Gas Simulator
How to use the ideal gas simulator
- Particles fly around a box and bounce off its walls. Each bounce pushes on the wall, and the total push per second per unit area is the pressure.
- Raise the temperature and the particles speed up, so the pressure rises. Shrink the box and they hit the walls more often, so it rises again (Boyle's law). Add particles and it rises in proportion.
- Watch PV ÷ NT: however you change the settings, it settles to the same value, which is the ideal gas law.
Frequently asked questions
What is the ideal gas law?
PV = nRT: pressure times volume equals the amount of gas times the gas constant times the absolute temperature. It follows from treating a gas as tiny particles in constant random motion that only interact by bouncing, which this simulation does literally. The Ideal Gas Law Calculator solves it for any variable.
Why does temperature change the speed?
Temperature is a measure of the average kinetic energy of the particles, ½mv² = 3⁄2 kT, so the typical speed grows with the square root of the absolute temperature. Doubling the temperature in kelvin makes the particles about 41% faster.
Why does the measured pressure wobble?
It is counted from a few hundred wall hits per second, so it fluctuates, just as a real gas pressure would if you could measure it over such a short time with so few molecules. A litre of real air has 10²² molecules and the wobble is unmeasurable.
It says WebGL is turned off.
The 3D view needs WebGL, which every current browser has. It can be switched off by hardware acceleration being disabled in the browser settings, or by a very old graphics driver. Turn hardware acceleration on, or try another browser.
Is anything uploaded?
No. The simulation is drawn by your own browser with WebGL; nothing is sent anywhere, and it keeps working offline once the page has loaded.