Boyle’s law in a molecular box
Move the piston of a genuinely running 2D molecular-dynamics box, measure the pressure, and plot the P–1/V line yourself.
Aim Verify that at constant temperature, and find when intermolecular attraction bends the data away from the line.
Procedure
- Keep “intermolecular attraction” off. Set the volume to its maximum, wait for the readout to settle, then press “Record point”.
- Reduce the volume step by step, waiting for equilibrium before each recording; take at least six points.
- Check whether the points fall on the ideal line and note the readout.
- Clear the data, switch on attraction, and repeat, especially at small volumes.
What to notice
- The pressure readout fluctuates: the number of wall hits varies from window to window. More particles and longer averaging steady it.
- Without attraction, is about 1 at low density and rises slightly above 1 at small volumes — the particles take up room.
- With attraction on, the pressure falls below the ideal value and drops below 1.
In a real lab
- Real Boyle experiments use a sealed syringe with a pressure sensor, or a J-tube with mercury; move the piston slowly so the gas stays at room temperature.
- Rapid compression heats the gas (close to adiabatic), giving pressures that are too high.
- The simulation is two-dimensional, so “volume” is an area; the law is the same in three dimensions.