Interactive Animation: Changes in the State of an Ideal Gas

By |

This simulation shows an ideal gas (1 mol, diatomic) in a cylinder with a movable piston. A process selector lets you explore the four idealised changes of state: isothermal, isobaric, isochoric and adiabatic. It also offers a free relaxation towards ambient equilibrium. The state is displayed simultaneously in the p-V diagram, as a time series, and in the T-S diagram.

Links

Description of the Animation

The gas is enclosed by a weight-loaded piston. Depending on the selected process, the state is changed either mechanically (by dragging the piston) or thermally (by adding or removing heat in three levels). The colour of the gas indicates its temperature qualitatively: from cool blue to warm orange.

All calculations are based on the thermal equation of state of the ideal gas:

\[ p \cdot V = n \cdot R \cdot T \]

  • p: pressure in pascals (Pa)
  • V: volume in cubic metres (m³)
  • n: amount of substance in moles (mol); the simulation uses n = 1 mol
  • R: universal gas constant, R = 8.314 J/(mol·K)
  • T: absolute temperature in kelvin (K)

The Four Changes of State

In each change of state one quantity is held constant. The equation of state then yields the familiar relationships:

Isothermal (T = const, Boyle’s law). The gas is in contact with a heat bath. When the piston is drawn slowly, the temperature is preserved, and a hyperbola appears in the p-V diagram:

\[ p \cdot V = \text{const} \quad \Rightarrow \quad p_1 V_1 = p_2 V_2 \]

Isobaric (p = const, Charles’s law). The pressure is fixed by the constant piston load. Added heat raises temperature and volume in proportion:

\[ \frac{V}{T} = \text{const} \quad \Rightarrow \quad \frac{V_1}{T_1} = \frac{V_2}{T_2} \]

Isochoric (V = const, Gay-Lussac’s law). The piston is clamped. Added heat raises only pressure and temperature; no volume work is done:

\[ \frac{p}{T} = \text{const} \quad \Rightarrow \quad \frac{p_1}{T_1} = \frac{p_2}{T_2} \]

Adiabatic (Q = 0). The gas is thermally insulated; no heat is exchanged. The temperature changes solely through volume work (compression heats, expansion cools). The Poisson equations apply, with the adiabatic index \( \gamma \):

\[ p \cdot V^{\gamma} = \text{const} \qquad T \cdot V^{\gamma – 1} = \text{const} \]

For a diatomic gas (f = 5 degrees of freedom) the adiabatic index is \( \gamma = \frac{C_p}{C_V} = \frac{7}{5} = 1.4 \). Since the adiabat is steeper than the isotherm, it always lies below or above it in the p-V diagram from the same starting point.

Comparison of the Changes of State

The following table summarises the four changes of state side by side:

IsothermalIsobaricIsochoricAdiabatic
Constant quantityTpVQ = 0
LawBoyle’s lawCharles’s lawGay-Lussac’s lawPoisson equations
Work W≠ 0≠ 0= 0≠ 0
Heat Q≠ 0≠ 0≠ 0= 0
ΔU= 0≠ 0≠ 0≠ 0
Curve in p-VHyperbolaHorizontal lineVertical lineSteeper hyperbola
Curve in T-SHorizontal lineRising curveRising curve (steeper)Vertical line

First Law and Molar Heat Capacities

All processes obey the first law of thermodynamics – the conservation of energy for thermodynamic systems. The change in internal energy equals the heat supplied minus the volume work the gas does on its surroundings:

\[ \mathrm{d}U = \delta Q – p \, \mathrm{d}V \]

For an ideal gas the internal energy depends only on temperature: \( \Delta U = C_V \cdot \Delta T \). The heat capacities differ according to whether heat is added at constant volume or at constant pressure:

  • Isochoric: \( Q = C_V \cdot \Delta T \) with \( C_V = \frac{5}{2} n R \approx 20.8 \) J/K – all of the heat raises the internal energy.
  • Isobaric: \( Q = C_p \cdot \Delta T \) with \( C_p = \frac{7}{2} n R \approx 29.1 \) J/K – part of the heat is released as volume work, so more heat is needed for the same temperature rise.
  • Isothermal: \( \Delta U = 0 \); the heat supplied is converted entirely into work.
  • Adiabatic: \( Q = 0 \), hence \( \Delta U = -p\,\Delta V \) – the work is done entirely at the expense of the internal energy.

