Class deriv_thermo_base_tl (o2scl)

O2scl : Class List

template<class fp_t = double>
class deriv_thermo_base_tl

Base quantities for thermodynamic derivatives.

The quantities \( c_P \) computed by heat_cap_ppart_const_press(), \( c_V \) computed by heat_cap_ppart_const_vol(), \( \beta_T \) computed by compress_const_tptr(), \( \beta_S \) computed by compress_adiabatic(), and \( \alpha_V \) computed by coeff_thermal_exp are related by

\[ c_P - c_V = \frac{T \alpha_V^2}{n \beta_T} \]
and
\[ \beta_T - \beta_S = \frac{T \alpha_V^2}{n c_P} \]

For the derivatives below, the following Jacobian is useful

\[\begin{split}\begin{eqnarray*} \frac{\partial (P,S,N)}{\partial (V,\mu,T)} &=& -n \left[ \left(\frac{\partial S}{\partial V}\right)_{\mu,T} \left(\frac{\partial N}{\partial T}\right)_{\mu,V} - \left(\frac{\partial S}{\partial T}\right)_{\mu,V} \left(\frac{\partial N}{\partial V}\right)_{\mu,T} \right] + s \left[ \left(\frac{\partial S}{\partial V}\right)_{\mu,T} \left(\frac{\partial N}{\partial \mu}\right)_{V,T} - \left(\frac{\partial S}{\partial \mu}\right)_{V,T} \left(\frac{\partial N}{\partial V}\right)_{\mu,T} \right] \nonumber \\ &=& - V n \left[ s \left(\frac{\partial n}{\partial T}\right)_{\mu} - n \left(\frac{\partial s}{\partial T}\right)_{\mu} \right] + V s \left[ s \left(\frac{\partial n}{\partial \mu}\right)_{T} - n \left(\frac{\partial n}{\partial T}\right)_{T} \right] = V n^2 \left(\frac{\partial s}{\partial T}\right)_{\mu} - 2 V n s \left(\frac{\partial n}{\partial T}\right)_{\mu} + V s^2 \left(\frac{\partial n}{\partial \mu}\right)_{T} \end{eqnarray*}\end{split}\]
For convenience, we define the quantity
\[ X \equiv \frac{1}{V} \left[ \frac{\partial (P,S,N)}{\partial (V,\mu,T)} \right] \]
Another common combination of derivatives is
\[ Y \equiv \left(\frac{\partial n}{\partial T}\right)_{\mu}^2 - \left(\frac{\partial s}{\partial T}\right)_{\mu} \left(\frac{\partial n}{\partial \mu}\right)_{T} \]

Subclassed by o2scl::fermion_deriv_thermo_tl< fermion_deriv_tl< double >, double >, o2scl::classical_deriv_thermo_tl< fp_t >, o2scl::fermion_deriv_thermo_tl< fermion_deriv_t, fp_t >

Public Functions

template<class part_deriv_t>
inline fp_t heat_cap_ppart_const_vol(part_deriv_t &p, fp_t temper)

The heat capacity per particle at constant volume (unitless)

This function returns

\[ c_V = \frac{T}{N} \left(\frac{\partial S}{\partial T}\right)_{V,N} = \frac{T}{n} \left(\frac{\partial s}{\partial T}\right)_{V,n} = \frac{1}{N} \left(\frac{\partial E}{\partial T}\right)_{V,N} \]

To write this in terms of the three derivatives in o2scl::part_deriv_press_tl,

\[ \frac{T}{n} \left(\frac{\partial s}{\partial T}\right)_{V,n} = \frac{T}{n} \frac{\partial(s,n,V)}{\partial(T,n,V)} = \frac{T}{n} \left[\frac{\partial(s,n,V)}{\partial(T,\mu,V)}\right] \left[\frac{\partial(T,n,V)}{\partial(T,\mu,V)}\right]^{-1} \]
\[ = \frac{T}{n} \left[ \left(\frac{\partial s}{\partial T}\right)_{\mu} - \left(\frac{\partial n}{\partial T}\right)_{\mu}^2 \left(\frac{\partial n}{\partial \mu}\right)_{T}^{-1} \right] \]

This is \( 3/2 \) for an ideal gas.

template<class part_deriv_t>
inline fp_t heat_cap_ppart_const_press(part_deriv_t &p, fp_t temper)

The heat capacity per particle at constant pressure (unitless)

This function returns

\[ c_P = \frac{T}{N} \left(\frac{\partial S}{\partial T}\right)_{P,N} = \frac{1}{N} \left(\frac{\partial H}{\partial T}\right)_{P,N} \]

To write this in terms of the three derivatives in o2scl::part_deriv_press_tl,

