The Grand Canonical Ensemble

Chapter 22 extends our model to allow particle exchange alongside energy flow, diving into the grand canonical ensemble where both energy and particle number can fluctuate.

Now in Chapter 22, we’re extending the concept. We’re going to extend the model we’ve been playing with up until now. The model we’ve been playing with so far basically was

Equation from the original notes

Like this, with everything kept as-is, only energy could flow in or out of the system.

But now, what we’re going to think about is allowing particle inflow and outflow too. For example, a situation like this

Equation from the original notes

2H_2 and O_2 are going to chemically bond (or might not), and if this makes the bond E rise, then energy is generated, which means we can view it as having raised the surrounding’s energy.

(Conversely, when a bond is broken, you could say the surrounding’s energy was used to break that bond, right? This is totally in the realm of chemistry.)

Ensembles: Canonical and Grand Canonical

Okay, okay — let me just sort out one term and move on. Up till now we’ve been

Equation from the original notes

looking at a situation like this, thinking, “Oh come on, what statistical analysis are you going to do with just one!” — “Let’s just say we have infinitely many things like that.”

Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes

…and on and on, out to infinity.

We need at least this many so that we can take measurements on each one, and then take the average over those measurements and discuss internal energy, entropy, Helmholtz, Gibbs, etc.!

So taking some system we want to know about and copy-pasting it infinitely many times, that is what we call an ensemble. And then we do statistical estimation on the ensemble.

But the ensemble above doesn’t allow particle inflow/outflow, only energy inflow/outflow. This kind of ensemble is called the Canonical ensemble!

But the extension of the model we’re doing now allows energy inflow/outflow… plus particle inflow/outflow too.

Equation from the original notes

Which means we copy-paste systems like these infinitely many times and do statistical estimation on them.

Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes Equation from the original notes

…and so on, forever.

This kind of ensemble is now called the Grand Canonical ensemble.

And from now on, to distinguish the energies when particle inflow/outflow is allowed from the ones pulled out in Canonical, I’ll use a subscript G.

So now, allowing particle inflow/outflow! Let’s get started.

Modifying the first law

So, as we extend the model, the very first task we have to do is modify our first law of thermodynamics (law of conservation of energy), which was dU = TdS - pdV. We also have to include information about the newly added variable, “particles flowing in and out.” First, let’s think about it simply like this.

Equation from the original notes

To a system that was like this,

Equation from the original notes

if O_2 enters, the internal energy of the system changes.

(I’m deliberately not saying clearly whether it goes up or down.)

And also, if one more O_2 enters, the energy will change by the same amount it just changed. And if yet another O_2 enters, the energy will change by the same amount it just changed.

Why does it change?!

Because any O_2 that entered is assumed to react without fail, and when it reacts, it’s either breaking existing chemical bonds~ or making new bonds~, and so it’ll either use energy from the surroundings or release energy to the surroundings. The point I want to make is that the internal energy changes due to chemical causes.

Okay, okay, so every time we added one, the energy kept changing by the same amount, right? That is, the change in internal energy is proportional to the number of particles that flowed in/out.

So in dU = TdS - pdV, if all the other existing variables are fixed, the thing causing the change in dU is dN (the change in the number of particles in the system). Therefore

Equation from the original notes

And now I think it’ll be fine logically to say that what μ means is the “chemical potential.” Also, in a situation where V and S are constant (dS=0, dV=0), since dU = μdN, let’s note too that this dU is the “changing of chemical Energy.”

(※Caution※ So, calling it chemical potential and explaining it that way might give you some kind of chemistry-ish conceptual impression, but if you go that way, things get harder. So let’s think of it like this:

“Chemical Potential → the amount of energy that changes due to a particle entering”

When a particle enters, the energy of the entire system might change due to a chemical reaction, but not only that — the energy of the entire system might change due to the kinetic energy of the particle that entered?! Keep this in mind and keep going!)

You should be convinced of the modification to the first law of thermodynamics. But, the thing we’ve been do~~ing all along…. Like, earlier

Equation from the original notes

we were able to define internal energy via the partition function like this.

Can we do that here too?!

Well, I’m sure we can. Just, Z is the partition function for a system where only energy flows in/out, and since we’re now allowing particles to flow in/out too, we’d have to define the partition function differently. And the partition function for a system that allows particle inflow/outflow is…

I’ll do that later.

The second law of thermodynamics

Now that we’ve seen the first law of thermodynamics, I think this time we should head toward the second law of thermodynamics. First, the equation we built

Equation from the original notes

let me rewrite this as an equation for entropy.

Equation from the original notes

Now here’s the thing: looking at the equation above, you can say

“Aha! So S, as a state function, is a function defined by three independent variables, U_G, V, N!”

And then, viewing S purely mathematically as a three-variable function S(U_G, V, N), if we express the change dS as a partial differential equation,

Equation from the original notes

we can write it like this, right?! And if we compare this equation with our original equation

Equation from the original notes

and match them up,

Equation from the original notes

we can write it like this! These equations are needed relations when deriving the Grand partition function, so even though it’s a hassle, I derived them.

