Every molecule is a hard disc that collides elastically with every other disc and with the box walls — this is the real mechanism behind kinetic theory, not a scripted animation. Pressure is not assumed: it is measured from the actual momentum each wall absorbs per second, divided by the wall's length.
P (measured) = total wall impulse / (perimeter × time)
T (measured) = average kinetic energy per molecule
ideal gas law: P·V / (N·T) stays ~constant
Drag the piston inward and the box does real mechanical work on the gas: a molecule bouncing off a wall moving toward it leaves faster than it arrived (v' = −v + 2u), exactly like a piston head — this is genuine adiabatic heating, so temperature rises on its own even with the Temperature slider untouched. The right-hand readout tracks how close P·V/(N·T) stays to its starting value as you compress, heat, or add molecules — small drift is real molecular chaos, not a bug.
- Molecules — more discs raise collision frequency and (at fixed volume) measured pressure.
- Temperature — instantly rescales every molecule's speed to the new target kinetic energy.
- Piston (volume) — shrinks the box; watch pressure climb and, if you compress quickly, the temperature readout climb with it from real piston work.
- Molecule color shifts from blue (slow) to red (fast) — a live picture of the Maxwell–Boltzmann speed spread building up in the mini histogram, bottom-right.