# Isothermal–isobaric ensemble

The isothermal–isobaric ensemble (constant temperature and constant pressure ensemble) is a statistical mechanical ensemble that maintains constant temperature ${\displaystyle T\,}$ and constant pressure ${\displaystyle P\,}$ applied. It is also called the ${\displaystyle NpT}$-ensemble, where the number of particles ${\displaystyle N\,}$ is also kept as a constant. This ensemble plays an important role in chemistry as chemical reactions are usually carried out under constant pressure condition.[1] The NPT ensemble is also useful for measuring the equation of state of model systems whose virial expansion for pressure cannot be evaluated, or systems near first-order phase transitions.[2]

## Derivation of Key Properties

The partition function for the ${\displaystyle NpT}$ -ensemble can be derived from statistical mechanics by beginning with a system of ${\displaystyle N}$  identical atoms described by a Hamiltonian of the form ${\displaystyle \mathbf {p} ^{2}/2m+U(\mathbf {r} ^{n})}$  and contained within a box of volume ${\displaystyle V=L^{3}}$ . This system is described by the partition function of the canonical ensemble in 3 dimensions:

${\displaystyle Z^{sys}(N,V,T)={\frac {1}{\Lambda ^{3N}N!}}\int _{0}^{L}...\int _{0}^{L}d\mathbf {r} ^{N}\exp(-\beta U(\mathbf {r} ^{N}))}$ ,

where ${\displaystyle \Lambda ={\sqrt {h^{2}\beta /(2\pi m)}}}$ , the thermal de Broglie wavelength (${\displaystyle \beta =1/k_{B}T\,}$  and ${\displaystyle k_{B}\,}$  is the Boltzmann constant), and the factor ${\displaystyle 1/N!}$  (which accounts for indistinguishability of particles) both ensure normalization of entropy in the quasi-classical limit.[2] It is convenient to adopt a new set of coordinates defined by ${\displaystyle \mathbf {s} _{i}=L\mathbf {r} _{i}}$  such that the partition function becomes

${\displaystyle Z^{sys}(N,V,T)={\frac {V^{N}}{\Lambda ^{3N}N!}}\int _{0}^{1}...\int _{0}^{1}d\mathbf {s} ^{N}\exp(-\beta U(\mathbf {s} ^{N}))}$ .

If this system is then brought into contact with a bath of volume ${\displaystyle V_{0}}$  at constant temperature and pressure containing an ideal gas with total particle number ${\displaystyle M}$  such that ${\displaystyle M-N\gg N}$ , the partition function of the whole system is simply the product of the partition functions of the subsystems:

${\displaystyle Z^{sys+bath}(N,V,T)={\frac {V^{N}(V_{0}-V)^{M-N}}{\Lambda ^{3M}N!(M-N)!}}\int d\mathbf {s} ^{M-N}\int d\mathbf {s} ^{N}\exp(-\beta U(\mathbf {s} ^{N}))}$ .

The system (volume ${\displaystyle V}$ ) is immersed in a much larger bath of constant temperature, and closed off such that particle number remains fixed. The system is separated from the bath by a piston that is free to move, such that its volume can can change.

The integral over the ${\displaystyle \mathbf {s} ^{M-N}}$  coordinates is simply ${\displaystyle 1}$ . In the limit that ${\displaystyle V_{0}\rightarrow \infty }$ , ${\displaystyle M\rightarrow \infty }$  while ${\displaystyle (M-N)/V_{0}=\rho }$  stays constant, a change in volume of the system under study will not change the pressure ${\displaystyle p}$  of the whole system. Taking ${\displaystyle V/V_{0}\rightarrow 0}$  allows for the approximation ${\displaystyle (V_{0}-V)^{M-N}=V_{0}^{M-N}(1-V/V_{0})^{M-N}\approx V_{0}^{M-N}\exp(-(M-N)V/V_{0})}$ . For an ideal gas, ${\displaystyle (M-N)/V_{0}=\rho =\beta P}$  gives a relationship between density and pressure. Substituting this into the above expression for the partition function, multiplying by a factor ${\displaystyle \beta P}$  (see below for justification for this step), and integrating over the volume V then gives

${\displaystyle \Delta ^{sys+bath}(N,P,T)={\frac {\beta PV_{0}^{M-N}}{\Lambda ^{3M}N!(M-N)!}}\int dVV^{N}\exp({-\beta PV})\int d\mathbf {s} ^{N}\exp(-\beta U(\mathbf {s} ))}$ .

