User:Inexcelsisdio/sandbox

The isothermal–isobaric ensemble (constant temperature and constant pressure ensemble) is a statistical mechanical ensemble that maintains constant temperature $$T \,$$ and constant pressure $$P \,$$ applied. It is also called the $$NpT$$-ensemble, where the number of particles $$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. 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.

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


 * $$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 $$\Lambda = \sqrt{h^2 \beta/(2 \pi m)} $$, the thermal de Broglie wavelength ($$\beta=1/k_B T \, $$ and $$k_B \,$$ is the Boltzmann constant), and the factor $$1/N!$$ (which accounts for indistinguishability of particles) both ensure normalization of entropy in the quasi-classical limit. It is convenient to adopt a new set of coordinates defined by $$ \mathbf{s}_i = L \mathbf{r}_i $$ such that the partition function becomes


 * $$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 $$V_0$$ at constant temperature and pressure containing an ideal gas with total particle number $$M$$ such that $$M-N \gg N$$, the partition function of the whole system is simply the product of the partition functions of the subsystems:


 * $$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 integral over the $$\mathbf{s}^{M-N}$$ coordinates is simply $$1$$. In the limit that $$V_0 \rightarrow \infty$$, $$M \rightarrow \infty$$ while $$(M-N)/V_0=\rho$$ stays constant, a change in volume of the system under study will not change the pressure $$p$$ of the whole system. Taking $$V/V_0 \rightarrow 0$$ allows for the approximation $$(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, $$(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 $$\beta P$$ (see below for justification for this step), and integrating over the volume V then gives


 * $$\Delta^{sys+bath}(N, P, T) = \frac{\beta P V_0^{M-N}}{\Lambda^{3M}N!(M-N)!}\int dV V^N \exp({-\beta P V}) \int d\mathbf{s}^N \exp(-\beta U(\mathbf{s})) $$.

The partition function for the bath is simply $$\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 $$NpT$$-ensemble:


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

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


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

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


 * $$\Delta(N, P, T) = \int Z(N, V, T) \exp(-\beta  PV ) C dV. \,\;$$

The quantity $$C$$ is simply some constant with units of inverse volume, which is necessary to make the integral dimensionless. In this case, $$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. This problem has been addressed in multiple ways by various authors, leading to values for C with the same units of inverse volume. The differences vanish (i.e. the choice of $$C$$ becomes arbitrary) in the thermodynamic limit, where the number of particles goes to infinity.

The $$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 $$T$$ and external forces acting on the system $$\mathbf{J}$$. Consider such a system containing $$N$$ particles. The Hamiltonian of the system is then given by $$\mathcal{H}-\mathbf{J} \cdot \mathbf{x}$$ where $$\mathcal{H}$$ is the system's Hamiltonian in the absence of external forces and $$\mathbf{x}$$ are the conjugate variables of $$\mathbf{J}$$. The microstates $$\mu$$ of the system then occur with probability defined by


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

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


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

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


 * $$\mathcal{Z}(N, \mathbf{J}, T)=\sum_{\mu, \{\mathbf{r}_i\} \in V} \exp[-\beta P V - \beta(\mathbf{p}^2/2m+U(\mathbf{r}^N))] $$,

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


 * $$ \int \prod_{i=1}^N \frac{d^3\mathbf{p}_i}{h^3}\exp\bigg[-\beta \sum_{i=1}^N \frac{p^2_i}{2m}\bigg] = \frac{1}{\Lambda^{3N}} $$.

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


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

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

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


 * $$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), $$F\,$$, in the following way:


 * $$ G = F+PV. \;\, $$

Applications

 * Constant-pressure simulations are useful for determining the equation of state of a pure system. Monte Carlo simulations using the $$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.
 * Zero-pressure $$NpT$$-ensemble simulations provide a quick way of estimating vapor-liquid coexistence curves in mixed-phase systems.
 * $$NpT$$-ensemble Monte Carlo simulations have been applied to study the excess properties and equations of state of various models of fluid mixtures.
 * The $$NpT$$-ensemble is also useful in molecular dynamics simulations, e.g. to model the behavior of water at ambient conditions.