Calculus of Thermodynamics¶
ChE 621 — Thermodynamics.
The fundamental property equation¶
The motivation for studying the calculus of thermodynamic functions is to calculate the state variables appearing in the first and second laws using experimentally measurable primitive properties such as \(P, V\), and \(T\). For example,
There is no prescription in the first and second laws on the other derivatives.
Entropy representation¶
where \(x = V\), and so on. Substituting the reversible form of the first law,
The bracketed group is zero, which gives
and therefore
Integration of this equation gives \(S\left(U, x\right)\). This is therefore called the entropy representation of the states of the system.
Energy representation¶
Alternatively, the energy representation, \(U\left(S, V, N\right)\), for a system with \(N\) species, characterized by extensive variables \(V\) and \(S\):
Term by term,
Example: entropy representation for a monatomic ideal gas¶
The entropy representation of the fundamental equation for a monatomic ideal gas is
Per mole,
Solving for \(\tilde{U}\):
\(U\left(S, V, N\right)\) has complete information about the ideal gas. For example, differentiate with respect to \(S\) to get \(T\):
That is, \(U\left(S, V, N\right)\) contains information about the heat capacity.
Similarly, differentiate with respect to \(V\) to get \(P\):
That is, \(U\left(S, V, N\right)\) contains the ideal gas law. On the other hand, the \(P\)-\(V\)-\(T\) equation of state is incomplete: it does not have \(C_{V}\) data. The \(U\)-\(V\)-\(T\) equation of state is also incomplete: it does not have the \(P\)-\(V\)-\(T\) relationship.
\(U\left(S, V, N\right)\) is inconvenient to use, because its independent variable \(S\) is not directly measurable.
Are there other energy functions like \(U\left(S, V, N\right)\), that is, other equilibrium state representations or auxiliary functions, with the same information content but with more useful independent variables such as \(T\) and \(V\), or \(T\) and \(P\)?
How do we transform \(U\left(S, V, N\right)\) into these functions? What are the fundamental differential property relations analogous to \(\mathrm{d}U = T\mathrm{d}S - P\mathrm{d}V + \sum μ_{i} \mathrm{d}N_{i}\)?
Legendre transform¶
For a basis function \(y^{\left(0\right)} = f\left(x\right)\), the slope is
Matching \(y^{\left(0\right)}\left(x\right)\) and \(g\left(x\right)\) at \(x = x_{\mathrm{a}}\) (Figure 1),
so that
Now vary \(x_{\mathrm{a}}\). We get a collection of points \(\left(ξ, y^{\left(1\right)}\right)\) that defines the Legendre transform of \(y^{\left(0\right)}\left(x\right)\):
The transform carries the pair \(\left[x, f\left(x\right) = y^{\left(0\right)}\left(x\right)\right]\) into the pair \(\left[ξ, y^{\left(1\right)}\right]\): \(\left(x, y^{\left(0\right)}\right) \to \left(ξ, y^{\left(1\right)}\right)\).
Figure 1 The Legendre transform as a tangent-line construction. The vertical axis is \(y\) and the horizontal axis is \(x\). A concave curve, rising steeply at the left and flattening towards the right, is the basis function \(y^{\left(0\right)} = f\left(x\right)\), labelled just below and to the right of the curve near its left end. A straight line touches it at a single point, marked with a dot, above the position \(x_{\mathrm{a}}\) on the horizontal axis. A dashed vertical guide joins the two. Because the curve bends downward, the straight line lies above it everywhere except at that point. The line is the tangent \(g = ξ \cdot x + y^{\left(1\right)}\). Its slope \(ξ\) is labelled just above it, to the left of the point of contact, and its equation is written above that, towards the point of contact. Continued as a dashed line to the left, the tangent meets the vertical axis above the origin at a second dot, which is the intercept \(y^{\left(1\right)}\), labelled to the left of the axis. The intercept is therefore positive.¶
Worked example: the exponential function¶
Figure 2 The basis function \(e^{x}\). A plot of \(e^{x}\) against \(x\), with \(x\) running from −2 to 2 and the vertical axis from 0 to 8, labelled every 2 units with an unlabelled minor tick at every unit between. The curve is close to zero at the left of the range, passes through 1 at \(x = 0\), and rises steeply to about 7.4 at \(x = 2\).¶
Figure 3 Its Legendre transform. A plot of \(ξ - ξ \ln ξ\) against \(ξ\), with \(ξ\) running from 0 to 8 and the vertical axis from −8 to 1, labelled every 2 units from −8 to 0 with an unlabelled minor tick at every unit between and at 1. The curve starts at zero, rises to a maximum of 1 at \(ξ = 1\), crosses zero again near \(ξ = e\), and then falls away, reaching about −7.6 at \(ξ = 7.5\).¶
Classical mechanics, with a different sign convention¶
Lagrangian \(\mathcal{L}\), where \(\dot{q}\) is the velocity:
Hamiltonian \(\mathcal{H}\):
Two variables¶
In two dimensions there will be two variables:
First Legendre transform:
Second Legendre transform:
Many variables¶
The \(k\)-th Legendre transform:
Differentiating,
This shows \(y^{\left(k\right)}\) is a function of \(ξ_{1}, ξ_{2}, \dots, ξ_{k}, x_{k+1}, \dots, x_{m}\).
Application to thermodynamics¶
Take the basis function to be the internal energy, whose \(N + 2\) arguments are numbered \(x_{1}\) through \(x_{N+2}\):
\(i\) |
\(x_{i}\) |
\(ξ_{i}\) |
|---|---|---|
1 |
\(S\) |
\(T\) |
2 |
\(V\) |
\(- P\) |
3 |
\(n_{1}\) |
\(μ_{1}\) |
\(\vdots\) |
\(\vdots\) |
\(\vdots\) |
\(N + 2\) |
\(n_{N}\) |
\(μ_{N}\) |
Transforming on row 2 leaves \(S, - P\) and the mole numbers, which are the independent variables of the enthalpy:
Transforming on row 1 leaves \(T, V\) and the mole numbers, which are those of the Helmholtz energy:
Transforming on the first two rows leaves \(T, - P\) and the mole numbers, which are the independent variables of the Gibbs energy:
The corresponding differential relations are
Total Legendre transform and the Gibbs-Duhem equation¶
Applying Euler’s theorem for \(U = U\left(S, V, n_{i}\right)\) we get
Therefore \(y^{\left(N+2\right)} = 0\), so \(\mathrm{d}y^{\left(N+2\right)} = 0\), or
Euler’s theorem for homogeneous functions¶
Consider \(y = f\left(x\right)\). The two statements
are equivalent: each implies the other. We call \(f\left(x\right)\) a homogeneous function of order \(h\).
Proof:
First direction, that Equation (2) implies Equation (1). From Equation (2), \(kx \cdot f' \left(kx\right) = h \cdot f\left(kx\right)\). Let \(g\left(k\right) = f\left(kx\right)\). Then
This is Equation (1): \(f\left(kx\right) = f\left(x\right) \cdot k^{h}\).
Second direction, that Equation (1) implies Equation (2). Take the derivative with respect to \(k\) for Equation (1):
The two sides give
so that \(x \cdot f'\left(kx\right) = h \cdot k^{h-1} \cdot f\left(x\right)\). Let \(k = 1\): then \(x \cdot f' \left(x\right) = h \cdot f\left(x\right)\), which is Equation (2).
One can also show
The internal energy \(U = U\left(S, V, n_{1}, n_{2}, \dots, n_{N}\right)\) is a homogeneous function of order 1, that is,
Therefore
or
so that
Likewise, for the Gibbs energy,
Extensive versus intensive properties¶
The extensive properties are \(U, S, V, N\) and \(H, A, G\). The intensive variables come in two kinds:
field variables: \(T, P, μ_{i}\);
density variables: \(\tilde{V} = \frac{V}{N}\) and \(\tilde{U} = \frac{U}{N}\).
Both \(\left(\frac{\partial U}{\partial N}\right)_{S,\, V}\) and \(\left(\frac{\partial \tilde{U}}{\partial N}\right)_{S,\, V}\) are non-zero, whereas
which follows from \(\tilde{U}\left(\tilde{S}, \tilde{V}, kN\right) = k^{0} \tilde{U}\left(\tilde{S}, \tilde{V}, N\right)\) and
Hence
Maxwell relations¶
For \(f\left(x_{1}, x_{2}\right)\):
Fundamental relation |
Maxwell relation |
|---|---|
\(\mathrm{d}U = T\mathrm{d}S - P\mathrm{d}V\) |
\(\left(\frac{\partial T}{\partial V}\right)_{S} = - \left(\frac{\partial P}{\partial S}\right)_{V}\) |
\(\mathrm{d}H = T\mathrm{d}S + V\mathrm{d}P\) |
\(\left(\frac{\partial T}{\partial P}\right)_{S} = \left(\frac{\partial V}{\partial S}\right)_{P}\) |
\(\mathrm{d}A = - S\mathrm{d}T - P\mathrm{d}V\) |
\(\left(\frac{\partial S}{\partial V}\right)_{T} = \left(\frac{\partial P}{\partial T}\right)_{V}\) |
\(\mathrm{d}G = - S\mathrm{d}T + V\mathrm{d}P\) |
\(- \left(\frac{\partial S}{\partial P}\right)_{T} = \left(\frac{\partial V}{\partial T}\right)_{P}\) |
The last two relations are particularly useful (e.g., used repeatedly in the examples below) because the awkard derivatives on the left-hand side involving entropy are converted to derivatives based on the \(pVT\) relationship.
Tools for transforming derivatives¶
The Maxwell relations above.
Chain rule:
\[\left(\frac{\partial F}{\partial y}\right)_{x} = \left(\frac{\partial F}{\partial φ}\right)_{x} \cdot \left(\frac{\partial φ}{\partial y}\right)_{x}\]Cyclic rule, or triple product:
\[\left(\frac{\partial y}{\partial x}\right)_{z} \cdot \left(\frac{\partial x}{\partial z}\right)_{y} \cdot \left(\frac{\partial z}{\partial y}\right)_{x} = - 1\]Derivative inversion:
\[\left(\frac{\partial F}{\partial y}\right)_{x} = \left(\frac{\partial y}{\partial F}\right)_{x}^{- 1}\]Euler integration:
\[U = U\left(S, V, N\right) = S \cdot \frac{\partial U}{\partial S} + V \cdot \frac{\partial U}{\partial V} + N \cdot \frac{\partial U}{\partial N}\]\[G = G\left(T, P, N\right) = N \cdot \frac{\partial G}{\partial N} = N \cdot μ\]Manipulate the total derivative for \(F\left(x, y\right)\):
\[\mathrm{d}F = \left(\frac{\partial F}{\partial x}\right)_{y} \mathrm{d}x + \left(\frac{\partial F}{\partial y}\right)_{x} \mathrm{d}y\]
Examples¶
Example: enthalpy as a function of temperature and pressure, \(\tilde{H} = f\left(T, P\right)\)¶
The second coefficient is the derivative that has to be found. The fully specified differential form can be used to calculate \(\Delta H\) (Figure 4).
Figure 4 The two-step path used for the enthalpy example. The vertical axis is \(P\) and the horizontal axis is \(T\). Three states are marked with dots. From \(\left(T_{1}, P_{1}\right)\) at the upper left, an arrow points straight down to \(\left(T_{1}, P_{2}\right)\), a change of pressure at constant temperature. From there an arrow points straight right to \(\left(T_{2}, P_{2}\right)\), a change of temperature at constant pressure.¶
From \(\mathrm{d}H = T \mathrm{d}S + V \mathrm{d}P\),
using the Maxwell relation based on the Gibbs energy expression. Hence
For ideal gases, \(P\tilde{V} = RT\), so \(\tilde{V} = \frac{RT}{P}\) and \(\left(\frac{\partial \tilde{V}}{\partial T}\right)_{P} = \frac{R}{P}\). Then
leaving
For solids and liquids, define the isobaric thermal expansion coefficient
so that
Example: entropy as a function of temperature and pressure, \(\tilde{S} = f\left(T, P\right)\)¶
The fundamental equation \(\mathrm{d}\tilde{S} = \frac{\mathrm{d}\tilde{U}}{T} + \frac{P}{T} \mathrm{d}\tilde{V}\) has different independent variables. We need
with \(\left(\frac{\partial \tilde{S}}{\partial P}\right)_{T} = - \left(\frac{\partial \tilde{V}}{\partial T}\right)_{P}\). At constant pressure the second term of the enthalpy relation drops out,
and
so that
One can also express \(\left(\frac{\partial \tilde{V}}{\partial T}\right)_{P} = β\tilde{V}\).
For ideal gases, \(P\tilde{V} = RT\) gives \(\tilde{V} = \frac{RT}{P}\), so
Example: internal energy as a function of temperature and molar volume, \(\tilde{U} = f\left(T, \tilde{V}\right)\)¶
From \(\mathrm{d}\tilde{U} = T \mathrm{d}\tilde{S} - P \mathrm{d}\tilde{V}\), and the Maxwell relation based on the Helmholtz energy expression,
so that
For ideal gases, \(P\tilde{V} = RT\) and \(\frac{\partial P}{\partial T} = \frac{R}{\tilde{V}}\), so
leaving
For a van der Waals fluid, with \(a\) and \(b\) constant,
so
Example: working fluid in a turbine¶
Figure 5 Working fluid in a turbine. The turbine is drawn as a quadrilateral, narrow at the inlet on the left and wider at the outlet on the right. An arrow enters from the left carrying the feed, labelled \(P_{1}, T_{1}\) beneath it near its tail. An arrow leaves to the right at the same height, carrying the discharge, labelled \(P_{2}, T_{2}\) beneath it near its head, so the two labels are level. A third arrow points downward out of the bottom of the body, carrying the shaft power \(\dot{W}\).¶
Figure 5: Given \(ΔP\), the larger the \(ΔT\), the better. The figure of merit is therefore
The Maxwell relation based on the enthalpy expression gives \(\left(\frac{\partial T}{\partial P}\right)_{\tilde{S}} = \left(\frac{\partial \tilde{V}}{\partial \tilde{S}}\right)_{P}\), which does not seem to be very useful.
Apply the cyclic rule instead and use derivative inversion and another Maxwell relation based on the Gibbs energy expression:
At constant pressure the last term of the enthalpy relation drops out again,
so that \(\tilde{C}_{P} = T\left(\frac{\partial \tilde{S}}{\partial T}\right)_{P}\), which is the reciprocal of the last factor above. Therefore
For ideal gases,
Example: the Joule-Thomson coefficient¶
Cooling by expansion (Figure 6).
Figure 6 The throttle of the Joule-Thomson example. A horizontal pipe is interrupted at its midpoint by a valve, drawn as two triangles meeting point to point. A knob, the top third of a circle, sits above the valve on a vertical stem that comes down to the point where the triangles meet. The upstream side, to the left, is at \(P_{1}, T_{1}\) and the downstream side, to the right, is at \(P_{2}, T_{2}\).¶
Previously we showed \(ΔH = 0\), an isenthalpic expansion. Given \(P_{1}\) and \(P_{2}\), how much does it cool?
Apply the cyclic rule:
From \(\mathrm{d}\tilde{H} = T \mathrm{d}\tilde{S} + \tilde{V} \mathrm{d}P\),
again using the Maxwell relation based on the Gibbs energy expression. Hence
For ideal gases, \(P\tilde{V} = RT\) and \(\frac{\partial \tilde{V}}{\partial T} = \frac{R}{P}\), so
Example: is the difference of the heat capacities (\(\tilde{C}_{P} - \tilde{C}_{V}\)) always \(R\)?¶
Expanding the entropy in \(T\) and \(\tilde{V}\),
so that, for any material,
For ideal gases, \(\tilde{C}_{P} - \tilde{C}_{V} = R\).
For solids and liquids, we often use the isobaric thermal expansion coefficient and the isothermal compressibility:
If incompressible, \(β = κ = 0\) and
Example: constructing the molar entropy of a monatomic gas¶
Construct \(\tilde{S}\left(\tilde{U}, \tilde{V}\right)\) for a monatomic gas using \(P\tilde{V} = RT\) and \(\tilde{C}_{V} = \frac{3}{2}R\).
the second line following from \(\mathrm{d}\tilde{U} = T \mathrm{d}\tilde{S} - P \mathrm{d}\tilde{V}\). To integrate, we need to express \(T\) and \(\frac{P}{T}\) as a function of \(\tilde{U}\) and \(\tilde{V}\):
Then
or
Example: constructing the molar Gibbs energy of an arbitrary material¶
Construct \(\tilde{G}\left(T, P\right)\) for an arbitrary material using \(β\) and \(κ\), and \(\tilde{C}_{P}\).
First note that, by Euler integration,
so that \(\frac{G}{n} = μ = \tilde{G}\), and
To integrate, we need to express \(\tilde{S}\) and \(\tilde{V}\) as a function of \(T\) and \(P\). Previously,
and likewise
Now we integrate \(μ\), or \(\tilde{G}\), along the path depicted in Figure 7.
Figure 7 The integration path from the reference state. The vertical axis is \(P\) and the horizontal axis is \(T\). Dashed guide lines mark \(P_{0}\) and \(P'\) on the vertical axis and \(T_{0}\) and \(T'\) on the horizontal axis, closing a rectangle between the reference corner and the target corner. Three states are marked with dots. The heavy path runs from the reference state at \(\left(T_{0}, P_{0}\right)\), labelled “ref”, horizontally right along the constant pressure \(P_{0}\) to \(\left(T', P_{0}\right)\), and then vertically up along the constant temperature \(T'\) to \(\left(T', P' \right)\). The first leg therefore contributes the temperature integral at the reference pressure, and the second the pressure integral at the final temperature.¶
The pressure integral in the first bracket is zero because that leg is walked at \(P = P_{0}\). Integrating gives
which is a general expression valid for any material.
For an ideal gas,
so the two inner integrals are
Therefore
Hence, for an ideal gas,
We can therefore write