MechSimulator

Ideal Gas Law Simulator

PV = nRT — Animate Gas Particles • Simulate • Explore • Practice • Quiz

MODE
SOLVE FOR
PV = nRT P = 101.3 kPa V = 2.00 L n = 0.10 mol T = 243 K
0.10 mol
243 K
2.00 L
101 kPa
GAS

How to Use the Ideal Gas Law Simulator — PV = nRT

The Ideal Gas Law (PV = nRT) is the fundamental equation of gas thermodynamics, unifying pressure, volume, temperature, and the amount of substance into one elegant relationship. This free interactive simulator lets you adjust any three of the four variables and instantly observe how the fourth changes — all while watching animated gas particles respond in real time. Whether you are studying Boyle’s Law, Charles’ Law, or the combined gas law, this tool makes the underlying physics visible and intuitive.

Understanding PV = nRT — The Four Variables

In the ideal gas law, P is absolute pressure in kilopascals, V is volume in litres, n is the number of moles of gas, and T is absolute temperature in Kelvin. The universal gas constant R = 8.314 J/(mol·K) ties them together. The simulator uses the "Solve For" selector to pick which variable is computed: choose Pressure P to see how pressure changes when you slide volume or temperature; choose Volume V to model an expanding balloon or piston; choose Temperature T to calculate the temperature needed for a given pressure.

From Boyle’s to Gay-Lussac’s — Three Laws in One

The ideal gas law subsumes all three classical gas laws. Boyle’s Law (PV = constant at fixed T and n) describes a syringe or tyre compression. Charles’ Law (V ∝ T at fixed P and n) explains why a balloon rises when heated. Gay-Lussac’s Law (P ∝ T at fixed V and n) governs sealed pressure cookers. In the Explore mode, each law has its own concept card with formula, diagram, and a worked example. In the Practice mode, problems are randomly generated across all three scenarios so you build fluency in the whole equation.

What the Particle Animation Shows

The canvas on the left shows an idealised gas container with animated molecules. Particle speed scales with √T following the Maxwell-Boltzmann distribution, so cooling the gas makes particles sluggish and blue while heating makes them fast and orange-red. Density inside the container scales with n/V, so adding moles or shrinking the volume visibly packs more molecules in. The right panel plots the P–V diagram with isothermal hyperbolas at T/2, T, and 2T, with the current state shown as a glowing dot that moves along the appropriate curve as you adjust sliders.

Who Uses This Simulator?

This tool is designed for TVET and engineering students studying thermodynamics, chemistry, and fluid mechanics. It suits A-level and undergraduate physics courses, vocational training programmes in mechanical and chemical engineering, and teachers looking for a visual aid to explain gas behaviour. The Practice and Quiz modes make it ideal for exam preparation on ideal gas calculations, including combined gas law problems and real-world scenarios like scuba tank pressure, tyre inflation, and atmospheric changes.

Explore Related Simulators

To deepen your understanding of gas laws, explore our Boyle’s Law Simulator for PV isotherms, the Charles’ Law Simulator for isobaric expansion and absolute zero, the Specific Heat Capacity Simulator comparing Q = mcΔT across materials, and the Thermodynamics Cycles Simulator covering Carnot, Otto, and Diesel cycles.