The first law of thermodynamics is conservation of energy for a gas: ΔU = Q − W. Pick one of four processes, add or remove heat, and watch the piston move while the heat, the work and the internal-energy change settle onto one shared scale.
One mole of a monatomic ideal gas in a piston-cylinder. Pick a process, add or remove heat, and watch the energy split. The three bars share one scale, so ΔU = Q − W reads straight off the chart.

The first law of thermodynamics simulator is a free interactive physics lab that runs in your browser — nothing to install and no sign-up. Adjust heat and process type, watch ΔU = Q - W update live. Explore isothermal to adiabatic paths. It reports change in internal energy δu, heat added to the gas, work done by the gas, Final temperature and Final pressure and volume as you drag the sliders.
| Control | Range | Step |
|---|---|---|
| Heat added to the gas | -1500 – 1500 J | 10 |
Start with the four process buttons, because each one decides which term of the first law is pinned before you touch anything else. Isothermal holds the temperature fixed, so for an ideal gas ΔU is exactly zero and the law collapses to Q = W. Isobaric holds the pressure fixed, so the gas expands as it warms and pays for that expansion with work equal to PΔV. Isochoric locks the piston, forcing W = 0. Adiabatic seals the cylinder against heat, fixing Q = 0 so the gas can only do work at the expense of its own internal energy. The four processes are set out in full in our guide to the first law of thermodynamics.
The slider then supplies the one quantity the process has not already fixed. In the first three modes it is the heat Q, in joules, and it runs negative as well as positive — slide left of zero to draw heat out of the gas rather than add it. In adiabatic mode Q is zero by definition, so a heat slider would do nothing; there the slider sets the work instead, and pushing it negative compresses the gas.
Every readout updates on the same frame. ΔU, Q and W are given in joules and always satisfy ΔU = Q − W exactly; the temperature in kelvin, the pressure in pascals and the volume in cubic metres describe the state the gas finishes in. The bar chart below the cylinder draws all three energies against one shared scale, so the balance is something you read off the picture rather than take on trust. The particle speed tracks the temperature, and the piston slides to the new volume.
The setting worth dwelling on is isochoric, because it corrects the misconception that sinks most first-law problems: that heat and temperature are the same thing. Add 600 J with the piston locked and the whole 600 J becomes internal energy, because there is no volume change for the gas to do work against. Switch to isobaric, add exactly the same 600 J, and the gas ends up measurably cooler — part of that heat left again as work on the piston. Same heat, different temperature rise. To convert a temperature change into a heat value in the first place, use the specific heat calculator; to see where this law sits among its siblings, read the laws of thermodynamics, and for the limit on how much of Q can ever become useful work, see Carnot efficiency.
It visualises how heat (Q), work (W), and internal energy change (ΔU) balance for each thermodynamic process type, using ΔU = Q - W.
Isothermal (constant T, ΔU = 0), isobaric (constant P), isochoric (constant V, W = 0), and adiabatic (Q = 0). Each constrains the first law differently.
For an ideal gas, internal energy depends only on temperature. With ΔU = 0, all heat added becomes work — so temperature stays constant while the piston moves.
Yes. In compression (adiabatic or isothermal), work is done on the gas, giving W < 0. The readout displays a negative value and the piston moves inward.
Heat, work, and internal energy are in joules (J). Temperature is in kelvin (K), pressure in pascals (Pa), and volume in cubic metres (m3).