← Iris
200 particles

Statistics

Temperature 300 K
Mean speed 0 m/s
RMS speed 0 m/s
Pressure 0 Pa
Collisions/s 0

Speed distribution

Click + drag to push particles away  ·  Adjust temperature, count, and mass below  ·  Watch the histogram converge to the Maxwell-Boltzmann curve
Temperature300 K
Particles200
Particle mass28 amu

About this lab

The Maxwell-Boltzmann distribution

In 1860, James Clerk Maxwell derived the probability distribution for particle speeds in an ideal gas at thermal equilibrium. Ludwig Boltzmann later provided the statistical mechanical foundation. The distribution is not uniform — particles cluster around a most probable speed, with a long tail of faster particles. The probability density for speed v at temperature T is:

f(v) = 4π (m / 2πkT)^(3/2) · v² · exp(-mv² / 2kT)

The factor comes from the volume of a thin spherical shell in velocity space: there are more ways to have a high speed (many directions) than a low one. The exponential decay comes from the Boltzmann factor — high-energy states are exponentially unlikely. The balance between these two effects determines the peak.

Elastic collisions and energy exchange

When two hard spheres collide elastically, they conserve both kinetic energy and momentum. After many collisions, any initial speed distribution relaxes toward the Maxwell-Boltzmann form. Try the “Equalise speeds” button to give all particles the same speed, then watch the histogram evolve. The distribution broadens and assumes its characteristic skewed shape within seconds — entropy increases as the system explores phase space.

The equipartition theorem

Each quadratic degree of freedom (e.g., ½mv⊂x;²) contributes ½kT of energy on average. In 2D, each particle has two translational degrees of freedom, so the mean kinetic energy is kT. This connects microscopic motion to the macroscopic quantity we call temperature: temperature is average kinetic energy per degree of freedom, nothing more.

Pressure from momentum transfer

The gas exerts pressure on the walls by particles bouncing off them. Each bounce transfers momentum 2mv. Summing over all particles hitting a wall per unit time gives the ideal gas law: PV = NkT. This lab measures “pressure” by tracking the total momentum transferred to the walls per frame, giving you a real-time observable that fluctuates around its mean exactly as statistical mechanics predicts.