The Three Representations

  • p-V diagram: shows the state path in the pressure–volume plane. The area under a curve corresponds to the volume work done. Reference curves (isotherms and the isobar of the ambient load) can optionally be shown.
  • Time series: plots pressure, temperature and volume separately over time, making dynamic processes such as the settling in free mode visible.
  • T-S diagram: plots temperature against entropy. Here the area under a reversible curve corresponds to the heat exchanged. For the ideal gas (relative to the ambient equilibrium as the zero point):

\[ \Delta S = C_V \ln\!\left(\frac{T_2}{T_1}\right) + n R \ln\!\left(\frac{V_2}{V_1}\right) \]

The T-S diagram makes the processes especially intuitive: the isochor and the isobar appear as curves of different slope, the isotherm as a horizontal line, and the reversible adiabat (isentrope) as a vertical line.

Understanding Entropy Intuitively

Entropy is one of the most commonly misunderstood concepts in thermodynamics. Intuitively, it describes how “spread out” or “degraded” the energy in a system is. The higher the entropy, the more evenly the energy is distributed among the particles – and the less useful work can be extracted from the system.

What does the T-S diagram show? In the T-S diagram, the area under a reversible process curve equals the heat exchanged. This makes it the ideal tool for visualising heat flows:

  • The adiabat appears as a vertical line (\( \Delta S = 0 \)) because no heat is exchanged – the entropy stays constant. This is why it is also called an isentrope.
  • The isotherm runs horizontally because the temperature stays constant while heat flows in or out and the entropy changes.
  • For isochoric and isobaric processes, both temperature and entropy increase – the isobar has a shallower slope because part of the heat is released as volume work.

Why does this matter? For cyclic processes (e.g. Carnot), the enclosed area in the T-S diagram represents the net heat and thus the useful work output. A larger area means a more efficient engine.

Interactive Controls

  • Select process: Isothermal, Adiabatic, Isobaric, Isochoric or Free. Depending on the choice, either the piston or the heating/cooling buttons are active.
  • Drag piston (isothermal, adiabatic, free): changes the volume directly.
  • Heat / cool (isobaric, isochoric, free): adds or removes heat in three levels.
  • Switch view: p-V diagram, time series or T-S diagram.
  • Reference curves: shows or hides comparison curves in the p-V and T-S diagrams.
  • Pause / Reset: pauses the simulation or resets it to the ambient equilibrium (T = 300 K, p ≈ 100 kPa).

Physical Background

The idealised changes of state are the building blocks from which thermodynamic cycles are assembled. They are a model concept: real processes are never exactly isothermal or adiabatic but lie between these limiting cases. The quasi-static, reversible limit is ideal because it proceeds infinitely slowly and generates no entropy. By contrast, the “Free (relaxation)” mode shows an analogy model for an irreversible equilibration process, in which the piston settles into a new equilibrium under the ambient load.

Note: The simulation models 1 mol of an ideal, diatomic gas in SI units. The mechanics of the free mode (inertia, damping) are a didactic surrogate model and not to scale; they serve only to illustrate the settling behaviour.

Common Misconceptions

When studying changes of state, the same misunderstandings arise time and again. The following clarifications help avoid typical pitfalls:

“Adiabatic means no temperature change” – No. Adiabatic means no heat exchange (\( Q = 0 \)). The temperature still changes, driven by the volume work done. Compression raises the temperature; expansion lowers it. You can feel this when inflating a bicycle tyre: the pump gets warm even though there is no external heat source.

“In an isothermal process, no heat flows” – The opposite is true. For the temperature to remain constant despite a change in volume, heat must be added or removed. During isothermal expansion, exactly as much heat is supplied as the gas does work.

“Isochoric means nothing happens” – In an isochoric process no mechanical work is done (because the volume does not change), but pressure and temperature can change significantly when heat is added or removed. An example is heating air inside a rigid pressure vessel.