\[ \frac{T}{N} \left(\frac{\partial S}{\partial T}\right)_{P,N} = \frac{T}{N} \frac{\partial(S,N,P)}{\partial(T,N,P)} = \frac{T}{N} \left[\frac{\partial(S,N,P)}{\partial(T,\mu,V)}\right] \left[\frac{\partial(T,N,P)}{\partial(T,\mu,V)}\right]^{-1} \]
The first Jacobian was computed above since
\[ \frac{\partial(S,N,P)}{\partial(T,\mu,V)} = - \frac{\partial(P,S,N)}{\partial(V,\mu,T)} \]
The second is
\[ \frac{\partial(T,N,P)}{\partial(T,\mu,V)} = \left[ \left(\frac{\partial N}{\partial \mu}\right)_{T,V} \left(\frac{\partial P}{\partial V}\right)_{\mu,T} - \left(\frac{\partial N}{\partial V}\right)_{\mu,T} \left(\frac{\partial P}{\partial \mu}\right)_{T,V} \right] = - n^2 \]
The final result is
\[ c_P = \frac{T X}{n^3} = \frac{T}{n} \left(\frac{\partial s}{\partial T}\right)_{\mu} + \frac{s^2 T}{n^3} \left(\frac{\partial n}{\partial \mu}\right)_{T} - \frac{2 s T}{n^2} \left(\frac{\partial n}{\partial T}\right)_{\mu} \]

This is \( 5/2 \) for an ideal gas.

template<class part_deriv_t>
inline fp_t compress_adiabatic(part_deriv_t &p, fp_t temper)

The adiabatic compressibility.

This function computes

\[ \beta_S \equiv - \frac{1}{V} \left(\frac{\partial V}{\partial P}\right)_{S,N} \]
(sometimes referred to as \( \kappa_S \) or \( \chi_S \))

To write this in terms of the three derivatives in o2scl::part_deriv_press_tl,

\[ \left(\frac{\partial V}{\partial P}\right)_{S,N} = \frac{\partial (V,S,N)}{\partial (P,S,N)} = \frac{\partial (V,S,N)}{\partial (V,\mu,T)} \left[ \frac{\partial (P,S,N)}{\partial (V,\mu,T)}\right]^{-1} \]
The first Jacobian
\[ \frac{\partial (V,S,N)}{\partial (V,\mu,T)} = V^2 \left[ \left(\frac{\partial s}{\partial T}\right)_{\mu,V} \left(\frac{\partial n}{\partial \mu}\right)_{T,V} - \left(\frac{\partial n}{\partial T}\right)_{\mu,V}^2 \right] \]
and the second Jacobian was computed above. The result is
\[ \beta_S = Y/X = \left[ \left(\frac{\partial n}{\partial T}\right)_{\mu}^2 - \left(\frac{\partial s}{\partial T}\right)_{\mu} \left(\frac{\partial n}{\partial \mu}\right)_{T} \right] \left[ n^2 \left(\frac{\partial s}{\partial T}\right)_{\mu,V} - 2 n s \left(\frac{\partial n}{\partial T}\right)_{\mu,V} + s^2 \left(\frac{\partial n}{\partial \mu}\right)_{T,V} \right]^{-1} \]

template<class part_deriv_t>
inline fp_t compress_const_tptr(part_deriv_t &p, fp_t temper)

The isothermal compressibility.

This function computes

\[ \beta_T \equiv - \frac{1}{V} \left(\frac{\partial V}{\partial P}\right)_{T,N} \]
(sometimes referred to as \( \kappa_T \) or \( \chi_T \)) in units of inverse length to the fourth power.

To write this in terms of the three derivatives in o2scl::part_deriv_press_tl,

\[\begin{split}\begin{eqnarray*} - \frac{1}{V} \left(\frac{\partial V}{\partial P}\right)_{T,N} &=& \frac{\partial (V,T,N)}{\partial (P,T,N)} = \frac{1}{V} \frac{\partial (V,T,N)}{\partial (V,T,\mu)} \left[\frac{\partial (N,P,T)}{\partial (V,\mu,T)}\right]^{-1} \nonumber \\ &=& \left(\frac{\partial n}{\partial \mu}\right)_{T,V} \left[ \left(\frac{\partial N}{\partial V}\right)_{\mu,T} \left(\frac{\partial P}{\partial \mu}\right)_{V,T} - \left(\frac{\partial P}{\partial V}\right)_{\mu,T} \left(\frac{\partial N}{\partial \mu}\right)_{V,T} \right]^{-1} = \frac{1}{n^2} \left(\frac{\partial n}{\partial \mu}\right)_{T} \end{eqnarray*}\end{split}\]

