Sub topic 12
Gas processes with pistons, springs, and heat exchange
This chapter assumes you know the ideal gas law, the first law of thermodynamics (Q = ΔU + W), the molar heat capacities of monatomic and diatomic gases, and Hooke's law. It also assumes you can balance forces on a body in equilibrium.
The piston as a bridge
A gas problem with a piston is half thermodynamics and half mechanics. The piston connects the two halves through two bridge quantities:
- Pressure and force. The gas pushes on the piston with force PA. Mechanics tells you what that force must equal.
- Volume and displacement. If the piston moves by x, the volume changes by Ax.
Most errors in these problems come from mixing the two halves. The usual mistakes are using the wrong pressure in a work integral or applying a gas law to a stage where it does not hold.
Step 1: Get the pressure from force balance
Treat the piston as a body. If it moves slowly, the net force on it is zero. Write that balance first, before you touch any gas law.
| Setup | Force balance on piston | Gas pressure P |
|---|---|---|
| Free piston, atmosphere outside | PA = P₀A | P₀ |
| Piston carries a weight mg | PA = P₀A + mg | P₀ + mg/A |
| Spring above the piston, stretched by x | PA = P₀A + kx | P₀ + kx/A |
| Vacuum outside, spring only | PA = kx | kx/A |
Take x from the spring's natural length, not from the starting position. If the spring is relaxed at the start, x = 0 there. If it is already compressed, x has an initial value that you must add.
For a spring with natural length at the initial state, the pressure is linear in volume:
P = P₀ + (k/A²)(V − V₀)
This is a straight line on a P–V diagram. A line on a P–V diagram makes the work a trapezoid area, so you do not need an integral.
Step 2: Work from the force side
The work done by the gas is the area under the P–V curve. For the spring case, you can also split it by where the energy goes:
W = P₀Ax + ½kx²
The first term is work pushed against the atmosphere. The second is energy stored in the spring. If the piston also rises against gravity, add mgx. Both routes must agree, and the disagreement is a useful check.
Step 3: Apply the first law with the gas's own state
The internal energy of an ideal gas depends only on temperature:
ΔU = n C_v ΔT = (f/2) nR ΔT = (f/2)(P₂V₂ − P₁V₁)
The second form uses PV = nRT, so you never need n or T separately. Here f = 3 for a monatomic gas and f = 5 for a diatomic gas at ordinary temperatures. Then Q = ΔU + W gives the heat supplied.
Worked example
A monatomic ideal gas fills a vertical cylinder of area A = 0.01 m², with the piston initially 0.2 m above the base. A spring of constant k = 10⁴ N/m sits above the piston at its natural length. The outside pressure is P₀ = 10⁵ Pa. The gas is heated slowly until the piston rises 0.1 m. Find the heat supplied, and the molar heat capacity along this process. (Ignore the piston's weight.)
The program below follows the three steps.
P0 = 1.0e5 # Pa
A = 0.01 # m^2
k = 1.0e4 # N/m
L0 = 0.2 # m, initial gas column
x = 0.1 # m, piston displacement
f = 3 # monatomic gas
# Step 1: pressures from force balance on the piston
P1 = P0
P2 = P0 + k * x / A
V1 = A * L0
V2 = A * (L0 + x)
# Step 2: work, computed two independent ways
W_energy = P0 * A * x + 0.5 * k * x ** 2
W_area = 0.5 * (P1 + P2) * (V2 - V1)
assert abs(W_energy - W_area) < 1e-9
# Step 3: first law, using PV = nRT so that n is not needed
dU = (f / 2) * (P2 * V2 - P1 * V1)
Q = dU + W_energy
# Molar heat capacity in units of R: C = Q / (n * dT), and n*R*dT = P2*V2 - P1*V1
C_over_R = Q / (P2 * V2 - P1 * V1)
print(f"P2 = {P2:.0f} Pa, W = {W_energy:.0f} J, dU = {dU:.0f} J, Q = {Q:.0f} J")
print(f"Molar heat capacity along the process = {C_over_R:.3f} R")It prints P₂ = 200000 Pa, W = 150 J, ΔU = 600 J and Q = 750 J. The molar heat capacity is 1.875 R, which is larger than C_v = 1.5 R. Part of the heat goes into work.
The solving path
The diagram shows the order to follow in a combined problem. Check at each stage whether the process is slow.
Heat exchange: choose the process type from the walls
The wall material and the speed of the process tell you which relation applies.
- Isothermal (conducting walls, slow): PV is constant, ΔU = 0, and Q = W.
- Adiabatic and slow: Q = 0, and PV^γ is constant. Here γ = 1 + 2/f.
- Adiabatic and sudden: Q = 0 and ΔU = −W, but PV^γ is not constant because the gas is not in equilibrium during the process.
- Spring or weight on the piston, heated slowly: the force balance fixes the P–V line, so use the example above.
- Two chambers separated by a piston: each chamber has its own gas law, and the piston links them. Equal pressures give the force balance, and the volumes satisfy V₁ + V₂ = constant if the total length is fixed.
A frequent case is a piston held by a stop, then released with a constant external pressure Pext. The gas expands rapidly against Pext, so the work is W = Pext ΔV, not an area under a quasi-static curve. Then ΔU = −Pext ΔV, and this gives the final temperature. Use it together with the final force balance to find the final volume.
Spring as a heat-capacity trap
On a straight P–V line, the heat absorbed can change sign partway through. The gas can take in heat during the first part of a compression and release it later, or the reverse. If a question asks for "the heat absorbed", check whether dQ keeps one sign. Compute dQ = n C_v dT + P dV along the line. Do not assume that Q for the whole process equals the heat absorbed at every step.
Common errors
- Using P₀ for the gas pressure after the spring has stretched.
- Counting the spring energy but forgetting the work done against the atmosphere, or the reverse.
- Using the number of degrees of freedom of the wrong gas. Check "monatomic", "diatomic" and "mixture".
- Using T from one state with n from another. Use PV differences to avoid this.
- Forgetting that the spring's x is measured from its natural length.
Checks before you move on
- Units. Pa × m³ is J, and N/m × m² is J.
- Limit k → 0. The process becomes constant pressure, W = P₀Ax, and C = (f/2 + 1)R. The example formula should reduce to this. For f = 3 this is 2.5R.
- Two routes for W. The area under the line and the energy split must match, as the code asserts.
- Sign of Q. A gas that expands and heats up must absorb heat.
Exercise
Take the same cylinder, spring, and heating as in the worked example (A = 0.01 m², L₀ = 0.2 m, k = 10⁴ N/m, P₀ = 10⁵ Pa, x = 0.1 m), but fill it with a diatomic ideal gas (f = 5). Find the heat supplied.
Show answer
The pressures, volumes and work are unchanged: P₁V₁ = 200 J, P₂V₂ = 600 J, W = 150 J. Then ΔU = (5/2)(600 − 200) = 1000 J, so Q = ΔU + W = 1150 J.
Exercise
A gas is in a cylinder with a piston held by a stop. The external pressure is Pext. The stop is removed and the piston moves out, stopping where gas pressure equals Pext. Why can't you use PV^γ = constant even if the walls are perfectly insulated?
Show answer
The expansion is sudden, so the gas is not in equilibrium during it and PV^γ is not constant. Use Q = 0 and ΔU = −W with W = Pext ΔV, plus the final condition P = Pext.