Course-wide Conventions & Notation
Overview and Learning Objectives¶
The Carnot cycle is a fully reversible heat-engine cycle that sets the maximum efficiency any engine can achieve between two reservoir temperatures. Using the entropy definition , the cycle relates heat flows to temperature and establishes . The same reasoning yields a second-law statement about the direction of spontaneous heat flow.
This section connects entropy to the performance limits of heat engines using the Carnot cycle. It develops four linked ideas:
Entropy and reversible heat. From Section 4.1, the differential definition of entropy for a reversible path is
Entropy change tracks how much reversible heat flows at a given temperature.
The Carnot cycle as a “best possible” engine. A Carnot engine is an idealized, fully reversible cycle operating between two thermal reservoirs: a hot reservoir at temperature and a cold reservoir at . The cycle consists of two reversible isotherms and two reversible adiabats.
Maximum efficiency for converting heat to work. For any engine operating between the same two reservoir temperatures, the Carnot engine has the maximum possible efficiency:
Second law as the direction of heat flow. A two-body argument shows that spontaneous heat flow must go from higher temperature to lower temperature, because the total entropy of an isolated system must not decrease.
Throughout, we use the standard Carnot labeling :
: isothermal expansion at
: adiabatic expansion (insulated)
: isothermal compression at
: adiabatic compression (insulated)
Learning objectives:
Describe the four reversible steps of the Carnot cycle (two isotherms and two adiabats) on a – diagram.
Use entropy changes on reversible isotherms and adiabats to show .
Derive the Carnot efficiency .
Explain why spontaneous heat flow from hot to cold is required by non-decreasing total entropy.
Core Ideas and Derivations¶
The Cycle¶
The figure below plots the Carnot cycle on a pressure–volume (P–V) diagram for an ideal gas. The key geometric features are:
The isotherms (red/blue) follow the ideal-gas relation at fixed temperature.
The adiabats (dashed/dotted) are steeper than the isotherms and follow for a reversible adiabatic process of an ideal gas (Section 3.2).
Source
import numpy as np
import matplotlib.cm as cm
import matplotlib.pyplot as plt
from scipy.constants import R as R_J_per_K_mol
from labellines import labelLines
from myst_nb import glue
# Constants
R = R_J_per_K_mol / 1000 # J/K/mol to kJ/K/mol (keeps PV values numerically small for plotting)
# Isothermal Process for Ideal Gas
def P_isothermal_ideal_gas(V, T, n):
return n * R * T / V
# Adiabatic Process for Ideal Gas
def P_adiabatic_ideal_gas(V, V1, P1, gamma=5/3):
return P1 * (V1 / V) ** gamma
# Intersection of two pressure curves
def intersection(P1, P2, V):
return V[np.argmin(np.abs(P1 - P2))]
# Plotting the Carnot Cycle
fig, axs = plt.subplots(1, 1, figsize=(4, 4))
# Calculate the pressure for each segment of the cycle
V = np.linspace(0.1, 5, 1000) # L
T_hot = 298.15 # K
T_cold = 273.15 # K
n = 1 # mol
V_A = 0.5 # L
V_C = 1.0 # L
P_AB = P_isothermal_ideal_gas(V, T_hot, n)
P_DA = P_adiabatic_ideal_gas(V, V_A, P_isothermal_ideal_gas(V_A, T_hot, n))
P_CD = P_isothermal_ideal_gas(V, T_cold, n)
P_BC = P_adiabatic_ideal_gas(V, V_C, P_isothermal_ideal_gas(V_C, T_cold, n))
# Plot the segments
isotherm_1 = axs.plot(V, P_AB, "r-", label=r'A$\rightarrow$B isothermal expansion ($T_{\text{hot}}$)')
adiabat_1 = axs.plot(V, P_BC, "k:", label=r'B$\rightarrow$C adiabatic expansion', zorder=-10)
isotherm_2 = axs.plot(V, P_CD, "b-", label=r'C$\rightarrow$D isothermal compression ($T_{\text{cold}}$)')
adiabat_2 = axs.plot(V, P_DA, "k--", label=r'D$\rightarrow$A adiabatic compression', zorder=-10)
# Legend
axs.legend(bbox_to_anchor=(1.05, 1), loc='upper left', borderaxespad=0., title="Steps")
# Mark the points
axs.plot(V_A, P_isothermal_ideal_gas(V_A, T_hot, n), "ks", markerfacecolor='none')
axs.annotate("A", (V_A, P_isothermal_ideal_gas(V_A, T_hot, n)), textcoords="offset points", xytext=(10, 10), ha='center', va='center')
V_B = intersection(P_AB, P_BC, V)
P_B = P_isothermal_ideal_gas(V_B, T_hot, n)
axs.plot(V_B, P_B, "ks", markerfacecolor='none')
axs.annotate("B", (V_B, P_B), textcoords="offset points", xytext=(10, 10), ha='center', va='center')
V_C = intersection(P_BC, P_CD, V)
P_C = P_isothermal_ideal_gas(V_C, T_cold, n)
axs.plot(V_C, P_C, "ks", markerfacecolor='none')
axs.annotate("C", (V_C, P_C), textcoords="offset points", xytext=(-10, -10), ha='center', va='center')
V_D = intersection(P_CD, P_DA, V)
P_D = P_isothermal_ideal_gas(V_D, T_cold, n)
axs.plot(V_D, P_D, "ks", markerfacecolor='none')
axs.annotate("D", (V_D, P_D), textcoords="offset points", xytext=(-10, -10), ha='center', va='center')
axs.set_xlim(0.4, 1.1)
axs.set_ylim(2, 6)
axs.set_xticks([V_A, V_B, V_C, V_D])
axs.set_xticklabels([r"$V_A$", r"$V_B$", r"$V_C$", r"$V_D$"])
P_A = P_isothermal_ideal_gas(V_A, T_hot, n)
axs.set_yticks([P_A, P_B, P_C, P_D])
axs.set_yticklabels([r"$P_A$", r"$P_B$", r"$P_C$", r"$P_D$"])
# Add heat-flow annotations (matches the lecture sketch: heat in on the hot isotherm, heat out on the cold isotherm)
x = (V_B + V_D) / 2
y = (P_B + P_D) / 2
axs.annotate("system\nabsorbs\nheat", (x, y - 0.1), textcoords="offset points", xytext=(50, 50), ha='center', va='center', fontsize=10, color='r', arrowprops=dict(facecolor='r', shrink=0.05, edgecolor='w', width=2, headwidth=8, headlength=8))
axs.annotate("system\nreleases\nheat", (x, y - 0.1), textcoords="offset points", xytext=(-50, -50), ha='center', va='center', fontsize=10, color='b', arrowprops=dict(facecolor='b', shrink=0.05, edgecolor='w', width=2, headwidth=8, headlength=8))
axs.grid()
plt.show()
plt.close(fig)
The Carnot cycle for an ideal gas. The isothermal expansion and compression curves follow the ideal-gas equation (Boyle’s-law form at fixed ), while the adiabatic expansion and compression curves follow the adiabatic equation (which produces a steeper curve than the isotherms).
Step-by-step thermodynamic description¶
| Step | Process type | Thermal contact | Heat | Entropy change | Qualitative work |
|---|---|---|---|---|---|
| Reversible isothermal expansion at | Hot reservoir | System does work on surroundings () | |||
| Reversible adiabatic expansion | Insulated | System does work; temperature drops () | |||
| Reversible isothermal compression at | Cold reservoir | Surroundings do work on system () | |||
| Reversible adiabatic compression | Insulated | Surroundings do work on system; rises () |
Two quick consequences:
Because adiabatic steps have , the reversible definition gives on the adiabats (entropy is constant on a reversible adiabat — such a process is called isentropic).
Over one full cycle, the system returns to its initial state, so
which is exactly the relation we should expect: is a state function, so its change over any closed cycle must vanish.
How to Operate a Carnot Cycle/Engine¶
The Carnot cycle can be realized conceptually with a gas-filled cylinder, a piston loaded with weights, and two thermal reservoirs. The core idea: you alternate between (i) placing the gas in contact with a thermal reservoir so it can exchange heat reversibly at a fixed temperature (isotherms), and (ii) insulating the gas so it cannot exchange heat (adiabats).
: isothermal expansion at Put the cylinder in contact with the hot thermal source. Remove weights slowly so the piston rises quasi-statically. The system absorbs heat from the hot reservoir to keep constant, while doing work on the weights.
: adiabatic expansion (insulated) Remove the thermal contact and insulate the cylinder. Continue removing weights slowly so the piston rises. No heat flows (), so the work done by the gas comes from its internal energy, and the temperature drops from to .
: isothermal compression at Put the cylinder in contact with the cold thermal source. Add weights slowly so the piston lowers. The surroundings do work on the gas, and the gas releases heat to the cold reservoir to keep constant.
: adiabatic compression (insulated) Insulate the cylinder again and keep adding weights slowly to compress the gas. With no heat exchange, the work done on the gas increases its internal energy and raises the temperature back to , returning to state .
The schematic below illustrates each step, showing the thermal contact, piston position, and energy flows at the end of each process.
Source
import numpy as np
import matplotlib.cm as cm
import matplotlib.pyplot as plt
from scipy.constants import R as R_J_per_K_mol
from labellines import labelLines
from myst_nb import glue
fig, axs = plt.subplot_mosaic([[0, 1, 2, 3]], figsize=(8, 4), constrained_layout=True, sharex=True, sharey=True)
# Each panel shows the END state of the corresponding step.
# Step 1: A→B (isothermal expansion at T_hot) → ends at state B
# Step 2: B→C (adiabatic expansion) → ends at state C
# Step 3: C→D (isothermal compression at T_cold) → ends at state D
# Step 4: D→A (adiabatic compression) → ends at state A
titles = [
r'Step 1: A$\to$B',
r'Step 2: B$\to$C',
r'Step 3: C$\to$D',
r'Step 4: D$\to$A',
]
# Piston heights at the END state of each step (B, C, D, A)
piston_height = [3.5, 4.5, 2.5, 1.5]
# State labels at the END of each step
end_state = ["B", "C", "D", "A"]
# Thermal contact during each step
thermal_label = [r'$T_{\text{hot}}$', 'insulation', r'$T_{\text{cold}}$', 'insulation']
for i in range(4):
axs[i].set_title(titles[i], fontsize=10)
# Cylinder
axs[i].plot([0, 0], [5, 0], 'k-')
cylinder = axs[i].plot([0, 3], [0, 0], 'k-', label='cylinder')
axs[i].plot([3, 3], [0, 5], 'k-')
labelLines(cylinder, xvals=[1.5], fontsize=10, color='k')
# Thermal source / insulation block
axs[i].plot([0, 0], [-1, -2], 'k:')
thermal_source = axs[i].plot([0, 3], [-2, -2], 'k:', label='thermal source')
axs[i].plot([3, 3], [-2, -1], 'k:')
axs[i].plot([3, 0], [-1, -1], 'k:')
labelLines(thermal_source, xvals=[1.5], fontsize=10, color='k')
axs[i].text(1.5, -1.5, thermal_label[i], fontsize=10, ha='center', va='center')
# Piston
axs[i].plot([1.5, 1.5], [piston_height[i], 6], 'k-', lw=2)
piston = axs[i].plot([0, 3], [piston_height[i], piston_height[i]], 'k-', lw=2, label='piston')
labelLines(piston, xvals=[1.5], fontsize=10, color='k')
# P, V labels at end state
label = '$V_{\\text{' + end_state[i] + '}}, P_{\\text{' + end_state[i] + '}}$'
axs[i].text(1.5, 0.75, label, fontsize=10, ha='center', va='center')
# Heat transfer annotations (only on isothermal steps)
if i == 0: # A→B: system absorbs heat from hot reservoir
axs[i].annotate("heat in", (0.5, 0.75), textcoords="offset points", xytext=(0, -60), ha='center', va='center', fontsize=10, color='r', arrowprops=dict(facecolor='r', shrink=0.05, edgecolor='w', width=2, headwidth=8, headlength=8))
if i == 2: # C→D: system releases heat to cold reservoir
axs[i].annotate("heat out", (0.5, -1.5), textcoords="offset points", xytext=(0, 60), ha='center', va='center', fontsize=10, color='r', arrowprops=dict(facecolor='r', shrink=0.05, edgecolor='w', width=2, headwidth=8, headlength=8))
# Work annotations (only on the two most illustrative steps)
if i == 0: # A→B: expansion, system does work
axs[i].annotate("work done by system", (1.5, piston_height[i] - 0.1), textcoords="offset points", xytext=(0, -30), ha='center', va='center', fontsize=10, color='b', arrowprops=dict(facecolor='b', shrink=0.05, edgecolor='w', width=2, headwidth=8, headlength=8))
if i == 2: # C→D: compression, surroundings do work
axs[i].annotate("work done on system", (1.5, piston_height[i] - 1.5), textcoords="offset points", xytext=(0, 30), ha='center', va='center', fontsize=10, color='b', arrowprops=dict(facecolor='b', shrink=0.05, edgecolor='w', width=2, headwidth=8, headlength=8))
# Axis settings
axs[i].set_ylim(-3, 6)
plt.show()
Schematic of the four Carnot-cycle steps. Each panel shows the thermal contact during that step and the piston position at its endpoint. Heat exchange occurs only during the isothermal steps (Steps 1 and 3); the adiabatic steps (Steps 2 and 4) are insulated.
Maximum Efficiency of Converting Heat to Work (Carnot Efficiency)¶
We define the heat quantities on the two isothermal legs from the system’s perspective, following the course sign convention ( when heat is absorbed by the system):
: heat absorbed by the system from the hot reservoir during step
: heat released by the system to the cold reservoir during step
For one complete cycle, (state function returns to its initial value), so the First Law gives
where is the total work over the cycle in the course convention ( when work is done on the system). Since the engine does net work on the surroundings, , and the net work output is
The thermal efficiency is defined as the fraction of absorbed heat converted to useful work output:
Now use the entropy definition on the isotherms:
Because the full reversible cycle returns the system to its initial state,
Substitute and into the efficiency:
Interpretation: the maximum possible fraction of hot-reservoir heat that can be converted to work depends only on the two reservoir temperatures. Lowering or raising increases the maximum possible efficiency.
Why is the Carnot engine the best possible?
The derivation above assumed a fully reversible cycle. Any real engine involves irreversibilities (friction, finite-rate heat transfer, turbulence), which produce entropy and reduce the work output for a given heat input. The Carnot cycle, being reversible, has no such losses. One can show using the Clausius inequality (Section 4.3) that any engine operating between the same two reservoirs must satisfy .
The Second Law: Entropy and the Direction of Heat Flow¶
We can use the fundamental relation from Section 4.1 to derive the direction of spontaneous heat flow. Consider a simple composite system:
Two subsystems and are inside an insulating boundary (no heat exchange with the surroundings).
Each subsystem has fixed volume (so ).
and can exchange heat with each other through an internal wall.
Because the composite is isolated,
Entropy is extensive, so the total entropy is
At fixed volume, the fundamental relation reduces to . Therefore
So the total entropy change is
Second-law statement for an isolated system: spontaneous change requires , with equality for a reversible (equilibrium) exchange.
Now suppose ( is hotter than ). Then . To satisfy , we must have , meaning subsystem loses internal energy while gains it.
That is exactly the familiar conclusion:
Heat flows spontaneously from hot to cold.
Attempting to make heat flow from cold to hot without any other change would make for the isolated composite system, which violates the second law.
Notice that this argument also tells us when the process stops: equilibrium () is reached when , at which point the factor vanishes regardless of . We will develop this point further in Section 4.3 when we discuss the approach to equilibrium.
Worked Example¶
Carnot efficiency and reversible entropy bookkeeping¶
An ideal Carnot engine operates between and . Suppose the system absorbs from the hot reservoir during the isothermal expansion step.
Maximum efficiency
So of the absorbed heat is converted to net work output:
In the course sign convention ( = work done on the system), the engine does work on the surroundings, so
Heat rejected
Energy conservation over the cycle () gives :
The negative sign confirms that the system releases 600 J to the cold reservoir, as expected.
Entropy changes of the reservoirs
Each reservoir exchanges heat reversibly at its own fixed temperature. From the reservoir’s perspective, the heat it receives is opposite in sign to what the system exchanges (the system’s gain is the reservoir’s loss):
The hot reservoir loses entropy (it gave up heat); the cold reservoir gains entropy (it absorbed heat).
Result. , and the engine itself returns to its initial state (), so . This is the hallmark of a fully reversible process. Any real (irreversible) engine would produce , meaning less work output for the same heat input.
Concept Checks¶
Why are adiabatic steps isentropic only in the reversible case?
What feature of the Carnot cycle makes it “best possible” compared to real engines?
If is lowered while is fixed, how does change and why?
In the two-body heat-flow argument, what happens to as ? What does this tell you about equilibrium?
A real engine operating between and absorbs 1000 J of heat and produces 350 J of work output. Compute for the reservoirs and verify that .
Key Takeaways¶
A Carnot engine is fully reversible and therefore sets the maximum possible efficiency between two temperatures.
Reversible isotherms exchange heat at fixed ; reversible adiabats exchange no heat and keep constant (isentropic).
The Carnot efficiency depends only on reservoir temperatures: .
The entropy bookkeeping rule applied to a cycle yields the efficiency formula directly.
Second-law reasoning ( for an isolated system) implies that spontaneous heat flow goes from hot to cold, and that thermal equilibrium corresponds to .