# Statistical mechanics and thermodynamics

(The original course was based on a course summarized by Lior Yosub and Liana Diesendruck. A rewrite is in progress that brings in more detail)

### Introduction

The properties of a macroscopic physical system ultimately derives from the properties of its fundamental constituents. Since an exact solution for many particle systems with non-trivial interactions is out of the question, one is forced to resort to statistical methods to make progress. Statistical methods can, of course, only be used when we know the probabilities for finding the system in a particular state. The fundamental postulate of statistical physics is that all accessible states of an isolated system are a priori equally likely. Here "state" means the exact quantum state of the system which thus provides for a full microscopic description of the system. This postulate can be motivated by Liouville's theorem and Boltzmann's H-theorem which we'll discuss later in this course.

A macroscopic property of a system is, in general, obtained from the exact state after a coarse graining. Properties such as the internal energy, temperature, pressure etc. are examples of such macroscopic properties and they all have to be understood as (derived from) coarse grained variables. In principle, however, one can make any arbitrary choice for the macroscopic properties. For any choice, one defines the so-called "macrostate" of the system to be the set of these variables. Thermodynamics is the study of the relations between the macroscopic properties of the system. In thermodynamics, the word "state" is often used for "macrostate". To avoid confusion, it is customary to call the exact physical state of the system the "microstate".

A system is said to be in thermal equilibrium if its macrostate is time independent. A major part of statistical mechanics is the study of systems in or very close to thermal equilibrium. It follows from the fundamental postulate that lacking any information about a system, the most likely macrostate is that state for which the number of microstates that corresponds to it, is maximal. Any initial macrostate should thus evolve to such a macrostate, which is thus the thermal equilibrium state. This conclusion is known as the Second Law of Thermodynamics.

In the next section we'll apply the methods of statistical mechanics to isolated systems characterised by their total energy.

### The Micro-Canonical Ensemble

Since the total energy of an isolated system is conserved, all accessible microstates have the same energy. The macroscopic variable corresponding to the total energy, ${\displaystyle E,}$ has to be understood as a coarse grained variable corresponding to the total energy of the system. We define this as follows: When ${\displaystyle E}$ is specified, the total energy of the system can be in the range between ${\displaystyle E}$ and ${\displaystyle E+\delta E}$, where ${\displaystyle \delta E}$ is assumed to be small on a macroscopic scale. We'll see later that the value of macroscopic quantities per unit mass or unit volume in the limit of infinite system size do not depend on the choice of ${\displaystyle \delta E}$.

We define the function ${\displaystyle \Omega \left(E\right)}$ to be the number of microstates with energies with an energy in the range between ${\displaystyle E}$ and ${\displaystyle E+\delta E}$. All these states are equally likely in thermal equilibrium. One can then compute macroscopic properties of systems by averaging over all the ${\displaystyle \Omega \left(E\right)}$ states. Put differently, one can imagine the so-called "micro-canonical ensemble " ensemble of of systems with microstates in each of the ${\displaystyle \Omega \left(E\right)}$ states. Averaging over this ensemble yields the macroscopic thermal variables.

#### Definition of temperature

Now consider two such isolated systems in internal equilibrium, but isolated from each other. They have internal energies of ${\displaystyle E_{1}}$ and ${\displaystyle E_{2}}$. The number of microstates the systems can be in are then ${\displaystyle \Omega _{1}\left(E_{1}\right)}$ and ${\displaystyle \Omega _{2}\left(E_{2}\right)}$, respectively. Suppose we bring the two systems into contact, such that energy can flow between the two systems. The total internal energy ${\displaystyle E=E_{1}+E_{2}}$ of the combined system will then be conserved. The total number of accessible states the combined system can be in, is clearly given by:

${\displaystyle \Omega \left(E\right)=\sum _{E_{1}}\Omega _{1}\left(E_{1}\right)\Omega _{2}\left(E-E_{1}\right)}$

