# Semi-grand ensembles

Semi-grand ensembles are used in Monte Carlo simulation of mixtures. In these ensembles the total number of molecules is fixed, but the composition can change.

## Canonical ensemble: fixed volume, temperature and number(s) of molecules

We shall consider a system consisting of c components;. In the canonical ensemble, the differential equation energy for the Helmholtz energy function can be written as:

${\displaystyle d\left(\beta A\right)=Ed\beta -(\beta p)dV+\sum _{i=1}^{c}(\beta \mu _{i})dN_{i}}$,

where:

• ${\displaystyle A}$ is the Helmholtz energy function
• ${\displaystyle \beta :=1/k_{B}T}$
• ${\displaystyle k_{B}}$ is the Boltzmann constant
• ${\displaystyle T}$ is the absolute temperature
• ${\displaystyle E}$ is the internal energy
• ${\displaystyle p}$ is the pressure
• ${\displaystyle \mu _{i}}$ is the chemical potential of the species ${\displaystyle i}$
• ${\displaystyle N_{i}}$ is the number of molecules of the species ${\displaystyle i}$

## Semi-grand ensemble at fixed volume and temperature

Consider now that we wish to consider a system with fixed total number of particles, ${\displaystyle N}$

${\displaystyle \left.N=\sum _{i=1}^{c}N_{i}\right.}$;

but the composition can change, from thermodynamic considerations one can apply a Legendre transform [HAVE TO CHECK ACCURACY] to the differential equation written above in terms of ${\displaystyle A(T,V,N_{1},N_{2})}$.

• Consider the variable change ${\displaystyle N_{1}\rightarrow N}$ i.e.: ${\displaystyle \left.N_{1}=N-\sum _{i=2}^{c}N_{i}\right.}$

${\displaystyle d\left(\beta A\right)=Ed\beta -(\beta p)dV+\beta \mu _{1}dN-\beta \mu _{1}\sum _{i=2}^{c}dN_{i}+\sum _{i=2}^{c}\beta \mu _{i}dN_{i};}$

${\displaystyle d\left(\beta A\right)=Ed\beta -(\beta p)dV+\beta \mu _{1}dN+\sum _{i=2}^{c}\beta (\mu _{i}-\mu _{1})dN_{i};}$

or,

${\displaystyle d\left(\beta A\right)=Ed\beta -(\beta p)dV+\beta \mu _{1}dN+\sum _{i=2}^{c}\beta \mu _{i1}dN_{i};}$

where ${\displaystyle \left.\mu _{i1}\equiv \mu _{i}-\mu _{1}\right.}$.

• Now considering the thermodynamic potential: ${\displaystyle \beta A-\sum _{i=2}^{c}\left(N_{i}\beta \mu _{i1}\right)}$
${\displaystyle d\left[\beta A-\sum _{i=2}^{c}(\beta \mu _{i1}N_{i})\right]=Ed\beta -\left(\beta p\right)dV+\beta \mu _{1}dN-\sum _{i=2}^{c}N_{i}d\left(\beta \mu _{i1}\right).}$

## Fixed pressure and temperature

In the isothermal-isobaric ensemble: ${\displaystyle (N_{1},N_{2},\cdots ,N_{c},p,T)}$ one can write:

${\displaystyle d(\beta G)=Ed\beta +Vd(\beta p)+\sum _{i=1}^{c}\left(\beta \mu _{i}\right)dN_{i}}$

where:

## Fixed pressure and temperature: Semi-grand ensemble

Following the procedure described above one can write:

${\displaystyle \beta G(\beta ,\beta p,N_{1},N_{2},\cdots N_{c})\rightarrow \beta \Phi (\beta ,\beta p,N,\beta \mu _{21},\cdots ,\beta \mu _{c1})}$,

where the new thermodynamic potential ${\displaystyle \beta \Phi }$ is given by:

${\displaystyle d(\beta \Phi )=d\left[\beta G-\sum _{i=2}^{c}(\beta \mu _{i1}N_{i})\right]=Ed\beta +Vd(\beta p)+\beta \mu _{1}dN-\sum _{i=2}^{c}N_{i}d(\beta \mu _{i1}).}$

## Fixed pressure and temperature: Semi-grand ensemble: partition function

In the fixed composition ensemble one has:

${\displaystyle Q_{N_{i},p,T}={\frac {\beta p}{\prod _{i=1}^{c}\left(\Lambda _{i}^{3N_{i}}N_{i}!\right)}}\int _{0}^{\infty }dVe^{-\beta pV}V^{N}\int \left(\prod _{i=1}^{c}d(R_{i}^{*})^{3N_{i}}\right)\exp \left[-\beta U\left(V,(R_{1}^{*})^{3N_{1}},\cdots \right)\right].}$