The partition function for the bath is simply ${\displaystyle \Delta ^{bath}=V_{0}^{M-N}/[(M-N)!\Lambda ^{3(M-N)}}$ . Separating this term out of the overall expression gives the partition function for the ${\displaystyle NpT}$ -ensemble:

${\displaystyle \Delta ^{sys}(N,P,T)={\frac {\beta P}{\Lambda ^{3N}N!}}\int dVV^{N}\exp(-\beta PV)\int d\mathbf {s} ^{N}\exp(-\beta U(\mathbf {s} ))}$ .

Using the above definition of ${\displaystyle Z^{sys}(N,V,T)}$ , the partition function can be rewritten as

${\displaystyle \Delta ^{sys}(N,P,T)=\beta P\int dV\exp(-\beta PV)Z^{sys}(N,V,T)}$ ,

which can be written more generally as a weighted sum over the partition function for the canonical ensemble

${\displaystyle \Delta (N,P,T)=\int Z(N,V,T)\exp(-\beta PV)CdV.\,\;}$

The quantity ${\displaystyle C}$  is simply some constant with units of inverse volume, which is necessary to make the integral dimensionless. In this case, ${\displaystyle C=\beta P}$ , but in general it can take on multiple values. The ambiguity in its choice stems from the fact that volume is not a quantity that can be counted (unlike e.g. the number of particles), and so there is no “natural metric” for the final volume integration performed in the above derivation.[2] This problem has been addressed in multiple ways by various authors,[3][4] leading to values for C with the same units of inverse volume. The differences vanish (i.e. the choice of ${\displaystyle C}$  becomes arbitrary) in the thermodynamic limit, where the number of particles goes to infinity.[5]

The ${\displaystyle NpT}$ -ensemble can also be viewed as a special case of the Gibbs canonical ensemble, in which the macrostates of the system are defined according to external temperature ${\displaystyle T}$  and external forces acting on the system ${\displaystyle \mathbf {J} }$ . Consider such a system containing ${\displaystyle N}$  particles. The Hamiltonian of the system is then given by ${\displaystyle {\mathcal {H}}-\mathbf {J} \cdot \mathbf {x} }$  where ${\displaystyle {\mathcal {H}}}$  is the system's Hamiltonian in the absence of external forces and ${\displaystyle \mathbf {x} }$  are the conjugate variables of ${\displaystyle \mathbf {J} }$ . The microstates ${\displaystyle \mu }$  of the system then occur with probability defined by [6]

${\displaystyle p(\mu ,\mathbf {x} )=\exp[-\beta {\mathcal {H}}(\mu )+\beta \mathbf {J} \cdot \mathbf {x} ]/{\mathcal {Z}}}$

where the normalization factor ${\displaystyle {\mathcal {Z}}}$  is defined by

${\displaystyle {\mathcal {Z}}(N,\mathbf {J} ,T)=\sum _{\mu ,\mathbf {x} }\exp[\beta \mathbf {J} \cdot \mathbf {x} -\beta {\mathcal {H}}(\mu )]}$ .

The ${\displaystyle NpT}$ -ensemble can be found by taking ${\displaystyle \mathbf {J} =-P}$  and ${\displaystyle \mathbf {x} =V}$ . Then the normalization factor becomes

${\displaystyle {\mathcal {Z}}(N,\mathbf {J} ,T)=\sum _{\mu ,\{\mathbf {r} _{i}\}\in V}\exp[-\beta PV-\beta (\mathbf {p} ^{2}/2m+U(\mathbf {r} ^{N}))]}$ ,

where the Hamiltonian has been written in terms of the particle momenta ${\displaystyle \mathbf {p} _{i}}$  and positions ${\displaystyle \mathbf {r} _{i}}$ . This sum can be taken to an integral over both ${\displaystyle V}$  and the microstates ${\displaystyle \mu }$ . The measure for the latter integral is the standard measure of phase space for identical particles: ${\displaystyle {\textrm {d}}\Gamma _{N}={\frac {1}{h^{3}N!}}\prod _{i=1}^{N}d^{3}\mathbf {p} _{i}d^{3}\mathbf {r} _{i}}$ .[6] The integral over ${\displaystyle \exp(-\beta \mathbf {p} ^{2}/2m)}$  term is a Gaussian integral, and can be evaluated explicitly as

${\displaystyle \int \prod _{i=1}^{N}{\frac {d^{3}\mathbf {p} _{i}}{h^{3}}}\exp {\bigg [}-\beta \sum _{i=1}^{N}{\frac {p_{i}^{2}}{2m}}{\bigg ]}={\frac {1}{\Lambda ^{3N}}}}$  .

Inserting this result into ${\displaystyle {\mathcal {Z}}(N,P,T)}$  gives a familiar expression:

${\displaystyle {\mathcal {Z}}(N,P,T)={\frac {1}{\Lambda ^{3N}N!}}\int dV\exp(-\beta PV)\int d\mathbf {r} ^{N}\exp(-\beta U(\mathbf {r} ))=\int dV\exp(-\beta PV)Z(N,V,T)}$ .[6]

This is almost the partition function for the ${\displaystyle NpT}$ -ensemble, but it has units of volume, an unavoidable consequence of taking the above sum over volumes into an integral. Restoring the constant ${\displaystyle C}$  yields the proper result for ${\displaystyle \Delta (N,P,T)}$ .

From the preceding analysis it is clear that the characteristic state function of this ensemble is the Gibbs free energy,

${\displaystyle G(N,P,T)=-k_{B}T\ln \Delta (N,P,T)\;\,}$

This thermodynamic potential is related to the Helmholtz free energy (logarithm of the canonical partition function), ${\displaystyle F\,}$ , in the following way:[1]

${\displaystyle G=F+PV.\;\,}$

## Applications

• Constant-pressure simulations are useful for determining the equation of state of a pure system. Monte Carlo simulations using the ${\displaystyle NpT}$ -ensemble are particularly useful for determining the equation of state of fluids at pressures of around 1 atm, where they can achieve accurate results with much less computational time than other ensembles.[2]
• Zero-pressure ${\displaystyle NpT}$ -ensemble simulations provide a quick way of estimating vapor-liquid coexistence curves in mixed-phase systems.[2]
• ${\displaystyle NpT}$ -ensemble Monte Carlo simulations have been applied to study the excess properties [7] and equations of state [8] of various models of fluid mixtures.
• The ${\displaystyle NpT}$ -ensemble is also useful in molecular dynamics simulations, e.g. to model the behavior of water at ambient conditions.[9]

## References

1. ^ a b Dill, Ken A.; Bromberg, Sarina; Stigter, Dirk (2003). Molecular Driving Forces. New York: Garland Science.
2. Frenkel, Daan.; Smit, Berend (2002). Understanding Molecular Simluation. New York: Academic Press.
3. ^ Attard, Phil (1995). "On the density of volume states in the isobaric ensemble". Journal of Chemical Physics. 103 (24): 9884–9885. doi:10.1063/1.469956.
4. ^ Koper, Ger J. M.; Reiss, Howard (1996). "Length Scale for the Constant Pressure Ensemble:  Application to Small Systems and Relation to Einstein Fluctuation Theory". Journal of Physical Chemistry. 100 (1): 422–432. doi:10.1021/jp951819f.
5. ^ Hill, Terrence (1987). Statistical Mechanics: Principles and Selected Applications. New York: Dover.
6. ^ a b c Kardar, Mehran (2007). Statistical Physics of Particles. New York: Cambridge University Press.
7. ^ McDonald, I. R. (1972). "${\displaystyle NpT}$ -ensemble Monte Carlo calculations for binary liquid mixtures". Molecular Physics. 23 (1): 41–58. doi:10.1080/00268977200100031.
8. ^ Wood, W. W. (1970). "${\displaystyle NpT}$ -Ensemble Monte Carlo Calculations for the Hard Disk Fluid". Journal of Chemical Physics. 52 (2): 729–741. doi:10.1063/1.1673047.
9. ^ Schmidt, Jochen; VandeVondele, Joost; Kuo, I. F. William; Sebastiani, Daniel; Siepmann, J. Ilja; Hutter, Jürg; Mundy, Christopher J. (2009). "Isobaric-Isothermal Molecular Dynamics Simulations Utilizing Density Functional Theory:An Assessment of the Structure and Density of Water at Near-Ambient Conditions". Journal of Physical Chemistry B. 113 (35): 11959–11964. doi:10.1021/jp901990u.