Here the summation variable ${\displaystyle E_{1}}$ increases by a steps of ${\displaystyle \delta E}$. This then means that the coarse grained internal energy variable ${\displaystyle E}$ for the combined system determines its exact system's energy to be in the range between ${\displaystyle E}$ and ${\displaystyle E+2\delta E}$. Obviously, the most likely energy distribution over the two systems is such that the product ${\displaystyle \Omega _{1}\left(E_{1}\right)\Omega _{2}\left(E-E_{1}\right)}$ is maximal. When we start with any other energy distribution and bring the two systems into thermal contact, energy will flow until that particular equilibrium state is reached. While there is then still a small probability for the energy distribution to deviate from this equilibrium state, it turns out that this is exceedingly unlikely, because the product of the two omega functions has a very sharp maximum.

We can formally compute the condition for thermal equilibrium between the two subsystems by maximizing the function ${\displaystyle \Omega _{1}\left(E_{1}\right)\Omega _{2}\left(E-E_{1}\right)}$. It is convenient to take the logarithm of this function and equate the derivative of that w.r.t. ${\displaystyle E_{1}}$ to zero. This gives:

${\displaystyle {\frac {\mathrm {d} \log \left[\Omega _{1}\left(E_{1}\right)\right]}{\mathrm {d} E_{1}}}+{\frac {\mathrm {d} \log \left[\Omega _{2}\left(E-E_{1}\right)\right]}{\mathrm {d} E_{1}}}=0}$

In the derivative of ${\displaystyle \log \left[\Omega _{2}\left(E-E_{1}\right)\right]}$ we can change variables by putting ${\displaystyle E_{2}=E-E_{1}}$. By the chain rule, we then have:

${\displaystyle {\frac {\mathrm {d} \log \left[\Omega _{1}\left(E_{1}\right)\right]}{\mathrm {d} E_{1}}}={\frac {\mathrm {d} \log \left[\Omega _{2}\left(E_{2}\right)\right]}{\mathrm {d} E_{2}}}}$

Note that the l.h.s. of the equation only refers to the property of system 1 and the r.h.s only to the properties of system 2. For any arbitrary isolated system with internal energy ${\displaystyle E,}$ we define the so-called temperature parameter ${\displaystyle \beta }$ as:

${\displaystyle \beta \equiv {\frac {\mathrm {d} \log \left[\Omega \left(E\right)\right]}{\mathrm {d} E}}}$

The condition that two isolated systems in internal thermal equilibrium are also in thermal equilibrium with each other (i.e. that when they are brought into thermal equilibrium no energy will flow between them), is thus that the two temperature parameters of both systems are equal. The thermodynamic temperature ${\displaystyle T}$ is defined by:

${\displaystyle {\frac {1}{kT}}\equiv \beta }$

where ${\displaystyle k}$ is a arbitrary constant that fixes the temperature scale. If we choose to measure the thermodynamic temperature in Kelvin, then this constant is fixed to be Boltzmann's constant. We'll see later that this definition of thermodynamic temperature implies that energy flow between two systems as a result of thermal contact is from the high temperature system to the low temperature system.

While the Omega function is not accessible at the macroscopic level, the entropy, defined as:

${\displaystyle S=k\log \left[\Omega \left(E\right)\right]\,}$

is a thermodynamic variable that can (indirectly) be determined from the macroscopic thermal properties of the system. From the above definitions, it follows that the temperature ${\displaystyle T}$ can be expressed as:

${\displaystyle {\frac {1}{T}}={\frac {\mathrm {d} S}{\mathrm {d} E}}}$

Now, this equation is only valid for isolated systems that don't perform any work. I.e. when the energy is added it goes into the internal thermal energy of the system. In general, we deal with systems that can perform work. In general this can be described by so-called external parameters, such as the volume of the system. The energy change due to the change in the external parameters is called work. Thermal energy that flows into a system that is not due to work is called heat.

#### The fundamental thermodynamic relation

We will now show that in general, when heat is added to a system so slowly that it remains in internal thermal equilibrium (such slow processes are called quasistatic processes), we have:

${\displaystyle \mathrm {d} S={\frac {\delta Q}{T}}}$

i.e. the change in entropy depends only on the added heat to the system and not on changes in internal energy due to work. Suppose that the system has some external parameter, ${\displaystyle x,}$ that can be changed. In general, the energy eigenstates of the system will depend on ${\displaystyle x}$. According to the adiabatic theorem of quantum mechanics, in the limit of an infinitely slow change of the system's Hamiltonian, the system will stay in the same energy eigenstate and thus change its energy according to the change in energy of the energy eigenstate it is in.