“Real processes are either isothermal or adiabatic” – In reality, real processes always lie between these limiting cases. A compression in a cylinder is neither perfectly adiabatic (there is always some heat exchange with the surroundings) nor perfectly isothermal (that would require infinitely slow execution). The idealised changes of state are models that make understanding easier.

Practical Applications

  • Internal combustion engines: the Otto and Diesel cycles combine isochoric, isobaric and adiabatic steps
  • Stirling engine: works with isothermal and isochoric changes of state
  • Refrigerators and heat pumps: use the adiabatic compression and expansion of a working fluid
  • Compressors and pneumatics: rapid compression is approximately adiabatic and heats the gas noticeably

Thermodynamic Cycles

The four changes of state are not only interesting individually – they are the building blocks from which all thermodynamic cycles are assembled. In a cycle, the gas undergoes a closed sequence of state changes and returns to its initial state. In the process, heat is partly converted into mechanical work.

Carnot Cycle – the Ideal Benchmark

The Carnot cycle consists of two isothermal and two adiabatic steps:

  • Isothermal expansion (heat absorption at high temperature \( T_H \))
  • Adiabatic expansion (cooling to low temperature \( T_C \))
  • Isothermal compression (heat rejection at low temperature \( T_C \))
  • Adiabatic compression (reheating back to \( T_H \))

The efficiency of the Carnot cycle is the maximum achievable efficiency between two temperature levels:

\[ \eta_{\text{Carnot}} = 1 – \frac{T_C}{T_H} \]

No real engine can exceed this efficiency – it is a fundamental limit of thermodynamics.

Otto Cycle – the Petrol Engine

The idealised Otto cycle consists of two isochoric and two adiabatic state changes. The combustion of the fuel is modelled as an isochoric heat addition (the volume stays nearly constant while pressure and temperature rise sharply). Its efficiency depends on the compression ratio:

\[ \eta_{\text{Otto}} = 1 – \frac{1}{r^{\gamma – 1}} \]

where \( r \) is the compression ratio. Typical values are around \( r \approx 10 \), giving a theoretical efficiency of about 60 %.

Diesel Cycle

In the Diesel cycle, heat is added isobarically rather than isochorically: the fuel is injected into the hot, compressed air and burns at approximately constant pressure. This allows the diesel engine to achieve higher compression ratios (\( r \approx 20 \)) and thus a higher efficiency than the Otto engine.

Historical Background

The gas laws underlying this simulation were discovered over several centuries by scientists of diverse backgrounds – often independently of one another:

Robert Boyle (1627–1691) and Edme Mariotte (1620–1684) independently discovered that at constant temperature the pressure of a gas is inversely proportional to its volume. Boyle published his findings in 1662 in England, Mariotte in 1676 in France – hence the dual name “Boyle–Mariotte” used in continental Europe.

Joseph Louis Gay-Lussac (1778–1850) was not only an outstanding experimental physicist but also an adventurer: in 1804 he ascended to over 7,000 metres in a hydrogen balloon – a record that stood for two decades. His measurements on the expansion of gases at constant pressure laid the foundation for the law that bears his name.

Guillaume Amontons (1663–1705) was the first to systematically investigate the relationship between pressure and temperature at constant volume. Remarkably, despite a hearing impairment that accompanied him from childhood, he became one of the most productive experimental physicists of his era.

Siméon Denis Poisson (1781–1840) derived the equations for adiabatic changes of state mathematically in 1823. The Poisson equations link pressure, volume and temperature for processes without heat exchange, completing the theoretical foundation of the gas laws.

Nicolas Léonard Sadi Carnot (1796–1832) formulated the theoretical foundations of heat engines in 1824, at just 28 years of age. His ideal cycle – the Carnot cycle – showed for the first time that there is a fundamental upper limit to efficiency, determined solely by the temperatures of the heat reservoirs. This insight became one of the cornerstones of the second law of thermodynamics.

Related Animations

HD Animations

Web Animations

Overview

TitleIdeal Gas – Changes of State at a Piston
Target audienceTeachers and lecturers
FeaturesFullscreen mode
lossless magnification
large screens and projection supported
LicenseMIT