template<class part_deriv_t>
inline fp_t coeff_thermal_exp(part_deriv_t &p, fp_t temper)

The coefficient of thermal expansion.

This function computes

\[ \alpha_V = \frac{1}{V} \left(\frac{\partial V}{\partial T}\right)_{P,N} \]
in units of length.

To write this in terms of the three derivatives in o2scl::part_deriv_press_tl,

\[\begin{split}\begin{eqnarray*} \left(\frac{\partial V}{\partial T}\right)_{P,N} &=& \frac{\partial (V,P,N)}{\partial (T,P,N)} = -\frac{\partial (V,P,N)}{\partial (V,T,\mu)} \left[ \frac{\partial (T,P,N)}{\partial (T,V,\mu)} \right]^{-1} \nonumber \\ & = & - \left[ \left(\frac{\partial P}{\partial T}\right)_{\mu,V} \left(\frac{\partial N}{\partial \mu}\right)_{T,V} - \left(\frac{\partial N}{\partial T}\right)_{\mu,V} \left(\frac{\partial P}{\partial \mu}\right)_{T,V} \right] \left[ \left(\frac{\partial P}{\partial V}\right)_{\mu,T} \left(\frac{\partial N}{\partial \mu}\right)_{V,T} - \left(\frac{\partial P}{\partial \mu}\right)_{V,T} \left(\frac{\partial N}{\partial V}\right)_{\mu,T} \right]^{-1} \nonumber \\ &=& \frac{s}{n^2} \left(\frac{\partial n}{\partial \mu}\right)_{T} - \frac{1}{n} \left(\frac{\partial n}{\partial T}\right)_{\mu} \end{eqnarray*}\end{split}\]

template<class part_deriv_t>
inline fp_t squared_sound_speed(part_deriv_t &p, fp_t temper)

The squared sound speed (unitless)

This function computes the squared sound speed (including relativistic effects)

\[ c_s^2 = \left(\frac{\partial P} {\partial \varepsilon}\right)_{S,N} \]
The result is unitless. To get the units of a squared velocity, one must multiply by \( c^2 \) .

The nonrelativistic squared sound speed is

\[ c_{s,\mathrm{NR}}^2 = \left[\frac{\partial P} {\partial (N/V)}\right]_{S,N} = - \frac{V^2}{N} \left(\frac{\partial P} {\partial V}\right)_{S,N} = \frac{1}{n \beta_S} \]
where \( \beta_S \) is computed in compress_adiabatic() .

To write \( c_s^2 \) in terms of the three derivatives in o2scl::part_deriv_press_tl,

\[ \left(\frac{\partial P} {\partial \varepsilon}\right)_{S,N} = \frac{\partial (P,S,N)}{\partial (\varepsilon,S,N)} = \frac{\partial (P,S,N)}{\partial (V,T,\mu)} \left[ \frac{\partial (\varepsilon,S,N)} {\partial (V,T,\mu)} \right]^{-1} \]
The first Jacobian was computed above (up to a sign). The second is the determinant of
\[\begin{split} \left( \begin{array}{ccc} 0 & \frac{\partial \varepsilon}{\partial T} & \frac{\partial \varepsilon}{\partial \mu} \\ s & V \frac{\partial s}{\partial T} & V \frac{\partial n}{\partial T} \\ n & V \frac{\partial n}{\partial T} & V \frac{\partial n}{\partial \mu} \end{array} \right) \end{split}\]
with
\[ \frac{\partial \varepsilon}{\partial T} = -T \frac{\partial s}{\partial T} + \mu \frac{\partial n}{\partial T} \quad \mathrm{and} \quad \frac{\partial \varepsilon}{\partial \mu} = T \frac{\partial n}{\partial T} + \mu \frac{\partial n}{\partial \mu} \]
giving
\[ \frac{\partial (\varepsilon,S,N)} {\partial (V,T,\mu)} = V (P + \varepsilon) \left[ \left(\frac{\partial n}{\partial T}\right)^2 - \left(\frac{\partial n}{\partial \mu}\right) \left(\frac{\partial s}{\partial T}\right) \right] = V Y \left(P+\varepsilon\right) \]
The final result is
\[ c_s^2 = - \frac{X}{(P+\varepsilon)Y} = \frac{ n^2 \left(\frac{\partial s}{\partial T}\right) - 2 n s \left(\frac{\partial n}{\partial T}\right) + s^2 \left(\frac{\partial n}{\partial \mu}\right) }{ \left(P + \varepsilon\right) \left[ \left(\frac{\partial n}{\partial \mu}\right) \left(\frac{\partial s}{\partial T}\right) - \left(\frac{\partial n}{\partial T}\right)^2 \right] } \]