The generalized force, ${\displaystyle X,}$ corresponding to the external variable ${\displaystyle x,}$ is defined such that ${\displaystyle X\,\mathrm {d} x}$ is the work performed by the system if ${\displaystyle x}$ is increased by an amount ${\displaystyle \mathrm {d} x\,;}$ E.g., if ${\displaystyle x}$ is the volume, then ${\displaystyle X}$ is the pressure. The generalized force for a system known to be in energy eigenstate ${\displaystyle E_{r}}$ is given by:

${\displaystyle X=-{\frac {\mathrm {d} E_{r}}{\mathrm {d} x}}}$

Since the system can be in any energy eigenstate within an interval of ${\displaystyle \delta E}$, we define the generalized force for the system as the expectation value of the above expression:

${\displaystyle X=-\left\langle {\frac {\mathrm {d} E_{r}}{\mathrm {d} x}}\right\rangle \,}$

To evaluate the average, we partition the ${\displaystyle \Omega \left(E\right)}$ energy eigenstates by counting how many of them have a value for ${\displaystyle {\frac {\mathrm {d} E_{r}}{\mathrm {d} x}}}$ within a range between ${\displaystyle Y}$ and ${\displaystyle Y+\delta Y}$. Calling this number ${\displaystyle \Omega _{Y}\left(E\right)}$, we have:

${\displaystyle \Omega \left(E\right)=\sum _{Y}\Omega _{Y}\left(E\right)\,}$

The average defining the generalized force can now be written:

${\displaystyle X=-{\frac {1}{\Omega \left(E\right)}}\sum _{Y}Y\Omega _{Y}\left(E\right)\,}$

We can relate this to the derivative of the entropy w.r.t. ${\displaystyle x}$ at constant energy ${\displaystyle E}$ as follows. Suppose we change ${\displaystyle x}$ to ${\displaystyle x+\mathrm {d} x}$. Then ${\displaystyle \Omega \left(E\right)}$ will change because the energy eigenstates depend on ${\displaystyle x\,,}$ causing energy eigenstates to move into or out of the range between ${\displaystyle E}$ and ${\displaystyle E+\delta E}$. Let's focus again on the energy eigenstates for which ${\displaystyle {\frac {\mathrm {d} E_{r}}{\mathrm {d} x}}}$ lies within the range between ${\displaystyle Y}$ and ${\displaystyle Y+\delta Y}$. Since these energy eigenstates increase in energy by ${\displaystyle Y\;\mathrm {d} x,}$ all such energy eigenstates that are in the interval ranging from ${\displaystyle E-Y\;\mathrm {d} x}$ to ${\displaystyle E}$ move from below ${\displaystyle E}$ to above ${\displaystyle E.}$ There are

${\displaystyle N_{Y}\left(E\right)={\frac {\Omega _{Y}\left(E\right)}{\delta E}}Y\mathrm {d} x\,}$

such energy eigenstates. If ${\displaystyle Ydx\leq \delta E}$, all these energy eigenstates will move into the range between ${\displaystyle E}$ and ${\displaystyle E+\delta E}$ and contribute to an increase in ${\displaystyle \Omega }$. The number of energy eigenstates that move from below ${\displaystyle E+\delta E}$ to above ${\displaystyle E+\delta E}$ is, of course, given by ${\displaystyle N_{Y}\left(E+\delta E\right)}$. The difference

${\displaystyle N_{Y}\left(E\right)-N_{Y}\left(E+\delta E\right)\,}$

is thus the net contribution to the increase in ${\displaystyle \Omega }$. Note that if ${\displaystyle Y\;\mathrm {d} x}$ is larger than ${\displaystyle \delta E}$ there will be the energy eigenstates that move from below ${\displaystyle E}$ to above ${\displaystyle E+\delta E}$. They are counted in both ${\displaystyle N_{Y}\left(E\right)}$ and ${\displaystyle N_{Y}\left(E+\delta E\right)}$, therefore the above expression is also valid in that case.

