Ideal Gas & Maxwell–Boltzmann
This is a box of hard discs that collide elastically with each other and the walls, the simplest working model of a gas. Start every molecule at the same speed and the collisions quickly randomise them: a few end up fast, a few nearly stopped, and the histogram of speeds settles into the smooth Maxwell–Boltzmann curve no matter how you started. Drag the temperature, the molecule count and the box volume, and watch the pressure on the walls, measured from real wall impacts, track the ideal-gas law. A live speed histogram sits beside the box with the theoretical curve overlaid.
Runs 100% in your browser — simulations are computed locally on your device.
Read the full guide to this tool
Notes
- Temperature is just average kinetic energy: ½ m⟨v²⟩ = k_B T (per degree of freedom), so heating the gas is literally speeding the molecules up.
- Elastic collisions redistribute energy until the speeds reach the Maxwell–Boltzmann distribution, a stable shape the system relaxes to from almost any start — an example of thermal equilibrium.
- Wall pressure comes from momentum transferred by molecules bouncing off, and averaging those impacts reproduces PV = N k_B T, the ideal-gas law, directly from mechanics.
- Runs 100% in your browser — simulations are computed locally on your device.