Can you give real world examples of Microcanonical, Canonical, and Grand-canonical ensembles? As far as I understand,

*

*Microcanonical ensemble => gas atoms, etc.

*Canonical ensemble => salt crystal, etc.

*Grand-canonical ensemble => Biopolymers or proteins.

Am I correct?
Also, can you give an example of an isothermal-isobaric ensemble?
 A: There may be a fundamental misunderstanding at work here.  Any system has a (typically very large) number of possible configurations which we call microstates.  A statistical ensemble is a set of microstates $\mathcal M$ and a probability distribution $\mathscr P$ which assigns a probability to each microstate $\mu\in \mathcal M$.
The Gibbs entropy of a statistical ensemble is given by
$$S/k := -\sum_{\mu\in \mathcal M} \mathscr P(\mu) \ln\big(\mathscr P(\mu)\big)$$
It is this quantity which will be maximized in equilibrium for each ensemble, subject to the relevant constraints.

Consider a system of particles which has a fixed energy, volume, and number of particles.  The probability distribution which maximizes the total entropy of this ensemble is the uniform distribution
$$\mathscr P_{MC}(\mu) = \frac{1}{N[\mathcal M]}$$
where $N[\mathcal M]$ is the number of microstates in $\mathcal M$.  This is called the microcanonical ensemble.  The corresponding entropy is
$$S/k= \ln\big(N[M]\big)$$

Next, consider a system of particles which has a fixed volume and number of particles, but which may exchange energy with a thermal reservoir at temperature $T$.  In this case, not all microstates $\mu\in \mathcal M$ have the same energy. The probability distribution which maximizes the total entropy of the system + the reservoir is given by
$$\mathscr P_{C}(\mu) := \frac{e^{-E(\mu)/kT}}{Z} \qquad Z:=\sum_{\mu\in \mathcal M} e^{-E(\mu)/kT}$$
where $E(\mu)$ is the energy of the microstate $\mu$ and $Z$ is called the (canonical) partition function. This is called the canonical ensemble.  It is useful to define a function $F(T,V,N)$ such that $Z = e^{-F/kT}$; this $F$ is the Helmholtz potential (or Helmholtz free energy), and is the function of the system's state variables which is minimized in equilibrium in the canonical ensemble.  The corresponding entropy is
$$S/k = \sum_\mu \mathscr P_C(\mu) \big(E(\mu) - F\big)/kT = \big(\langle E\rangle - F\big)/kT$$
$$\implies F = \langle E\rangle - TS$$
where $\langle E\rangle\equiv \sum_{\mu\in \mathcal M} \mathscr P_C(\mu) E(\mu)$ is the ensemble average energy.

Now consider a system of particles which has a fixed volume, but which may exchange energy with a reservoir of particles and energy at temperature $T$ and chemical potential $\lambda$.  In this case, not all microstates $\mu\in \mathcal M$ have the same energy or the same number of particles. The probability distribution which maximizes the total entropy of the system + the reservoir is given by
$$\mathscr P_{GC}(\mu) := \frac{e^{-\big(E(\mu)-\lambda N(\mu)\big)/kT}}{\mathcal Z} \qquad \mathcal Z := \sum_{\mu\in \mathcal M} e^{-\big(E(\mu)-\lambda N(\mu)\big)/kT}$$
where $N(\mu)$ is the number of particles in the microstate $\mu$ and $\mathcal Z$ is the (grand canonical) partition function. This is called the grand canonical ensemble. As before, we define a function $\Omega(T,V,\lambda)$ such that $\mathcal Z=e^{-\Omega/kT}$; this is the grand potential.
The corresponding entropy is given by
$$S/k = \sum_{\mu\in \mathcal M} \mathscr P_{GC}(\mu) \big(E(\mu) - \lambda N(\mu)-\Omega\big)/kT = \big(\langle E\rangle - \lambda \langle N\rangle-\Omega\big)/kT$$
$$\implies \Omega = \langle E\rangle - TS - \lambda \langle N\rangle$$
where $\langle N\rangle:=\sum_{\mu\in \mathcal M}\mathscr P_{GC}(\mu) N(\mu)$ is the ensemble average particle number.

Finally, consider a system of particles which has a fixed particle number, but which may exchange energy and volume with a reservoir at temperature $T$ and pressure $p$.  It's odd to think of a system exchanging volume with a reservoir, but consider a cylinder with a piston exposed to atmospheric pressure.  The space above the system constitutes the "volume reservoir," and exchanging volume with the reservoir is just a strange way of saying that the gas in the cylinder expands or is compressed.
As may not be surprising, the probability distribution which maximizes the total entropy of the system + the reservoir is given by
$$\mathscr P_{NpT}(\mu) = \frac{e^{-\big(E(\mu) + p V(\mu)\big)/kT}}{\mathscr Z} \qquad \mathscr Z:= \sum_{\mu\in \mathcal M} e^{-\big(E(\mu) + p V(\mu)\big)/kT}$$
where $V(\mu)$ is the volume of the system in microstate $\mu$ and $\mathscr Z$ is the $(NpT)$ partition function.  This is the $NpT$-ensemble, also called the isothermal-isobaric ensemble. The corresponding potential $G(T,p,N)$ is the Gibbs potential.
The entropy of this ensemble is given by
$$S/k = \sum_{\mu\in \mathcal M} \mathscr P_{NpT}(\mu) \big(E(\mu) + p V(\mu) - G\big)/kT = \big(\langle E\rangle + p\langle V\rangle - G\big)/kT$$
$$\implies G = \langle E\rangle - TS + p\langle V\rangle$$
where $\langle V\rangle:=\sum_{\mu\in\mathcal M}\mathscr P_{NpT}(\mu) V(\mu)$ is the ensemble average volume of the system.

Which statistical ensemble you should use depends on the physical situation you are trying to model.  If you're modeling an isolated gas inside an insulating container, then you would use the microcanonical ensemble. If the walls of the box are not insulating so that energy can be exchanged with a heat bath at temperature $T$, then you would use the canonical ensemble.  If the gas container had a movable piston exposed to some external pressure, then you would use the $NpT$ ensemble.  And so on.