Those things above… I derived those relations without much thought, but let me check that they’re physically valid and then move on. I’ll confirm that the existing second law of thermodynamics, namely that dS ≥ 0 holds.

Equation from the original notes

Let’s say two systems each have V and N fixed and can only exchange heat.

(This is using the grand canonical equation in the canonical case… it’ll obviously hold… but let’s follow the logic anyway.)

S is definitely a function of U,V,N, but since V and N are fixed, it will only be affected by changes in U, so expressing dS as a partial differential equation, system 1’s change in S is

Equation from the original notes

system 2’s change in S is

Equation from the original notes

Total is

Equation from the original notes

But since the law of conservation of energy must clearly hold,

Equation from the original notes

Equation from the original notes

Equation from the original notes

Equation from the original notes

since we had this,

Equation from the original notes

The red is positive, positive (temperature can’t be negative, absolute temperature K).

Equation from the original notes

This has to hold, so let’s go through it step by step!

Equation from the original notes

If this, that is if T_2 is the higher temperature, then for the inequality to hold, dU_1 > 0 is required.

Oho, so if system2’s temperature is higher, system1 has to receive energy?! And if it’s the opposite situation, for the inequality to hold dU_1 < 0, so system1 has to lose energy?!

Aha — energy (heat) flows from higher temperature to lower temperature!

It comes down to Clausius’s expression of the second law of thermodynamics!

(The reason all of this is obvious is that we said dN=0, so it’s the same as playing with the equation dU=TdS-pdV. That is, the message I want to get across is that the grand canonical is the more general expression?! Something like that.)

Now let’s say N changes. Instead, let’s say U and V are fixed on both sides. And let’s say it’s a situation where they can only exchange particles with each other.

Equation from the original notes

S is definitely defined as S(U,V,N) with these three variables, but since we said U,V are constant, the entropy value will only be affected by changes in N. Therefore

Equation from the original notes

and

Equation from the original notes

Let’s go straight to the total

Equation from the original notes

Here, energy conservation is already baked into our assumptions so it doesn’t work as a constraint, so let’s use particle-number conservation as the constraint.

Equation from the original notes

Equation from the original notes

Therefore,

Equation from the original notes

Equation from the original notes

so,

Equation from the original notes

And for the law of entropy increase to hold,

Equation from the original notes

this has to hold. Alright, and here let’s look at the state of thermal equilibrium.

(Don’t worry, many chemistry experiments are done in thermal equilibrium, right?)

Equation from the original notes

If this inequality has to hold, then if μ_2 is bigger than μ_1, dN_1 is positive, that is, particles flow from system2 to system1, and if it’s the situation where μ_1 is bigger than μ_2, dN_1 is negative, that is, it means particles flow from system1 to system2.

That is! We can see that particles flow from the side with higher chemical potential to the side with lower chemical potential.

(Later, when we sort out that the chemical potential is the Gibbs function per particle,

Equation from the original notes

and then apply the Gibbs function minimization principle, the statement above can hit home more.)

Just like how heat flows from high to low temperature, this is a summary of how particles flow according to chemical potential, so it seems important.

Sorting out F and G

From here on, we’re going to sort out F and G. Once we sort out F and G, the summary above fully hits home. It won’t be too late to shout make sense! at that point.

In the Grand Canonical ensemble,

Equation from the original notes

and

Equation from the original notes

let me sort these out.

When we don’t allow particle inflow/outflow, F was defined as F = U-TS.

Equation from the original notes

So how should we handle this?!

Well….

Equation from the original notes

that’s how it’d go.

(The Helmholtz function F means the free energy or potential in a situation where T,V are constant, so this is valid.)

Then

Equation from the original notes

is

Equation from the original notes

(Right now I’m not defining the function itself, I’m defining the ‘change’ of the function. Don’t get this mixed up.)

Likewise, for the Gibbs function, when particle inflow/outflow isn’t allowed

Equation from the original notes

it was this. Then

Equation from the original notes

for this

Equation from the original notes

it would be this, so its change is

Equation from the original notes

Again! And again, and again, and again… I’ll employ the technique I’ve been using.

Equation from the original notes

and

Equation from the original notes

let’s think of these purely mathematically as three-variable functions and express each function’s change as a partial differential equation!

Equation from the original notes

So, everything else aside, what we need to squeeze out is

Equation from the original notes

this! This isn’t being used super importantly right now. But this relation will be used later. Ugh.

(sigh… this is why thermodynamics is hard…)

So anyway, I just scribbled it out mathematically so the meaning might not hit home, but it’s just this.

Equation from the original notes


Heads-up. The figures here are the original notes, slips and all. A few things to watch for:

  • The last picture has two slips: the $d(pV)$ term takes a plus sign, and $\mu\,dN$ is already part of $dU$. So $dF = dU - d(TS) = -S\,dT - p\,dV + \mu\,dN$ and $dG = dU - d(TS) + d(pV) = -S\,dT + V\,dp + \mu\,dN$.

Comments

Discussion happens via GitHub Discussions. You'll need a GitHub account to comment.