Expressing the above expression as a derivative w.r.t. ${\displaystyle E}$ and summing over ${\displaystyle Y}$ yields the expression:

${\displaystyle \left({\frac {\partial \Omega }{\partial x}}\right)_{E}=-\sum _{Y}Y\left({\frac {\partial \Omega _{Y}}{\partial E}}\right)_{x}=\left({\frac {\partial \left(\Omega X\right)}{\partial E}}\right)_{x}\,}$

The logarithmic derivative of ${\displaystyle \Omega }$ w.r.t. ${\displaystyle x}$ is thus given by:

${\displaystyle \left({\frac {\partial \log \left(\Omega \right)}{\partial x}}\right)_{E}=\beta X+\left({\frac {\partial X}{\partial E}}\right)_{x}\,}$

The first term is intensive, i.e. it does not scale with system size. In contrast, the last term scales as the inverse system size and will thus vanishes in the thermodynamic limit. We have thus found that:

${\displaystyle \left({\frac {\partial S}{\partial x}}\right)_{E}={\frac {X}{T}}\,}$

Combining this with

${\displaystyle \left({\frac {\partial S}{\partial E}}\right)_{x}={\frac {1}{T}}\,}$

Gives:

${\displaystyle \mathrm {d} S=\left({\frac {\partial S}{\partial E}}\right)_{x}\mathrm {d} E+\left({\frac {\partial S}{\partial x}}\right)_{E}\mathrm {d} x={\frac {\mathrm {d} E}{T}}+{\frac {X}{T}}\mathrm {d} x={\frac {\delta Q}{T}}\,}$

The first part of this equation, which can be written as:

${\displaystyle \mathrm {d} E=T\mathrm {d} S-X\mathrm {d} x\,}$ (1)

is called the fundamental thermodynamic relation. It is more general than the equation ${\displaystyle \mathrm {d} S=\delta Q/T}$, as the former is also valid when the changes in the system are not quasistatic. This is because the internal energy in thermal equilibrium will be completely determined by when ${\displaystyle S}$ and ${\displaystyle X}$ are specified. So, we can consider ${\displaystyle E}$ to be a function of ${\displaystyle S}$ and ${\displaystyle X}$ (we say that ${\displaystyle E}$ is a thermodynamic state function) and we always have:

${\displaystyle \mathrm {d} E=\left({\frac {\partial E}{\partial S}}\right)_{x}\mathrm {d} S+\left({\frac {\partial E}{\partial x}}\right)_{S}\mathrm {d} x}$

The fact that (1) is valid for quasistatic changes then allows us to conclude that the partial derivatives in the above equation are given by:

${\displaystyle \left({\frac {\partial E}{\partial S}}\right)_{x}=T}$
${\displaystyle \left({\frac {\partial E}{\partial x}}\right)_{S}=-X}$

The equation (1) is thus always valid, albeit it that for non-quasistatic changes we cannot identify the two terms as heat added and work done by the system any more. Also we don't always have to interpret the infinitesimal changes as a change that actually happens in a system. E.g. one can consider two copies of the same system but with slightly different thermodynamic variables. Then ${\displaystyle \mathrm {d} E,\,\mathrm {d} S\,{\textrm {and}}\,\mathrm {d} x}$ can refer to the difference in internal energy, entropy, and external parameter between the two systems. These changes will satisfy (1).

### Canonical Ensemble

Often, the system we want to study is not isolated, but instead is in thermal contact with an environment at some fixed temperature. Now, for a large system a system kept at some temperature will fix its internal energy with negligible energy fluctuations relative to the total internal energy. So, we could just as well treat such systems using the micro-canonical ensemble. However, it turns out that doing computations in the micro-canonical ensemble is rather inconvenient.

Since a system kept at constant temperature is in thermal contact with an environment, usually called a heat bath, it is no longer true that all microstates of the system are equally likely. We can find the probability to find the system in some microstate as follows. We imagine that the system is kept at constant temperature by a heat bath such that the system plus heat bath is an isolated system. The accessible microstates for this combined system are then all equally likely. Suppose that the combined system has a total energy of E. If the system is in some microstate with energy ${\displaystyle E_{r}}$, then we can express the total number of states the combined system can be in, in terms of the omega function of the heat bath as ${\displaystyle \Omega \left(E-E_{r}\right)}$. Since all states are equally likely, this is proportional to the probability ${\displaystyle P_{r}}$ of finding the system in the microstate with an energy ${\displaystyle E_{r}}$:

