The First Law of Thermodynamics
The First Law of Thermodynamics
The First Law of Thermodynamics is a statement of conservation of energy applied to thermodynamic systems. It relates the change in internal energy of a system to the heat exchanged with its surroundings and the work done.
The Equation
Where:
- is the change in internal energy of the system (J)
- is the heat added to the system (J) — positive when heat flows in, negative when it flows out
- is the work done by the system (J) — positive when the system expands, negative when compressed
Sign Conventions
| Quantity | Positive | Negative |
|---|---|---|
| Heat absorbed by system | Heat released by system | |
| Work done by system | Work done on system | |
| Internal energy increases | Internal energy decreases |
Work by Expansion
When a gas expands against a constant external pressure , it does work on the surroundings:
Where is the change in volume. If the gas is compressed, and the work is negative (work done on the system).
Examples
Isothermal process (constant temperature): If a gas absorbs 1000 J of heat and does 1000 J of work expanding, then . The internal energy does not change — consistent with constant temperature for an ideal gas.
Adiabatic compression: If no heat is exchanged () but 500 J of work is done on the gas (), then . The gas heats up.
Your Task
Implement the two functions below using the First Law equations.