# Gran-canonical ensemble

In this type of ensemble the system can also exchange particles with the reservoir. The equilibrium within respect particles exchange is described by an intensive property of the system, called chemical potential ${\displaystyle \mu }$. Condition of equilibrium: ${\displaystyle {\frac {dF_{1}}{dN_{1}}}={\frac {dF_{2}}{dN_{2}}}}$. More precisely:

${\displaystyle -{\frac {\partial S}{\partial N}}T=\mu ={\frac {\partial F}{\partial N}}}$

The probability that the system has a given energy ${\displaystyle E}$ and number of particles ${\displaystyle N}$ is given by:

${\displaystyle P(E,N)={\frac {1}{Z_{GC}}}g(E,N)e^{-\beta (E-\mu N)}}$

Where ${\displaystyle Z_{GC}}$ is the gran-canonical partition function:

${\displaystyle Z_{GC}=\sum _{E,N}g(E,N)e^{-\beta (E-\mu N)}}$

In such an ensemble we also have:

${\displaystyle dE=TdS-pdV+\mu dN}$

We can evaluate the mean value of energy and number of particles:

• ${\displaystyle \left\langle N\right\rangle ={\frac {1}{\beta }}{\frac {\partial \log Z_{GC}}{\partial \mu }}}$
• ${\displaystyle \left\langle E-\mu N\right\rangle =\left\langle E\right\rangle -\mu \left\langle N\right\rangle =-{\frac {\partial \log Z_{GC}}{\partial \beta }}}$

Since ${\displaystyle F=-kTN\log \left({\frac {Vn_{Q}}{N!}}\right)}$ we can derive an expression for ${\displaystyle \mu }$:

${\displaystyle \mu ={\frac {\partial F}{\partial N}}=kT\log \left({\frac {n}{n_{Q}}}\right)}$

When we have to evaluate the partition function, we have to distinguish two cases: bosons and fermions.

• ${\displaystyle Z_{GC}^{(f)}=1+e^{-\beta (\epsilon -\mu )}}$
• ${\displaystyle Z_{GC}^{(b)}={\frac {1}{1-e^{-\beta (\epsilon -\mu )}}}}$

From where we can derive the mean number of particles per energy level in the two cases. More precisely what we do derive are two distributions: the Fermi-Dirac and the Bose-Einstein distributions.

• ${\displaystyle f_{FD}(\epsilon )={\frac {1}{1+e^{\beta (\epsilon -\mu )}}}}$
• ${\displaystyle f_{BE}(\epsilon )={\frac {1}{e^{\beta (\epsilon -\mu )}-1}}}$