${\displaystyle P_{r}=C\Omega \left(E-E_{r}\right)\,}$

for some constant C. Here one has to define the omega function by choosing the energy resolution ${\displaystyle \delta E}$ smaller than the spacing between the energy levels of the system. For the Omega function to be well defined we have to choose ${\displaystyle \delta E}$ to be much larger than the spacing between the energy levels in the heat bath. These conditions can be satisfied because the heat bath will have to consist of far more degrees of freedoms than the system in order to be able to be able to absorb heat from the system and yet stay at (almost) constant temperature. The more degrees of freedom a system has, the smaller the spacing between the energy levels will be.

The above expression for ${\displaystyle P_{r}}$ can be simplified as follows. We can write:

${\displaystyle \log \left(P_{r}\right)=\log(C)+\log \left[\Omega \left(E-E_{r}\right)\right]=K-E_{r}{\frac {\mathrm {d} \log \left[\Omega \left(E\right)\right]}{\mathrm {d} E}}=K-\beta E_{r}\,}$

for some constant ${\displaystyle K}$. Here we have used the definition of the temperature parameter given in the previous section and that in the limit of an ideal heat bath, the higher order terms in the Taylor expansion tend to zero as they involve the change in temperature due to change in the system's energy. It thus follows that:

${\displaystyle P_{r}={\frac {\exp \left(-\beta E_{r}\right)}{Z}}}$

where the normalization constant ${\displaystyle Z}$ is the so-called partition function which is given by:

${\displaystyle Z=\sum _{r}\exp \left(-\beta E_{r}\right)}$

The canonical ensemble is a hypothetical ensemble of copies of a system whose microstates are distributed according to ${\displaystyle P_{r}}$.

#### Computation of thermodynamic variables

The system's thermodynamic variables can be computed by averaging over the probability distribution ${\displaystyle P_{r}}$. It turns out that a knowledge of the partition function suffices to extract all of the system's thermodynamic variables. In this section, we'll derive the equations for the internal energy, generalized forces, and the entropy in terms of ${\displaystyle Z}$.

The internal energy is expectation value of the system's energy. This can be expressed in terms of the partition function in the following way:

${\displaystyle E=\sum _{r}P_{r}E_{r}=\sum _{r}E_{r}{\frac {\exp \left(-\beta E_{r}\right)}{Z}}=-{\frac {1}{Z}}{\frac {\partial }{\partial \beta }}\sum _{r}\exp \left(-\beta E_{r}\right)=-{\frac {1}{Z}}{\frac {\partial Z}{\partial \beta }}=-{\frac {\partial \log \left(Z\right)}{\partial \beta }}\,}$

If the system is in the state r, then the generalized force corresponding to an external variable x is given by

${\displaystyle X_{r}=-{\frac {\partial E_{r}}{\partial x}}\,}$

The expectation value of this is the thermodynamic generalized force of the system and this can be written as:

${\displaystyle X=\sum _{r}P_{r}X_{r}={\frac {1}{\beta }}{\frac {\partial \log Z}{\partial x}}\,}$

Suppose the system has one external variable x. Then changing the system's temperature parameter by ${\displaystyle d\beta }$ and the external variable by dx will lead to a change in ${\displaystyle \log Z}$:

${\displaystyle \mathrm {d} \left(\log Z\right)={\frac {\partial \log Z}{\partial \beta }}\mathrm {d} \beta +{\frac {\partial \log Z}{\partial x}}\mathrm {d} x=-E\,\mathrm {d} \beta +\beta X\,\mathrm {d} x\,}$

If we write ${\displaystyle E\,\mathrm {d} \beta }$ as:

${\displaystyle E\,\mathrm {d} \beta =\mathrm {d} \left(\beta E\right)-\beta \,\mathrm {d} E\,}$

we get:

