← Thermal
Energy Conservation

First Law of Thermodynamics

Add heat, push the piston, and watch energy balance the books: ΔU = Q − W.
ΔU = Q − W
Heat added Q
0
Work by gas W
0
ΔInternal energy
0
Temperature
300K
i About this experiment — click to learn the physics

What you're looking at

A gas is trapped in a cylinder under a movable piston. You can do two things to it: add or remove heat with the burner below, and push or pull the piston to compress or let it expand. The simulation keeps a running account of the energy, and you'll see it always balances.

The first law

The first law of thermodynamics is simply conservation of energy applied to heat. The internal energy of the gas can only change by heat flowing in or work being done:

ΔU = Q − W change in energy = heat in − work out

Here Q is the heat added to the gas, W is the work the gas does on the piston as it expands, and ΔU is the change in its internal energy. For an ideal gas the internal energy depends only on temperature (U = n·Cv·T), so when ΔU rises, the gas gets hotter.

Heat, work, and the sign of things

  • Heat in (Q > 0) raises the internal energy — the gas warms.
  • Expansion (W > 0) means the gas pushes the piston out and spends energy doing it — on its own this cools the gas.
  • Compression (W < 0) means work is done on the gas, adding energy and warming it — this is why a bike pump gets hot.

Four special processes

The preset buttons run the textbook cases, and the ledger shows how the first law simplifies in each:

  • Isochoric (fixed volume): no work is done, so ΔU = Q — all the heat becomes internal energy.
  • Isobaric (fixed pressure): the gas expands as it's heated, so Q = ΔU + W.
  • Isothermal (fixed temperature): ΔU = 0, so every bit of heat becomes work, Q = W.
  • Adiabatic (no heat, Q = 0): the gas does work purely at the expense of its own energy, ΔU = −W, so it cools as it expands.

Things to try

Heat the gas at fixed volume and watch ΔU track Q exactly. Then expand the piston with the burner off (adiabatic) and see the temperature fall as the gas spends energy doing work. Compress it quickly and watch it heat up — no flame required.