Reversible and Irreversible Expansion or Compression Work
This Demonstration shows animations and calculates work for reversible and irreversible expansions and compressions (adiabatic or isothermal) of an ideal diatomic gas in a piston-cylinder system. Select either compression or expansion using the buttons, and compare two processes side-by-side using drop-down menus. Change the final pressure with the slider; the pressure ranges are different for compression and expansion. For adiabatic processes, the final temperature is calculated. For all processes, the final volume is calculated. Press the play button to start compression or expansion. For reversible processes, more weights (blue rectangles) are added to the piston for compression or removed for expansion. For irreversible processes, the external pressure is constant at the final value, so the number of weights is fixed, and initially stops (red triangles) prevent the piston from moving until the play button is pressed. Animations of reversible processes represent slow processes; irreversible processes are much faster and the piston overshoots the final volume, but these behaviors are not shown in the animations.
Contributed by: Rachael L. Baumann (June 2015)
Additional contributions by: John L. Falconer, Derek M. Machalek, Nathan S. Nelson and Garrison J. Vigil
(University of Colorado Boulder, Department of Chemical and Biological Engineering)
Open content licensed under CC BY-NC-SA
Expansion-compression work for all four processes is calculated from
where is the external pressure and is in units of kJ/mol. The external pressure and the gas pressure are equal for a reversible process, whereas for an irreversible process the external pressure is the final pressure.
where the subscript refers to the initial state, is the ideal gas constant (kJ/(mol K)), is volume (), is temperature (K) and is pressure (Pa).
For an isothermal process:
where the subscript refers to the final condition.
For an adiabatic process on an ideal diatomic gas:
where , is the constant volume heat capacity, and is the constant pressure heat capacity (kJ/(mol K)).
The screencast video  explains how to use this Demonstration.
 J. R. Elliott and C. T. Lira, Introductory Chemical Engineering Thermodynamics, New York: Pearson Education, 2012.
 Reversible and Irreversible Expansion or Compression Work [Video]. (Mar 29, 2017) www.colorado.edu/learncheme/thermodynamics/ReversibleIrreversibleExpansionCompression.html.