# Calculating particle numbers in diffusive equilibrium of a battery

baseballfan_ny
Homework Statement:
Two identical systems ##S_1## and ##S_2## are both in thermal contact with a large reservoir and in diffusive contact with one another. For both systems, the free energy F is related to the particle number N by ##F = cN^2##, where c is an N-independent constant (the same constant
for both systems).
(a) A battery maintains a chemical potential difference ##\Delta = \mu_{2,ext} − \mu_{1,ext} > 0 ## between the two systems. In diffusive equilibrium, find the number ##N_1## of particles in ##S_1## and the number ##N_2## of particles in ##S_2##, expressed in terms of ##\Delta##, c, and the total particle number ##N = N_1 + N_2##.
(b) Now the battery is disconnected, and useful work is extracted isothermally as the particles flow slowly from ##S_1## to ##S_2## until diffusive equilibrium is reestablished. How much work is
extracted?
Relevant Equations:
## \mu = \frac {\partial F} {\partial N}_{T, V} ##
So I think I have the principles mixed up here because I'm getting kind of "circular" answers.

## N = N_1 + N_2##
##dN## = 0 bc/ particle number fixed so ##dN_1 = -dN_2##
##F = cN^2 = c(N_1 + N_2)^2##

In diffusive equilibrium, free energy would be minimized and chemical potentials equal...

$$dF = \frac {\partial F} {\partial N_1}_{T, V} dN_1 + \frac {\partial F} {\partial N_2}_{T, V} dN_2 = 0$$

$$dF = (2cN_1 + 2cN_2)dN_1 - (2cN_1 + 2cN_2)dN_1 = 0$$

$$(N_1 + N_2) = (N_1 + N_2)$$ which is useless

I also tried proceeding from chemical potential equilibrium...
$$\mu_1^{total} = \mu_2^{total}$$
$$\mu_{1,int} + \mu_{1,ext} = \mu_{2,int} + \mu_{2,ext}$$
$$\mu_{1,int} − \mu_{2,int} = \mu_{2,ext} − \mu_{1,ext} = \Delta$$

And then I believe ## \mu_{1, int} = \frac {\partial F} {\partial N_1}_{T, V} = (2cN_1 + 2cN_2)## and ## \mu_{2, int} = \frac {\partial F} {\partial N_2}_{T, V} = (2cN_1 + 2cN_2)## ... so I get ## 0 = \Delta##? I know I've got the principles mixed up somehow or another here...

Homework Helper
Gold Member
2022 Award
Homework Statement:: ...For both systems, the free energy F is related to the particle number N by ##F = cN^2##, where c is an N-independent constant (the same constant for both systems).
:
##F = cN^2 = c(N_1 + N_2)^2##
The way I read this, they mean that for each system its free energy is given by ##F_i = cN_i^2##. Otherwise why not just say the free energy of the whole system is constant?

baseballfan_ny
The way I read this, they mean that for each system its free energy is given by ##F_i = cN_i^2##. Otherwise why not just say the free energy of the whole system is constant?
Makes sense. But I'm still getting ##\Delta = 0## and I think I'm a bit confused on the distinctions between internal and external chemical potential.

So for minimizing the free energy, I'm doing this:
$$dF = \left( \frac {\partial F_1} {\partial N_1} \right)_{T,V} dN_1 + \left( \frac {\partial F_2} {\partial N_2} \right)_{T,V} dN_2 = 0$$
$$2cN_1 dN_1 + 2cN_2(-dN_1) = 0$$
$$N_1 = N_2$$
I suppose when I take ## \left( \frac {\partial F_1} {\partial N_1} \right)_{T,V} ## or ## \left( \frac {\partial F_2} {\partial N_2} \right)_{T,V} ## I'm getting the total chemical potential of each system ... ##\mu_{1, int} + \mu_{1, ext} ## and ##\mu_{2, int} + \mu_{2, ext} ## respectively. Well, I'm actually not sure about that one. Maybe each partial of the free energy wrt to N is just the internal chemical potential... since I don't think Free Energy accounts for external energy?

When I come to set the total chemical potentials equal (I believe this is the condition for diffusive equilibrium... chemical potentials are equal so the particle numbers in the system don't need to change), I've gotten myself confused on internal and external chemical potentials again.
$$\mu_1^{total} = \mu_2^{total}$$
$$\mu_{1,int} + \mu_{1,ext} = \mu_{2,int} + \mu_{2,ext}$$
$$\mu_{1,int} − \mu_{2,int} = \mu_{2,ext} − \mu_{1,ext} = \Delta$$
$$2cN_1 − 2cN_2 = \Delta$$
$$N_1 - (N_1) = 0 = \frac { \Delta } {2c}$$
Here I took the internal chemical potential of each system to be the partial of free energy wrt to particle number ... and I got ##\Delta = 0##. Since the problem states ##\Delta > 0##, how should I get the actual internal chemical potential of each system?

Homework Helper
Gold Member
2022 Award
Since a battery is maintaining a potential difference, is the total energy necessarily minimised?
In my utter ignorance of the subject, I would have guessed it was ##\Delta=cN_2^2-cN_1^2##.
@Chestermiller , is this something you can advise on?

baseballfan_ny
I just thought of another idea if anyone else is able to help... maybe when the problem states the system should be in diffusive equilibrium, it means just diffusive equilibrium and not thermal equilibrium so the potential difference could be a part of some sort of thermal imbalance? (actually not confident about this, because I think the potential difference is a part of an external chemical potential). How can a system have a non-zero difference in external chemical potential and yet be in diffusive equilibrium?

Edit: Ok actually I suppose it is possible to be in diffusive equilibrium with ##\mu_{2, ext} - \mu_{1, ext} ## being non-zero. I guess the way to solve this question is to use the diffusive equilibrium condition I wrote in the 2nd part of Post 3, and use ##\mu_{1, int} - \mu_{2, int} = \Delta ##. I think my problem is I incorrectly computed ##\mu_{1, int}## and ##\mu_{2, int}## from the Free energy (maybe I calculated ##\mu_{1, total}## and ##\mu_{2, total}## instead, which would definitely have a difference of 0 at diffusive equilibrium). So my question is what's the proper way to calculate ##\mu_{1, int}## and ##\mu_{2, int}##?

Homework Helper
Gold Member
2022 Award
I did not understand the last part of your post #3.
Having got this:
$$2cN_1 − 2cN_2 = \Delta$$
why not just use ##N=N_1+N_2## to find ##N_1, N_2##?

• baseballfan_ny
baseballfan_ny
I did not understand the last part of your post #3.
Having got this:

why not just use ##N=N_1+N_2## to find ##N_1, N_2##?
Oh gosh, was it really that simple? lol.

Then I get ##N_1 = \frac {N} {2} + \frac {\Delta} {4c}## ##N_2 = \frac {N} {2} - \frac {\Delta} {4c}##.

I still must have done something wrong when minimizing free energy in the first part of Post 3, because that gave me ##N_1## = ##N_2##.