${\displaystyle \mathrm {d} \left(\log Z\right)=-\mathrm {d} \left(\beta E\right)+\beta \,\mathrm {d} E+\beta X\,\mathrm {d} x\,}$

This means that the change in the internal energy is given by:

${\displaystyle \mathrm {d} E={\frac {1}{\beta }}\mathrm {d} \left(\log Z+\beta E\right)-X\,\mathrm {d} x\,}$

In the thermodynamic limit, the fundamental thermodynamic relation should hold:

${\displaystyle \mathrm {d} E=T\,\mathrm {d} S-X\,\mathrm {d} x\,}$

This then implies that the entropy of the system is given by:

${\displaystyle S=k\log Z+{\frac {E}{T}}+c\,}$

where c is some constant. The value of c can be determined by considering the limit T → 0. In this limit the entropy becomes ${\displaystyle S=k\log \Omega _{0}}$ where ${\displaystyle \Omega _{0}}$ is the ground state degeneracy. The partition function in this limit is ${\displaystyle \Omega _{0}e^{-\beta E_{0}}}$ where ${\displaystyle E_{0}}$ is the ground state energy. We thus see that ${\displaystyle c=0}$, therefore:

${\displaystyle S=k\log Z+{\frac {E}{T}}\,}$

The Helmholtz free energy ${\displaystyle F}$ can thus be expressed as:

${\displaystyle F=E-TS=-kT\log \left(Z\right)\,}$

### Grand Canonical Ensemble

In this ensemble we attach our system to a heat-particles reservoir in order to fix the temperature and the chemical potential of our system. The chemical potential is defined as ${\displaystyle \mu =\left({\frac {\mathrm {d} F}{\mathrm {d} N}}\right)_{V,\tau }}$. In previous ensembles we fixed number of particles ${\displaystyle N}$ in the system. Now we let it change, so now we should rectify the expression of the energy and all its derivatives.

${\displaystyle {\begin{matrix}&\mathrm {d} U=\tau \mathrm {d} \sigma -p\mathrm {d} V+\mu \mathrm {d} N\\&\mathrm {d} F=-\sigma \mathrm {d} \tau -p\mathrm {d} V+\mu \mathrm {d} N\\&\mathrm {d} \sigma ={\frac {\mathrm {d} U}{\tau }}+{\frac {p}{\tau }}\mathrm {d} V-{\frac {\mu }{\tau }}\mathrm {d} N\end{matrix}}}$

We start by defining the probability of a certain state as:

${\displaystyle P(N,\left\{s_{i}\right\})={\frac {1}{\zeta }}e^{\frac {\mu N-\epsilon _{s}}{\tau }}}$

where

${\displaystyle \zeta =\sum _{N}\sum _{\left\{s\right\}}e^{\frac {\mu N-\epsilon _{s}}{\tau }}}$

Directly from ${\displaystyle \zeta }$, the Grand Partition Function, we shall derive the definition of the Grand Thermodynamical Potential, ${\displaystyle \Omega }$.

${\displaystyle \Omega =-\tau ln\zeta }$

Another form of ${\displaystyle \Omega }$ is: ${\displaystyle \Omega =F-\mu N}$. The differential form of ${\displaystyle \Omega }$ is:

${\displaystyle \Omega =-\sigma \mathrm {d} \tau -p\mathrm {d} V-N\mathrm {d} \mu }$

There are other possible ensembles, some of them we shall see in this course.

### Gibbs Potential

We should now elaborate a specific characteristic of physical parameters of a thermodynamic system. An extensive parameter is a parameter whose value is proportional to the size of the system (number of particles), an intensive parameter is a parameter that is independent of the system size.

Let's summarize the thermodynamic potential we have seen:

• ${\displaystyle U}$ - Energy
• ${\displaystyle F}$ - Free Energy
• ${\displaystyle H}$ - Enthalpy
• ${\displaystyle \Omega }$ - Grand Potential

