MRMaschinenbaurechnerEngineering calculation tools

Gas State Changes

Compute state changes of ideal gases: from the initial state (pressure, temperature, mass) and exactly one target value you get the final state plus boundary work, heat, change of internal energy and entropy change. Isothermal, isobaric, isochoric, adiabatic and polytropic are available, and the result appears live with a p-V diagram.

State change calculator (ideal gas)

State change
Initial state 1
Target value for state 2
Gas properties

Isentropic exponent κ = c_p/c_v: 1.4

Model: ideal gas with p·V = m·R_s·T and temperature-independent heat capacities; reversible, quasi-static state change. Friction and flow losses as well as real-gas effects near liquefaction are not accounted for. Sizing and learning tool for engineering thermodynamics.

Export

Results

Calculating …

Formulas and fundamentals

The basis is the ideal gas law p·V = m·R_s·T with the specific gas constant R_s (287 J/(kg·K) for air). A reversible state change follows p·Vᵐ = const with the process exponent m: isothermal m = 1 (T = const), isobaric m = 0 (p = const), adiabatic m = κ (Q = 0) and polytropic m = n. The isochoric change (V = const) is the limit m → ∞. From the exponent and one target value for state 2 the final pressure, volume and temperature follow directly: T₂/T₁ = (V₁/V₂)^(m−1) and p₂/p₁ = (V₁/V₂)^m.

The boundary work is the integral W₁₂ = −∫ p dV. For the isothermal change this gives W₁₂ = −m·R_s·T·ln(V₂/V₁), for the polytropic change W₁₂ = m·R_s·(T₂−T₁)/(n−1); for the isobaric change W₁₂ = −p·(V₂−V₁), and for the isochoric change W₁₂ = 0. Sign convention here: work supplied to the gas is positive, so compression yields W > 0.

For an ideal gas the change of internal energy depends only on temperature, ΔU = m·c_v·(T₂−T₁). The first law relates the quantities as ΔU = Q + W, from which the exchanged heat Q₁₂ follows (adiabatic Q = 0, isochoric Q = ΔU, isobaric Q = m·c_p·(T₂−T₁)). The entropy change is ΔS = m·[c_v·ln(T₂/T₁) + R_s·ln(V₂/V₁)]. The isentropic exponent κ = c_p/c_v is about 1.4 for diatomic gases such as air.

Worked example

One kilogram of air (R_s = 287 J/(kg·K)) with an initial pressure of 1 bar at 300 K is compressed isothermally to half the volume. As the temperature stays constant, the pressure doubles to 2 bar and the internal energy does not change.

The supplied boundary work is W₁₂ = −m·R_s·T·ln(V₂/V₁) = −1·287·300·ln(0.5) = 59.68 kJ. Because ΔU = 0, the first law requires exactly this energy to be removed as heat: Q₁₂ = −59.68 kJ.

If instead the gas is compressed adiabatically (without heat exchange) to half the volume, the temperature rises by the factor T₂/T₁ = (V₁/V₂)^(κ−1) = 2^0.4 = 1.320, i.e. to about 396 K. Here all supplied work increases the internal energy because no heat escapes – this is the principle of compression heating.

Frequently asked questions

Which target value may I set for each type?

Exactly one target value defines state 2. For the isothermal change the temperature is already fixed (T₂ = T₁), so T₂ is not a valid input. For the isobaric change the pressure is fixed (p₂ = p₁), so no p₂. For the isochoric change the volume is fixed, so neither V₂ nor a volume ratio; here you set the final pressure or temperature.

What does the sign of work and heat mean?

The convention here is that energy supplied to the gas counts as positive. A compression therefore yields positive work W, an expansion negative work. Heat removed is negative. The first law reads ΔU = Q + W.

What is the difference between adiabatic and polytropic?

The adiabatic change exchanges no heat with the surroundings (Q = 0) and follows p·Vᵏ = const with the isentropic exponent κ. The polytropic change is the generalisation with a freely chosen exponent n and describes real processes with partial heat exchange between the limits isothermal (n = 1) and adiabatic (n = κ).

Where does κ = 1.4 for air come from?

κ is the ratio of the specific heat capacities c_p/c_v. For diatomic gases such as nitrogen and oxygen, which make up most of air, kinetic gas theory gives κ ≈ 1.4. The value is adjustable in the calculator by changing c_p and c_v.

Does the calculation apply to real gases?

The model is the ideal gas with temperature-independent heat capacities and a reversible, quasi-static state change. For air and technical gases at moderate pressures and far from the condensation point this is a good approximation. Near liquefaction, at very high pressures or with friction and flow losses, real processes deviate.

Related tools