# Kinetic Theory Gas Simulator - Maxwell–Boltzmann, Pressure, Graham's Law

> Watch hundreds of colliding molecules: speed histogram vs Maxwell–Boltzmann, pressure from wall impacts, mean free path, piston heating, effusion and mixing.

- URL: https://qilingtools.com/en/math/gas-kinetics
- Category: Physics Tools (https://qilingtools.com/en/physics)
- Tags: [Physics](https://qilingtools.com/en/tags/physics), [Education](https://qilingtools.com/en/tags/education)
- Last updated: 2026-10-26
- Price: Free, no sign-up
- Privacy: Runs locally in the browser; files are never uploaded

A box of a few hundred hard-disk molecules collides elastically in real time (spatial hashing keeps it fast); speeds are real m/s and the temperature is real kelvin. The speed histogram settles onto the Maxwell distribution on its own, the pressure measured from wall impulses is compared with PA = NkT and with a hard-disk equation of state, and collision counting gives the mean free path, checked against the dilute-gas formula and the Enskog correction. Push the piston in to see the gas heat up, heat or cool it with a click, or trace a single molecule's zig-zag path. Two more scenes show Graham's law (light molecules leak through a pinhole faster) and two gases mixing once the partition is pulled. The last tab is a 3D Maxwell–Boltzmann calculator for H₂, He, N₂, O₂, CO₂ and UF₆.

## How to use

1. Pick the molecule box, Graham effusion, gas mixing or the Maxwell distribution calculator
2. Choose the gases and set the number of particles, temperature and particle size
3. Play the simulation, drag the piston, heat or cool, or remove the partition
4. Compare the histogram with theory and read the temperature, pressure, mean free path and rate ratios

## Features

- Hundreds of hard-disk molecules colliding in real time, optionally two species of different mass
- Live speed histogram against the 2D Maxwell distribution, with colour-by-speed
- Pressure from wall impulses vs the ideal gas law and the Henderson hard-disk equation
- Measured mean free path vs theory (with Enskog correction) and single-particle tracing
- Piston compression with the T·A adiabatic invariant, Graham effusion ratios and a mixing-entropy curve
- 3D calculator: v_p, v̄, v_rms, mean free path, collision rate and fraction above escape velocity

## FAQ

### Why does the simulated speed distribution peak further left than the textbook Maxwell curve?

The simulation is two-dimensional, so each molecule has two translational degrees of freedom and the speed distribution is f(v) = (m/kT)·v·e^(−mv²/2kT) with v_p = √(kT/m). A 3D gas has one more degree of freedom, giving a v² factor instead of v and v_p = √(2kT/m), so the peak moves right. Both come from each velocity component being Gaussian; the tool plots the 2D curve for the simulation and the 3D curve in the calculator.

### Why is the measured PA/NkT a little above 1?

The ideal gas law treats molecules as points. The simulated molecules are disks with real size: they take up part of the area and pass momentum across their diameter when they collide, so the pressure ends up slightly higher. The Henderson equation for hard disks, PA/NkT = (1 + η²/8)/(1 − η)² with η the area fraction, captures this well — bigger, denser particles deviate more. It is the same physics as the b term in the van der Waals equation.

### What does Graham's law say, and why is uranium enriched as UF₆?

In effusion through a small hole, the number of molecules escaping per second is proportional to number density times mean speed, and at a given temperature the mean speed goes as 1/√M, so the rates of two gases are in the ratio √(M_B/M_A). For ²³⁵UF₆ and ²³⁸UF₆ the mass ratio is only 1.0086, giving a separation factor of about 1.0043 per stage, so gaseous diffusion plants needed over a thousand stages. UF₆ is used because it turns to gas near room temperature and fluorine has a single stable isotope, so it adds no mass spread of its own.

### How fast do air molecules move, and how far do they travel between collisions?

At room temperature the RMS speed of N₂ is about 517 m/s — faster than sound — and H₂ about 1,930 m/s. Yet at atmospheric pressure an N₂ molecule travels only about 70 nm between collisions and collides some seven billion times a second, which is why smells spread by slow random diffusion. The high-speed tail also explains why Earth has lost its hydrogen and helium: a small fraction of those molecules always exceeds escape velocity.

## Related tools

- [Unit Converter](https://qilingtools.com/en/math/unit): Free online unit converter: length, area, volume, weight, temperature, time, speed, data, pressure, energy and angle — one value converts every unit at once.
- [Vector Calculator](https://qilingtools.com/en/math/vector): Free online vector calculator for 2D and 3D: addition, scalar multiples, dot and cross products, magnitude, angle, unit vector and projections, with checks.
- [Significant Figures Calculator](https://qilingtools.com/en/math/significant-figures): Free online sig fig calculator: count significant figures digit by digit, round to N sig figs or decimals with six rounding modes, and compute by sig fig rules.
- [Tone Generator](https://qilingtools.com/en/audio/tone-generator): Free online tone generator: sine, square, sawtooth and triangle waves from 1 to 20,000 Hz, a note picker, sweeps, white/pink/brown noise and a WAV download.
- [Audio Spectrogram](https://qilingtools.com/en/audio/spectrogram): Free online spectrogram generator: see time, frequency and level from a Hann-windowed STFT, with FFT size, log axis, dB range and colour maps. Exports PNG.
- [Decibel Meter](https://qilingtools.com/en/audio/decibel): Free online decibel meter: measure noise with your mic in real time, A/C/Z weighting, fast/slow response, min/max/average/Leq, 60-second graph and calibration.
- [Physics Formula Calculator](https://qilingtools.com/en/math/physics): Physics formulas solved with steps: SUVAT, projectiles, Newton’s laws, inclines, energy, Ohm’s law, resistors, RC, buoyancy, waves, lenses, gravity.
- [Fourier Series & FFT Visualizer](https://qilingtools.com/en/math/fourier): Fourier series coefficients and animated partial sums for square, sawtooth, triangle or any function (Gibbs), draw-your-own epicycles and FFT spectra.