We have expressed all of these potentials in a differential form, where the number of elements depends on the number of ways to change the system's energy. Each term involves one extensive parameter and one intensive parameter. The pairs we have encountered so far are ${\displaystyle (\tau ,\sigma )}$, (${\displaystyle p,V}$), (${\displaystyle \mu ,N}$), (${\displaystyle B,M}$), where the first element of each pair is the intensive parameter and the second is the extensive one. The parameters under differential sign have a special meaning: when they are fixed, this thermo potential tends to minimum/maximum. For example:

${\displaystyle d\sigma ={\frac {dU}{\tau }}+{\frac {p}{\tau }}dV-{\frac {\mu }{\tau }}dN\Rightarrow \sigma \uparrow \,{\textrm {max}}}$, when ${\displaystyle U,V,N={\textrm {const}}}$

.

or

${\displaystyle \mathrm {d} F=-\sigma \mathrm {d} \tau -p\mathrm {d} V+\mu \mathrm {d} N\Rightarrow F\downarrow \;{\textrm {min}}}$ when ${\displaystyle \tau ,V,N={\textrm {const}}.}$

In order to get from one potential to another one we simply need to add the proper pair of parameters to the first potential. For example, let's construct an ensemble where we fix the temperature, the number of particles and the pressure of the system. Like in the previous ensembles we'll look for a matching potential for our new ensemble and we shall see that our matching potential tends to a minimum.

${\displaystyle {\begin{matrix}&G(\tau ,p,N)=U(V,\sigma ,N)+pV-\tau \sigma =H(p,\sigma ,N)-\tau \sigma =F(V,\tau ,N)+pV\\&\mathrm {d} G=-\sigma \mathrm {d} \tau -Vdp+\mu \mathrm {d} N\end{matrix}}}$

We attach to the system a heat-particle reservoir and will show that Gibbs potential is minimum at ${\displaystyle \tau }$, ${\displaystyle p}$ and ${\displaystyle N}$ - constant.

The total entropy ${\displaystyle \sigma _{R+S}}$ increase since ${\displaystyle R+S}$ is a closed system.

We use Taylor expansion:

${\displaystyle {\begin{matrix}&\sigma _{R}(U_{0}-U,V_{0}-V)+\sigma _{S}(U,V)\ \uparrow \,{\textrm {max}}\\&\sigma _{R}(U_{0},V_{0})-{\frac {\partial \sigma _{R}}{\partial U}}|_{U_{0}}\ U-{\frac {\partial \sigma _{R}}{\partial V}}|_{V_{0}}\ V+\sigma _{S}\ \uparrow \,{\textrm {max}}\end{matrix}}}$

Using Maxwell relations we get:

${\displaystyle {\begin{matrix}&\left({\frac {\partial \sigma _{R}}{\partial U}}\right)_{N,V}={\frac {1}{\tau }}\\&\left({\frac {\partial \sigma _{R}}{\partial V}}\right)_{N,U}={\frac {p}{\tau }}\\&\underbrace {\sigma _{R}(U_{0},V_{0})} _{\textrm {constant}}-{\frac {U}{\tau }}-p{\frac {V}{\tau }}+\sigma _{S}\ \uparrow \,{\textrm {max}}\end{matrix}}}$

Now we multiply by ${\displaystyle -\tau }$, so the expression should tend to minimum:

${\displaystyle G=U+pV-\tau \sigma \ \downarrow \,{\textrm {min}}}$

We call this potential Gibbs Free Energy.

### Intensive Potentials

All of our potentials so far are extensive quantities. Sometimes we want to characterize the system by an intensive quantity with a meaning of thermodynamic potential. The easiest way define it is to divide the potential by an extensive parameter. If we divide the potential by, for example, N we'll get the potential per particle, which is an intensive size. We shall see now that in the special case of the potential G we'll get:

${\displaystyle \mu =\left({\frac {\partial G}{\partial N}}\right)_{p,\tau }={\frac {G}{N}}}$

i.e. ${\displaystyle \mu }$ is Gibbs free energy per particle

${\displaystyle U=(\sigma ,V,N)=NU\left({\frac {\sigma }{N}},{\frac {V}{N}},1\right)}$

The above equation simply states that the energy of a system is equal to the number of particles times the energy of one particle.

The same can be done with the Free Energy (F):

${\displaystyle F(\tau ,V,N)=NF\left(\tau ,{\frac {V}{N}},1\right)=Nf_{1}\left(\tau ,{\frac {V}{N}}\right)}$

