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.

The First Law: Where the Heat Actually Goes

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.

Change in internal energy  ΔU = Q − W
+360 J
Heat in exceeds the work done, so the gas warms.
Heat added to the gas  Q
+600 J
Set by the slider below
Work done by the gas  W
+240 J
W = P·ΔV — the gas pushes the piston out
Final temperature
328.9 K
started at 300.0 K
Final pressure and volume
101,325 Pa
V = 0.02698 m3 (26.98 L)
Heat added Q+600 J
Slide left of zero to take heat out of the gas.
Monatomic ideal gas · n = 1 mol · R = 8.314 J/(mol·K) · γ = 5/3
CV = 12.47 J/(mol·K) · CP = 20.79 J/(mol·K)
Every run starts from 300.0 K, 101,325 Pa, 0.02462 m3.
Tip: set the same Q on isochoric and isobaric. The heat is identical, but the isobaric run spends part of it pushing the piston — so it ends up cooler.

What Is the First Law of Thermodynamics Simulator?

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.

What you can change in the first law of thermodynamics simulator
ControlRangeStep
Heat added to the gas-1500 – 1500 J10

How to Use the First Law Simulator

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.

Frequently asked questions

What does the first law of thermodynamics simulator show?

It visualises how heat (Q), work (W), and internal energy change (ΔU) balance for each thermodynamic process type, using ΔU = Q - W.

What are the four process buttons?

Isothermal (constant T, ΔU = 0), isobaric (constant P), isochoric (constant V, W = 0), and adiabatic (Q = 0). Each constrains the first law differently.

Why does the temperature not change in isothermal mode?

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.

Can the simulator show negative work?

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.

What units does the simulator use?

Heat, work, and internal energy are in joules (J). Temperature is in kelvin (K), pressure in pascals (Pa), and volume in cubic metres (m3).

References & formula source

  • Halliday, Resnick & Walker — Fundamentals of Physics, Chapter 18 (Temperature, Heat & the First Law of Thermodynamics).
  • Young & Freedman — University Physics with Modern Physics, §19.4 (Internal energy and the first law of thermodynamics).
  • Çengel & Boles — Thermodynamics: An Engineering Approach, Chapter 4 (Energy analysis of closed systems).