Tap a particle in the box to follow it. The highlight does not change its path.
Model notes
Particles are hard spheres moving in a plane, colliding elastically with each other and with the walls; collisions are detected after each step.
Temperature comes from the average kinetic energy, T = (2/3)·KE/k. Pressure is computed as p = NkT/V from the model's N, T and V, not measured from particles hitting the walls, so the simulation illustrates the gas laws rather than verifying them independently.
The heater and cooler scale the velocity of every particle in the box after each step; heat transfer through the walls is not simulated.
In Diffusion the two gases use their own particle model; changing a mass or temperature sets every particle of that gas to the same speed.
Ideal gas: pressure, volume and temperature | Public library