# Difficulties deriving thermodynamic cycles from a partition function

How does one produces a thermodynamic cycle from a microscopic description? When I attempt to do so, I find that the priors of my equation of state are dependant upon the Lagrange multipliers and thus the two cannot be varied independently from one another. The flexibility of my cycles appears limited compared to what seems to be implied in the introductory literature on the subject.

For instance, let $$Q$$ be the set $$\{0,1\}$$ and let $$E$$ be the function $$E:Q\to\mathbb{R}$$, implemented (for simplicity) as $$E(q)=q$$ and let $$V$$ be the function $$V:Q\to\mathbb{R}$$ implemented as $$V(q)=q$$. Assume the statistical prior $$\overline{E}$$ and $$\overline{V}$$. Then, the probability distribution that maximizes the entropy is the Gibbs ensemble. In this case:

$$Z=\sum_{q\in Q}e^{-\beta ( E(q)-p V(q))}=e^{- 0}+e^{-\beta-\beta p}=1+e^{-\beta-\beta p}$$

where $$\beta$$ and $$p$$ are the Lagrange multipliers.

In this simple example, the priors $$\overline{E}$$ and $$\overline{V}$$ are:

$$\overline{E}=-\frac{1}{Z}\frac{\partial Z}{\partial \beta} = \frac{-1}{1+e^{-\beta-\beta p}} \left( -e^{-\beta-\beta p} \right)=\frac{e^{-\beta-\beta p}}{1+e^{-\beta-\beta p}}\\ \overline{V}=-\frac{1}{Z}\frac{\partial Z}{\partial p} = \frac{-1}{1+e^{-\beta-\beta p}} \left( -e^{-\beta-\beta p} \right)=\frac{e^{-\beta-\beta p}}{1+e^{-\beta-\beta p}}$$

The entropy, defined as $$S=k_B\left( \ln[Z]+\beta (\overline{E} + p \overline{V} ) \right)$$ is

$$S=k_B\ln[1+e^{-\beta-\beta p}]+k_B\beta \left( \frac{e^{-\beta-\beta p}}{1+e^{-\beta-\beta p}} \right)+k_B p\beta \left( \frac{e^{-\beta-\beta p}}{1+e^{-\beta-\beta p}} \right)$$

I would now like to draw various thermodynamic cycles over $$p$$, $$\overline{V}$$, $$\beta$$, $$\overline{E}$$ and $$S$$.

As an example, lets say I attempt to draw this cycle illustrated in the following image. It represents a very common example of a cycle involving $$p$$ and $$\overline{V}$$.

Let's look at the arrow going from 4 to 1. You will notice that $$\overline{V}$$ does not change over this line but $$p$$ does. However, since $$\overline{V}$$ does depend upon $$p$$ in the equation we just derived, how can that be? One thing that could happen is to use $$\beta$$ to cancel out the effect increasing $$p$$ has on $$\overline{V}$$? For instance, if we say that the temperature is increased to maintain the relation $$\beta-\beta p$$ constant as $$p$$ is varied, then $$\overline{V}$$ would remain constant. Is this the interpretation --- the second Lagrange-conjugate pair, in this case $$\beta$$ and $$\overline{E}$$, is used to offset the change that would normally occur in $$\overline{V}$$ as $$p$$ is increased?

Is it then correct to say that no cycle is possible over a thermodynamic system comprised only of $$\beta$$ and $$\overline{E}$$. For instance, the system described by:

$$Z=\sum_{q \in Q}e^{-\beta E(q)}$$

cannot admit a cycle over $$\beta$$ and $$\overline{E}$$ because there isn't a second conjugate-Lagrange pair to offset the changes on $$\overline{E}$$ as $$\beta$$ is varied?

Tl;dr

Is this the interpretation --- the second Lagrange-conjugate pair, in this case $$\beta$$ and $$\bar{E}$$, is used to offset the change that would normally occur in $$\bar{V}$$ as $$p$$ is increased? Yes

Your second system does not have any cycles in the $$(\beta, \bar{E})$$ plane. There may be other relevant parameters to the system though.

Quick Review of Canonical Ensemble

Lets consider the ensemble with only one Lagrange multiplier pair. There is some quantity $$E$$ and a measured mean value $$\bar{E}$$. The probability of each state $$\alpha$$ is:

$$p_\alpha = \frac{1}{Z(\beta)} e^{-\beta E_\alpha}$$

where $$Z(\beta)$$ is fixed by the normalisation requirement and for a given $$\bar{E}$$ the equation $$\sum p_\alpha E_\alpha = \bar{E}$$ can be solved for $$\beta$$. Thus there is a bijection $$\beta= \beta(\bar{E})$$. So you can't have 'cycles' in an $$(\beta,\bar{E})$$ plane because it would just be a single-valued curve. However, in the usual systems people study, the energy function has parameters:

$$E(\text{parameters}): \alpha \mapsto E_\alpha(\text{parameters})$$

the most simple example is an ideal gas, whose energy levels are fixed by the container's volume. In this example, we derive all of thermodynamics for some arbitrary volume $$V$$, and then we get the conjugate variable $$p$$ by $$p=\left(\frac{\partial\bar{E}}{\partial V}\right)_\beta$$. We can now have cycles in the $$(p,\beta)$$ plane for instance because we now have two things we can tune about the system: the mean energy $$\bar{E}$$ and the volume $$V$$. Any choice of a pair $$(\bar{E},V)$$ fixes the quantities $$(\beta,p)$$ but this still gives a 2 dimensional configuration space.

Gibbs Ensemble

This is basically as above, but the interpretation of $$V$$ is no longer a parameter fixing the energy levels but a completely separate function of the state. We introduce $$p$$ now as a Lagrange multiplier. Again, the requirement that $$\sum p_\alpha E_\alpha = \bar{E}$$ and $$\sum p_\alpha V_\alpha = \bar{V}$$ fixes the Lagrange multipliers to their equilibrium values. Thus there is again a two dimensional configuration space because knowing $$\bar{E}$$ and $$\bar{V}$$ the other two parameters are determined.

In the Gibbs Ensemble I think you could have $$(\beta,\bar{E})$$ cycles that aren't possible in the canonical ensemble. That just means that its possible to arrange the two functions $$E: \alpha \mapsto E_\alpha$$ and $$V: \alpha \mapsto V_\alpha$$ such that $$E_\alpha$$ cannot be written as a function of $$V_\alpha$$ (perhaps by making one function multi-valued). This would obviously make the canonical formalism outlined above inappropriate.