(The temperature is an intensive quantity so it's the same for every particle) Now we do the same to Gibbs Free Energy:

${\displaystyle G(\tau ,p,N)=NG(\tau ,p,1)=Ng_{1}(\tau ,p)}$

From the differential form of G we calculate the Chemical Potential:

${\displaystyle \mu =\left({\frac {\partial G}{\partial N}}\right)_{p,\tau }=g_{1}(\tau ,p)\ \Rightarrow \ \mu ={\frac {G}{N}}}$

From here we receive:

${\displaystyle {\begin{matrix}&G=F+pV=U+pV-\tau \sigma =\mu N\\&\Omega =F-\mu N=F-G=-pV\end{matrix}}}$

### Phase transitions:

(example of liquid-vapor transition)

Consider vessel which contain water vapor with volume ${\displaystyle V}$ and at low pressure so that the gas is an ideal gas. We start decrease the volume so the pressure increases: ${\displaystyle \left(p\approx {\frac {1}{V}}\right)}$.

In a certain point a small layer of water will appear and from this point, the following decreasing of volume will not change the pressure, it will be constant. So what happens in the system? If we continue to reduce the volume, the water level will rise, but the pressure will remain constant. When all the vapor turn into water, reducing the volume will increase the pressure drastically and the proportion between the pressure and volume will change. In range of constant pressure we observe coexistence of two phases: liquid and gas.

The process we described above is done at a constant temperature. If we raise the temperature, the range of phase separation will shrink. But, if we raise the temperature high enough, we will have only a point of constant pressure. This temperature is called critical temperature, and for a phase transformation process at this temperature we don't have phase separation, we have everytime coexistence of gas and liquid, this named - fluid.

### Theory of phase transition

Despite the complicated mathematical description like for example the BCS theory all known phase transitions like superconductivity, superfluidity or ferromagnetism are the result of the competition between the ordering interaction and the thermal fluctuations and they are similar to frequent attempts of falling out of the ping-pong ball in the hemispherical bowl or the box excited for example by the stream of air with the cooling fan or the vacuum cleaner. After exceeding the certain excitation intensity i.e. for the true case the critical temperature with the sufficiently strong stream of air the ball will stop randomly bounce from the walls of the bowl and it will fall out i.e. its order parameter which is its localization in or outside the bowl will undergo the phase transition. It is therefore the result of strong non-linearity of motion which shows up when the system is randomly excited. The similar mechanism is responsible for "melting" of the ferromagnet i.e. for its total demagnetization with the thermal excitation above the Curie temperature when the interaction with the thermal reservoir is causing that the spin from small oscillations around the parallel direction of other spins starts randomly oscillate averaging to zero and ignoring the other spins around or when the thermal oscillations cause the ionization of Cooper pairs in the superconductor. For the Heisenberg model for example it is the pendular cosine scalar product interaction between the spins and the separatrix between two types of pendular spin motion in the external field which is responsible for the transition between the oscillatory (ordered) phase and the demagnetized or rotational phase with the critical temperature ${\displaystyle kT_{c}\approx {\sup }_{\phi }J(\cos \phi +1)=2J}$ or the energy between the pendulum up and down, close to its exact value from two dimensional Ising model given implicitly by ${\displaystyle 2\tanh ^{2}(2J/kT_{c})=1}$ or ${\displaystyle kT_{c}\approx 2.269J}$. Considering the spin as pendulum with the potential of the interaction with two other spins (with one above in the third dimension) one gets ${\displaystyle kT_{c}=4J}$ close to its numerical value ${\displaystyle kT_{c}=4.512J}$ obtained from the numerical Monte Carlo calculations and generally as interacting with one more for extra dimension ${\displaystyle kT_{c}=6J}$ for four dimensions close to numerical ${\displaystyle kT_{c}=6.666J}$ and ${\displaystyle kT_{c}=2(d-1)J}$ close to Bethe-Peierls-Weiss theory in ${\displaystyle d}$ dimensions where it is ${\displaystyle kT_{c}=2dJ}$ for the very large ${\displaystyle d}$.