Presenter guide · Kinetic-theory simulator: particles in a box

Ideal Gas Law Simulator

Demo 17 of 17 · Part four, Example projects · About 15 minutes for the four guided experiments, plus 5 for the sweeps

You need: index.html open in any modern browser, on a projector or on each student's phone. No network, no install, no accounts. Nothing is fetched at runtime, so it works with the wi-fi off.

Learning goals

One per stage, in the learner's own words — these are the four Takeaway cards on screen, verbatim. If a student can say these four things and point at the gauge reading that shows each, the demo has done its job.

  1. Pressure is the running tally of wall hits: twice the particles means twice the hits per second, and twice the pressure.
  2. Temperature is the particles' average kinetic energy, and pressure rises in step with it: hotter particles hit harder and more often.
  3. At fixed temperature, pressure × area stays constant: half the room means every wall is hit twice as often.
  4. The ideal gas law is what tiny, non-interacting particles do on average. It holds here to within the noise, and drifts as soon as the particles take up real room.

Where this sits on the path

An AI-built classroom tool from Part four. Its distinctive move is that the gas law is never typed into the simulation: pressure is measured by adding up the momentum the walls receive, temperature is computed from the particles' kinetic energy, and P·A = N·T is a prediction the gauges test. It does not depend on any earlier demo; the habit it shares with the rest of Part four is naming the boundary between what is measured and what is claimed.

One question for the session

Where does gas pressure come from, and how far does P·A = N·T get you?

"Every number on this screen is measured from those dots. Nobody told the box the gas law. We are going to change one thing at a time and see whether the gauge does what the law says it should — and then we are going to break the law on purpose."

Units students see

LabelMeaning in this activity
NNumber of particles in the box (10 to 600; 240 by default).
TTemperature: half the mean squared speed, in the model's units. 300 by default because it reads like room temperature in kelvin. It is not kelvin.
ABox area, width × 60. The box is two-dimensional, so "volume" is area.
PPressure: momentum handed to the walls, per second, per unit of wall length. Two-dimensional pressure is force per length.
ZThe ratio P·A / (N·T). Exactly 1 when the ideal gas law holds.
rParticle radius, 0.35 to 1.0. At 0.35 the particles cover about 1.5% of the box; at 1.0, about 13%.
P · A = N · T   (mass = 1, kB = 1, two dimensions)

Run of show

Every stage follows the same routine: read the question, commit to a prediction (the Run button stays locked until one is chosen), press Run, read the finding. The guided experiment measures for four seconds of simulated time, makes one change, settles, and measures again. At the default 2× speed that is about six real seconds. The numbers below are what the model produces at the defaults; a gauge on a few hundred particles wanders by a few percent run to run, and that is worth saying out loud.

StageBeatWhat the gauge showsSay
1 · Add particles
~4 min
Point at the walls flashing gold where they are hit. Ask for the prediction. Press Run: double the particles. P ≈ 12.4 → ≈ 24.8 (2.0×). T stays at 300. Wall hits/s roughly doubles, about 90 → 180. "Same speeds, same walls, twice the bodies. The walls are hit twice as often. That is all pressure is."
2 · Heat it
~4 min
Ask for the prediction; most rooms split between 2× and 4×. Press Run: double the temperature. Point at the histogram widening. P ≈ 12.4 → ≈ 24.8 (2.0×). Hits/s rise by about 1.4×, not 2×. T reads 600. "Doubling the temperature only made them √2 faster. √2 harder, √2 more often. √2 × √2 is 2."
3 · Squeeze it
~4 min
Press Run: halve the box with the thermostat on; watch the piston slide. Then switch the Thermostat off and drag the Piston in by hand. P ≈ 12.4 → ≈ 25 (2.0×) with T held at 300; P × A ≈ 74,000 both times. Thermostat off: T climbs past 500 as the piston moves. "Half the distance between walls, twice the hits. Now turn off the water bath and push: the moving wall kicks every particle it meets. That is why a bicycle pump gets warm."
4 · Test the law
~5 min + sweeps
Press Run: grow the particles. Then run Sweep the box small, grow the particles with the size slider, and run it again. Z ≈ 1.03 at r = 0.35 → Z ≈ 1.3 at r = 1.0. Sweep points sit on the diagonal when small, above it when big. "The law assumed the particles took up no room. Give them room and the space they fly through shrinks. This is the 'b' in van der Waals."
If a run comes out 1.9× or 2.1×: that is the finding, not a bug. Point at the ± band under the pressure reading and the hit count in the finding. Ask what would steady it (more particles, more time, a smaller box) and try one. A gauge on 240 particles is exactly as noisy as it looks.

Misconceptions to name

"Crowded particles push harder." Stage 1 and stage 3 both show T unchanged while P doubles. Each hit carries the same momentum; only the count changed. The temperature gauge is the evidence.
"Double the temperature, four times the pressure." Temperature is speed squared, so speeds rise by √2. The hits/s readout rising by about 1.4× while P rises by 2× separates the two factors on screen.
"Collisions between particles make pressure." Switch Collisions off in stage 1: the reading does not change. Particle–particle collisions swap momentum between particles and never touch a wall. (In stage 4 they matter for a different reason: they are what keeps big particles out of each other's space.)
"The law fails, so the simulation is wrong." Stage 4's drift is the point. The ideal gas law is an approximation with a stated assumption, and the gauge shows where the assumption stops holding.

What this model is, and is not

Sources and attribution

These sources support the underlying physics; they do not endorse this activity. The 2D speed distribution, the moving-wall reflection rule and the excluded-area estimate are computed in the page's own model and checked by its node test suite, not quoted.

Ideal Gas Law Simulator · Bryant Harrison · Murray State University · Offline teaching model. Open index.html to run it. src/demo-guide.html is the canonical source of this document; the shipped presenter-guide.html, the PDF beside it, and the in-app presenter notes are all generated from it at build time.