From first principles
Obtain closed-system work from the motion of a boundary
Choose a fixed mass of gas enclosed by a piston and cylinder. No mass crosses this boundary. The first law is the empirical balance of energy: with heat positive into the gas and work positive out, change of internal, kinetic and potential energy equals net heat minus net work. For a piston moving normally through \(dx\) against a uniform resisting pressure \(p_{\rm ext}\), force times displacement gives
For slow internal equilibration with tiny pressure differences, one can use gas pressure in the integral. If bulk kinetic and potential changes are negligible and no shaft or electrical work crosses the boundary, the integrated heating requirement is
The area under the specified pressure–volume path is therefore part of the heat calculation. For a rigid vessel it vanishes. For a constant-pressure piston heating an ideal gas, \(p\Delta V=mR\Delta T\) adds to the internal-energy change. The end temperatures alone determine the ideal-gas internal-energy change, while the moving boundary determines the work.
Derivation and applications
Determine the heat input when a spring loads the piston
A freely sliding piston does not necessarily hold the gas pressure constant. Attach a linear spring to a frictionless piston of area \(A\) and let its resisting force increase as the gas expands. Consider a closed mass \(m\) of ideal gas, heated slowly enough that piston force balance holds at each intermediate state. Neglect piston kinetic energy, heat leakage and changes of elevation except as already included in the constant external pressure \(p_1\). At the initial position the gas is in equilibrium at absolute pressure \(p_1\) and volume \(V_1\).
The displacement \(x\) produces a volume increment \(Ax\) and an extra resisting force \(kx\). Dividing by piston area gives the pressure as a function of the evolving volume:
Boundary work is performed at this changing external pressure. Integrating the straight-line path over the swept volume \(\Delta V=V_2-V_1\) separates work against the initial pressure from work stored in the spring:
For constant specific heat \(c_v\) and specific gas constant \(R\), the first law gives the heat required, positive into the gas. State temperatures follow from the ideal-gas relation, including the final spring pressure:
Only the temperature change determines the internal-energy change; the mechanical law selects the work term. Setting \(k=0\) recovers expansion against constant pressure. Abrupt heating that accelerates the piston would invalidate the assumed quasistatic pressure path.
Worked example
Calculate the heater input for an air cylinder
Change the inputs and test this calculation.
Take \(m=0.0100\) kg, \(V_1=0.0100\) m³, \(p_1=100\) kPa, \(A=0.0100\) m² and \(k=1000\) N/m. Increase volume by \(0.00200\) m³. The final pressure is \(120\) kPa; the work is
For \(R=0.287\) and \(c_v=0.718\) kJ/(kg K), \(\Delta T=(1.440-1.000)/(0.0100\times0.287)=153\) K. The gas receives \(1.10+0.220=1.32\) kJ of heat.
Second application
Separate actuator work from stored spring energy
Change the inputs and test this calculation.
On the same stroke the piston travels \(0.200\) m. The initially unloaded incremental spring stores \(kx^2/2=20.0\) J, exactly the triangular part of the pressure–volume work. The constant load receives \(200\) J. If the spring were removed while retaining the same initial state and swept volume, the final pressure would stay at \(100\) kPa and the temperature rise would be only \(69.7\) K. The two processes end at different thermodynamic states despite having the same final volume.
Try it · Spring piston
Set the inputs to the values in the worked example, then vary one quantity while holding the others fixed. Compare the curve and numerical balance with the second application. The calculation uses the assumptions derived above; its readout identifies bounds such as choking, phase-region changes and inconsistent measurements.
Decide what crosses the boundary
Draw a boundary around the gas in a piston cylinder. If no gas crosses its surface, the system is closed even though the piston moves. A rigid vessel is a special closed system with fixed volume. An insulated wall prevents heat transfer; a shaft or electrical lead can still transmit work through it. These descriptions impose different constraints and should be identified before choosing an equation.
At equilibrium a simple compressible substance can be described using independent state variables such as temperature and specific volume. Pressure \(p\), volume \(V\), temperature \(T\) and internal energy \(U\) are properties. An equation of state relates some of them. For a dilute ideal gas \(pV=mRT\), where \(R\) is the specific gas constant. Always use absolute pressure and absolute temperature in this relation. Two initial and final states determine changes in properties, but do not specify the heat and work transfers between them.
Construct the process energy balance
Take work done by the system as positive and heat entering it as positive. The first law is
For a stationary vessel ignore changes in kinetic and gravitational energy of the system as a whole. A moving piston of area \(A\) against external pressure \(p_{\rm ext}\) performs incremental work \(p_{\rm ext}A\,dx=p_{\rm ext}dV\). For a quasistatic mechanically reversible motion the boundary pressure can be represented by the gas pressure throughout the process.
If gas expands from \(V_1\) to \(V_2\) at constant external pressure,
If it instead follows a reversible isothermal ideal-gas path, inserting \(p=mRT/V\) and integrating gives
Both expressions have units of energy. Their different volume dependence makes a pressure-volume diagram useful: the area under each pressure path has a direct work interpretation when its boundary-force assumptions hold.
Background · Which pressure enters the boundary-work integral?
The traction at a moving boundary determines the mechanical work across it. For a piston use the pressure exerted against the load. Replacing it by a uniform equilibrium gas pressure additionally assumes slow mechanical evolution. A limiting comparison makes this distinction measurable.
Remove a partition in an insulated rigid vessel so that an ideal gas expands into a vacuum. The external pressure against the advancing gas is zero. There is no heat transfer or boundary work, so the gas returns to the same equilibrium temperature. A reversible isothermal expansion between those same gas volumes requires heat from a bath and yields positive work \(nRT\ln(V_2/V_1)\). The two endpoint states alone do not define a work measurement.
Heat air below a freely moving piston
A weight-loaded, frictionless piston keeps 0.50 kg of ideal air at 150 kPa absolute as a heater raises its temperature from 300 to 360 K. Use constant properties \(R=0.287\) and \(c_v=0.718\) kJ/(kg K). The ideal-gas law gives the volumes at the two ends of the process.
The pressure is constant, so the work is the area of a rectangle on a pressure–volume diagram. Internal energy depends on the gas temperature. These are separate contributions to the heat input.
The required heat is
The same result follows from \(mc_p\Delta T\) because for this constant-pressure ideal-gas process with only boundary work \(c_p=c_v+R=1.005\) kJ/(kg K). The extra heat above the internal-energy increase moved the piston weight. Using \(Q=mc_p\Delta T\) without inspecting the constraint would give the wrong heat input to a rigid tank.
Compare a rigid-wall experiment
Lock the piston at its initial volume before heating an identical mass from 300 to 360 K. Now \(W=0\), so only 21.54 kJ of heat is needed. The final pressure is
Equal temperature changes in an ideal gas imply equal changes in internal energy, even though final pressures and energy transfers differ. For a real fluid near a phase boundary, constant ideal-gas heat capacities may fail; use tabulated state properties or a suitable equation of state. In either case the first-law accounting is unchanged once the initial and final internal energies and the actual boundary work are known.
A different path between specified volumes
An ideal gas initially at 300 kPa and 0.020 m³ expands quasistatically and isothermally to twice its initial volume. Since \(pV=p_1V_1\), work out is
Ideal-gas internal energy depends only on temperature, so \(\Delta U=0\) and heat entering equals 4.16 kJ. A freely expanding ideal gas in an insulated rigid outer vessel can reach the same final temperature and occupied volume while doing zero boundary work. The state variables alone do not record which process occurred.
Determine heat and work along a measured compression path
A measured pressure–volume trace contains more information than its endpoints. For some slow piston processes an empirical polytropic law \(pV^n=\text{constant}\) fits the path. Here \(n\) is a fitted process exponent and need not equal the gas heat-capacity ratio. Assume a closed cylinder with negligible kinetic and potential energy change, a quasistatic pressure load and a calorically perfect ideal gas. Work out of the gas is the area \(W=\int_{V_1}^{V_2}p\,dV\), which is negative for compression. Substitute \(p=p_1V_1^n V^{-n}\) and integrate:
The logarithmic case is the continuous limit as \(n\) approaches one. The ideal-gas equation also gives \(T_2/T_1=(V_1/V_2)^{n-1}\), so \(\Delta U=mc_v(T_2-T_1)\). With \(Q-W=\Delta U\) and \(pV=mRT\), the heat input is \(Q=m[c_v+R/(1-n)](T_2-T_1)\) for \(n\ne1\). Setting \(n=\gamma=c_p/c_v\) eliminates \(Q\). This inference relies on the ideal-gas, constant-property, quasistatic assumptions. An arbitrary irreversible compression with the same endpoints cannot be called isentropic from the fitted exponent alone.
Recover a cylinder heat loss from three measurements
A test traps air at \(p_1=100\,\mathrm{kPa}\) absolute, \(V_1=0.0100\,\mathrm{m^3}\), \(T_1=300\,\mathrm K\), then compresses it to \(V_2=0.0040\,\mathrm{m^3}\). The fitted exponent is 1.25. Using \(R=0.287,\ c_v=0.718\,\mathrm{kJ/(kg\,K)}\), the trapped mass is
The predicted pressure is
Note that absolute pressure is required in both the fit and the gas law. A pressure transducer referenced to atmosphere would need its reference restored.
The gas does \(W=[314.4(0.0040)-100(0.0100)]/(1-1.25)=-1.03\,\mathrm{kJ}\). Its internal energy rises by \(0.01161(0.718)(77.2)=0.644\,\mathrm{kJ}\), giving \(Q=\Delta U+W=-0.386\,\mathrm{kJ}\). Compression work enters the gas while part leaves as heat through the cylinder wall. If the process were isothermal at 300 K, the same volume change would require only \(-W=0.916\,\mathrm{kJ}\) and the full amount would leave as heat. A mid-stroke measurement gives a stronger check than the end pressure: the fitted law predicts \(100(0.010/0.007)^{1.25}=156.2\,\mathrm{kPa}\) at 7.0 litres. A substantial discrepancy would favour direct numerical integration of the measured trace over using a single exponent.
An apparent exponent can also be estimated directly from pressure ratios:
Compare estimates from the first and second halves of the stroke. Agreement means the same log–log slope describes both halves, while disagreement may indicate changing heat transfer, leakage or phase lag between the pressure and position sensors. It does not identify which of those mechanisms is responsible. As a separate check, suppose a water jacket gains the estimated 0.386 kJ each stroke and the compressor completes ten such strokes per minute. The mean heat removal from these strokes would be \(0.386(10)/60=0.0643\,\mathrm{kW}\). A jacket measurement of the complete machine includes intake and exhaust processes and mechanical friction as well, so experimental comparison requires either an isolated compression interval or a balance around the rest of the cycle.
A change in operating speed can also change the fitted exponent because it changes the time available for heat exchange during a single compression stroke.