Sub topic 12
Work done by a gas and P-V diagrams
This chapter assumes you know the ideal gas equation PV = nRT, the first law of thermodynamics (ΔU = Q − W) and basic ideas of integration as area under a curve.
Work from a moving piston
A gas in a cylinder pushes a piston of area A through a small distance dx. The force is PA, so the work done by the gas is PA dx = P dV. Adding up the small steps gives:
W = ∫ P dV from V₁ to V₂
Work done by the gas is positive when the gas expands (dV > 0). It is negative when the gas is compressed. This matches the sign convention in ΔU = Q − W.
Reading a P-V diagram
On a P-V diagram, pressure is on the vertical axis and volume is on the horizontal axis. The work done by the gas in a process is the area under the curve between V₁ and V₂.
- Moving right (expansion): the area counts as positive work.
- Moving left (compression): the area counts as negative work.
- Constant volume (a vertical line): the area is zero, so W = 0.
- Constant pressure (a horizontal line): the area is a rectangle, so W = P(V₂ − V₁).
Isothermal work
For an ideal gas at constant temperature, P = nRT/V. Integrating gives:
W = nRT ln(V₂/V₁)
import math
n = 1.0 # mol
R = 8.314 # J/(mol K)
T = 300.0 # K
V_ratio = 2.0 # V2 / V1
W = n * R * T * math.log(V_ratio)
print(round(W)) # about 1729 JThe gas expands to twice its volume, so the work is positive. Compressing it back would give the same size of work with a negative sign.
Cyclic processes
In a cycle the gas returns to its starting state. The work done over the whole cycle is the area enclosed by the loop.
- A clockwise loop gives positive net work. The gas does work on the surroundings, as in an engine.
- An anticlockwise loop gives negative net work. Work is done on the gas, as in a refrigerator.
Because U is a state function, ΔU = 0 over a full cycle. The first law then gives Qnet = Wnet.
Common errors
- Work depends on the path, not only on the end states. Two paths between the same points can enclose different areas.
- Using W = PΔV for a process where pressure changes. This holds only at constant pressure.
- Forgetting units. P in pascals and V in cubic metres give W in joules. A pressure of 1 atm is about 1.013 × 10⁵ Pa.
- Getting the sign wrong on compression. W is negative there, and ΔU = Q − W then adds energy to the gas.
Exercise
A gas expands at a constant pressure of 2 × 10⁵ Pa from 3 × 10⁻³ m³ to 8 × 10⁻³ m³. It absorbs 1500 J of heat. Find the work done by the gas and the change in its internal energy.
Show answer
W = PΔV = 2 × 10⁵ × (8 × 10⁻³ − 3 × 10⁻³) = 2 × 10⁵ × 5 × 10⁻³ = 1000 J. By the first law, ΔU = Q − W = 1500 − 1000 = 500 J.
Exercise
A cycle appears as a clockwise rectangle on a P-V diagram. Its sides run from 1 × 10⁵ Pa to 3 × 10⁵ Pa in pressure and from 2 × 10⁻³ m³ to 5 × 10⁻³ m³ in volume. What is the net work done by the gas per cycle, and how much heat is absorbed net?
Show answer
The net work equals the enclosed area: (3 × 10⁵ − 1 × 10⁵) × (5 × 10⁻³ − 2 × 10⁻³) = 2 × 10⁵ × 3 × 10⁻³ = 600 J, positive because the loop is clockwise. Over a cycle ΔU = 0, so the net heat absorbed is also 600 J.