Calculating entropy for a simple scenario

AI Thread Summary
The discussion centers on modeling the thermodynamics of an ideal gas in two separate rooms and calculating entropy as the gas equilibrates after a partition is removed. The initial challenge is that the simulation is deterministic, focusing on individual molecules, which complicates the introduction of probability necessary for entropy calculations. Participants suggest that to estimate entropy, one might need to run multiple simulations with varied initial conditions to create a probability distribution of microstates. However, defining entropy during non-equilibrium states remains problematic, as current textbooks do not provide a standard definition for such scenarios. Ultimately, the conversation highlights the complexities of calculating entropy in real-time during dynamic processes rather than just at equilibrium states.
zrek
Messages
115
Reaction score
0
I'd like to create a simple model that demonstrates the basic values of thermodinamics of an ideal gas. I begin with two rooms, several molecules in them. Every data of every individual molecule is given (position, mass, speed, etc), so I can easily calculate the total energy, pressure, temperature. Now I open up the small door between the two rooms and I can easily model how the molecules mixing, causing the two rooms finally balancing their temperature and pressure.
But I have problems with calculating the entropy. Can you please help me?
Is there a formula for this? (If it is necessary, we can say that the available positions of the molecules are limited)
Thanks in advance.
 
Science news on Phys.org
zrek said:
But I have problems with calculating the entropy.

The concept of entropy can be related to probability, which in turn, applies to probability spaces defined over the "possible" microstates of a system. If you are simulating a deterministic system to the level of detail of simulating the position and velocity of each particle, you haven't introduced any idea of probability. At a given time in the simulation, the system would be in one particular microstate, so this does not account for any concept of it having a probability for being in each of several "possible" microstates.

You need to introduce the idea of probability. You might be able to do this by running many simulations that begin with some random variation in the initial conditions. Then at time T, the system might be in a different microstates on different runs. You could estimate the probability that the system was in a certain microstate by the frequency that it appeared in that microstate on different runs of the simulation.
 
Stephen Tashi said:
The concept of entropy can be related to probability (...). You might be able to do this by running many simulations that begin with some random variation in the initial conditions.
Thank you for your answer.
As far as I know, the probability calculations are (in nutshell) about the ratio of the all possible states and the desired result. This can be done even in deterministic scenarios: I don't have to run many simulations if I can calculate all of the possible ones. This is why I mentioned some limit for the molecule positions (and other property values). If we assume that it is possible to calculate for a scenario, can you suggest a formula that gives a concrete number for entropy?
 
zrek said:
As far as I know, the probability calculations are (in nutshell) about the ratio of the all possible states and the desired result.
That only works if all possible states have the same probability.

You describe doing a deterministic simulation down to the level of individual gas molecules and apparently you want to compute entropy as a function of time. That is not a typical textbook problem in thermodynamics (as far as I know). The textbook problem would only ask us to find the change in entropy between the initial state and the state where the gases have reached equilibrium.

You are describing a system that is not in equilibrium. If the Wikipedia can be believed (
https://en.wikipedia.org/wiki/Non-equilibrium_thermodynamics ) :

Another fundamental and very important difference is the difficulty or impossibility in defining entropy at an instant of time in macroscopic terms for systems not in thermodynamic equilibrium.[1][2]

So we may be out of luck. Perhaps we can define entropy in microscopic terms if we introduce probability into the model. I'll have to think about it.
 
Let me understand your question. You have two chambers, with a partition between them. You have the same gas in each chamber. You know the volumes of the two chambers. And you know the initial temperatures and pressures of the of the gas in each of two chambers. Now you remove the partition, and let the system re-equilibrate adiabatically. You want to know the change in entropy from the initial state of the system to the final equilibrated state of the system. Is this correct? Are you allowed to use classical thermodynamics?
 
Net increase in entropy will be zero , since the intermixing of molecules are done in adiabatic condition , and all the position, velocity etc are known,and sum of the heat transfer will be zero , the change in entropy will be zero
 
malemdk said:
Net increase in entropy will be zero , since the intermixing of molecules are done in adiabatic condition , and all the position, velocity etc are known,and sum of the heat transfer will be zero , the change in entropy will be zero
Is this supposed to be the answer to the problem that I posed in post #6? If so, it is totally incorrect. Here is a link to a Physics Forums Insights article I wrote on how to correctly determine the entropy change for a process imposed on a closed system: https://www.physicsforums.com/insights/grandpa-chets-entropy-recipe/ See if you can figure out how to apply the recipe to this problem.
 
Chestermiller said:
Let me understand your question. You have two chambers, with a partition between them. ... You want to know the change in entropy from the initial state of the system to the final equilibrated state of the system. Is this correct? Are you allowed to use classical thermodynamics?
Yes, you described correctly what I want to do. I'd like to create a starting state with no equilibrium, different temperatures and pressures in the chambers, and watch what happens after I open the door. During the process while the termperatures balancing, I'd like to draw a graph with the values of the key properties: pressure, temperature ... and entropy. As far as I know, the entropy should increase. Since I can calculate the temperature and the pressure directly form the data of the particles, I'd like to do the same with the entropy. But I have no idea how to calculate it. Thank you for your help!
 
Stephen Tashi said:
So we may be out of luck. Perhaps we can define entropy in microscopic terms if we introduce probability into the model. I'll have to think about it.
Then it is not possible to calculate the entropy during a process in a simulated environment? There is no concept at all for problems like this?
Stephen Tashi said:
I'll have to think about it.
Thank you! I'd be happy if you have a good idea. A concrete modell with a simulation would make anyone understand the entropy better, I think.
 
  • #10
Are you willing to go to a continuum model? If so, you can get the transition of the entropy.

So you are able to get the entropy in the final state, correct?
 
  • Like
Likes malemdk
  • #11
zrek said:
Then it is not possible to calculate the entropy during a process in a simulated environment?

For the sake of your other advisors, let's be clear that you want to

1) Model the gas as a finite number of particles
2) Compute entropy as a function of time - i.e. not merely compute the 2 numbers that give the entropy before the gases mix and the entropy after the gases have mixed and reached an equilibrium state.

For now, I leave the difficulties of 1) to you. (They including finding algorithms to determine when particles collide in the simulation.)

There is no concept at all for problems like this?

As far as I know, current textbooks do not provide any standard definition for the entropy of a system that applies to times when the system is going through states of non-equilibrium. It wouldn't surprise me if people have written papers proposing various definitions in that case. We'd have to search for such papers.

So, yes, the first difficulty of 2) is to define entropy for your simulation.

There are two basic approaches to defining entropy. One approach is "Shannon entropy", also known as "Information Entropy". This approach requires having a probability distribution. In thermodynamics, the entropy of a system can defined in terms of Shannon entropy by using a probability distribution for the system being in various possible microstates. However, at a given time t, your simulation is a single microstate - namely the microstate that specifies the positions and momenta of each of the particles. So you don't have a non-trivial probability distribution for the system being in several different microstates.The other approach to defining entropy is thermodyamic entropy, which defines it by a differential equation.
e.g.
##t## time
##U(t)##: total energy of the system at time t
## T(t)##: temperature of the system at time t
## P(t)##: pressure of the system at time t
## V(t)##: volume of the system at time t

The defining equation for entropy ##S(t)## is ##U'(t) = T(t) S'(t) - P(t) V'(t)##

However, there are difficulties in defining some of these quantities for non-equilibrium situations. Consider the concept of "Volume of the system at time t". Take an extreme case where the system consists of 3 particles. Suppose they are within cube that is 1 meter on a side.

What is the "Volume of the system"? At a given time, you could fit the 3 particles in a triangular shaped thin box with each particle in one corner of the box. Is the "Volume of the system at time t" equal to the volume of this thin box? - Or is the "Volume of the system" equal to the volume of the 1 meter cube?

The concept that a 1 meter cube is the "Volume of the system" makes sense if the system consists of particles uniformly distributed throughout the cube. So "Volume of the system" becomes unambiguous when we are considering an equilibrium situation.
 
  • #12
Consider the two room filled with few particles, let's 10, them how we will entropy?
 
  • #13
Chestermiller said:
Are you willing to go to a continuum model? If so, you can get the transition of the entropy.
What do you mean on "continuum model" exactly? The Holtsmark-continuum model for example? Or you mean the way of continuum mechanics? I guess I'd prefer a way to calculate directly from the data of the given, discrete particles. But if there is an easy and correct way to map the states of particles to a continuum model, then I'd accept it also, if it leads to a numeric representation of entropy.
 
  • #14
Stephen Tashi said:
1) Model the gas as a finite number of particles
2) Compute entropy as a function of time - i.e. not merely compute the 2 numbers that give the entropy before the gases mix and the entropy after the gases have mixed and reached an equilibrium state.
From your words I assume that you know the way how to calculate "the 2 numbers that give the entropy" form the given finite number of particles. If this is the true, I also would be happy to know this.

Stephen Tashi said:
For the sake of your other advisors, let's be clear that you want to

##t## time
##U(t)##: total energy of the system at time t
## T(t)##: temperature of the system at time t
## P(t)##: pressure of the system at time t
## V(t)##: volume of the system at time t

The defining equation for entropy ##S(t)## is ##U'(t) = T(t) S'(t) - P(t) V'(t)##

I like your approach, the simple formula may work. I think, in case of ideal gases, the ##U(t)## is constant. ## V(t)## also constant, gases do not occupy a fixed volume, but expand to fill whatever space they can, don't they? However from the formula ##U'(t) = T(t) S'(t) - P(t) V'(t)## I can't get a concrete value for S(t), only its rate of change, right?

Stephen Tashi said:
For the sake of your other advisors, let's be clear that you want to
... "Shannon entropy", also known as "Information Entropy". This approach requires having a probability distribution. In thermodynamics, the entropy of a system can defined in terms of Shannon entropy by using a probability distribution for the system being in various possible microstates. However, at a given time t, your simulation is a single microstate - namely the microstate that specifies the positions and momenta of each of the particles. So you don't have a non-trivial probability distribution for the system being in several different microstates.
The probability is easy to calculate from the following concept:
With closed doors, there are several particles in the first chamber and there are others in the second. Their macrostate is represented by their all possible microstate in this situation, knowing that their exact position in the actual chamber is irrelevant. Now if we open the door, we have to count all of the possible positions of the particles, and compare this number to the number of states in which the same number of particles are in the very same chambers. This gives the probability distribution of microstates for a given macrostate. But how to calculate a concrete number for entropy from this probability (ratio)?
 
  • #15
zrek said:
What do you mean on "continuum model" exactly? The Holtsmark-continuum model for example? Or you mean the way of continuum mechanics?
The latter.
I guess I'd prefer a way to calculate directly from the data of the given, discrete particles. But if there is an easy and correct way to map the states of particles to a continuum model, then I'd accept it also, if it leads to a numeric representation of entropy.
So you are talking about using molecular dynamics, right?

In your original post, I got the feeling you were looking for a simple example of a problem that could illustrate the evolution of the entropy vs time for a system experiencing an irreversible change. Is this correct? If so, would a simpler system be acceptable, or does it have to be the ideal gas example.
 
  • #16
zrek said:
From your words I assume that you know the way how to calculate "the 2 numbers that give the entropy" form the given finite number of particles.
No. I'm referrring to the 2 entropies that can be calculated from macroscopic parameters. Similar to Example 3 of https://www.physicsforums.com/insights/grandpa-chets-entropy-recipe/
I like your approach, the simple formula may work. I think, in case of ideal gases, the ##U(t)## is constant. ## V(t)## also constant, gases do not occupy a fixed volume, but expand to fill whatever space they can, don't they?

They don't expand to fill the space instantaneously. If you want to compute entropy as a function of time in the problem you described, you are dealing with times before the gases have had "filled whatever space they can".

The probability is easy to calculate from the following concept:
With closed doors, there are several particles in the first chamber and there are others in the second. Their macrostate is represented by their all possible microstate in this situation, knowing that their exact position in the actual chamber is irrelevant. Now if we open the door, we have to count all of the possible positions of the particles, and compare this number to the number of states in which the same number of particles are in the very same chambers. This gives the probability distribution of microstates for a given macrostate.
No. Counting the possibilities is unrelated to computing probability unless you can define the microstates so each microstate has the same probability of being occupied. How do you intend to define the microstates?
 
  • #17
zrek said:
I'd like to create a simple model that demonstrates the basic values of thermodinamics of an ideal gas. I begin with two rooms, several molecules in them. Every data of every individual molecule is given (position, mass, speed, etc), so I can easily calculate the total energy, pressure, temperature. Now I open up the small door between the two rooms and I can easily model how the molecules mixing, causing the two rooms finally balancing their temperature and pressure.
But I have problems with calculating the entropy. Can you please help me?
Is there a formula for this? (If it is necessary, we can say that the available positions of the molecules are limited)
Thanks in advance.

From a pure classical thermodynamic point of view, there is no answer to your question because entropy is defined for equilibrium states only. The situation you describe is a succession of non-equilibrium states and classical thermodynamics cannot address it.

Statistical mechanics can allow you to calculate the difference in free energy (and hence also the difference in entropy) between the initial and final states even if the path that leads between them is a non-equilibrium one. The mixing process you describe is a non-equilibrium path. Using many molecular dynamics simulations and Jarzynski equation, you can compute the difference in free energy and consequently entropy. But you need to run many simulations to get a good ensemble average.

In order to get a time-dependent evolution of entropy, one needs a non-equilibrium definition of entropy. I think you can find such definitions in literature, but I'm not familiar with them and I'm not sure how useful they can be.
 
  • #18
Stephen Tashi said:
They don't expand to fill the space instantaneously. If you want to compute entropy as a function of time in the problem you described, you are dealing with times before the gases have had "filled whatever space they can".

I don't mind if the expansion is not instantaneous. It is perfect also if it is not instantaneous, but much faster then that my time resolution scale requires. In a computer simulation I can't give exact numbers for the other values too for every single moment, but I can calculate them with approximations, for example even with simple linear interpolation.
For example if there are several particles, they sometimes hit the wall of the chamber. I can't calculate the pressure value for every moment (or step) as the particles moving, but I can count continously how many particle hits a given area of the surface of the chamber for the last time section, so in a less exact time scale with a linear interpolation I can get pretty good result for the pressure. By this method I can state that the movement of the particles is so quick, that for the next analysed step of time the gas clearly fills the space, and this is a very good approximation.
Stephen Tashi said:
No. Counting the possibilities is unrelated to computing probability unless you can define the microstates so each microstate has the same probability of being occupied. How do you intend to define the microstates?

I can map any actual configuration of the microstates of the particles to a macrostate. I can also define what and how many microstate configuration is equal for any macrostate. Isn't this enough? For example I can count how many particles are in one chamber and how many are in the other. I can also calculate how many possible microstate configuration results the same macrostate. I can clearly give a probability percentage for this current state compared to the all possible microstate configurations. For example I can calculate that "the current state have 35% chance to exist", and for sure I'll get the a maximum percentage if there are same number of particles in the two chambers. Isn't this percentage convertable to entropy somehow?
 
  • #19
Chestermiller said:
... you were looking for a simple example of a problem that could illustrate the evolution of the entropy vs time for a system experiencing an irreversible change. Is this correct? If so, would a simpler system be acceptable, or does it have to be the ideal gas example.
This is correct, the simplest system is acceptable as far as it can be modeled from deterministic microstates, since I'd like to run my modell in a computer. I'd like to see a number for entropy just like for the temperature and pressure, during the process. I haven't realized, but you got it right, it is my intension to create a spectacular demonstration of an irreversible change. (Thank you for making my intension clearer even for me :-) )
 
  • #20
Useful nucleus said:
... Using many molecular dynamics simulations and Jarzynski equation, you can compute the difference in free energy and consequently entropy. But you need to run many simulations to get a good ensemble average.
This sounds interesting. Could you give me a very simple example for the connection between the free energy and the entropy?
 
  • #21
zrek said:
I don't mind if the expansion is not instantaneous. It is perfect also if it is not instantaneous, but much faster then that my time resolution scale requires. In a computer simulation I can't give exact numbers for the other values too for every single moment, but I can calculate them with approximations, for example even with simple linear interpolation.
You're completely ignoring the point that the "volume of a gas" is not defined unless the gas is at equilibrium.

I can map any actual configuration of the microstates of the particles to a macrostate.
You don't understand the definition of a "microstate". One microstate of a gas specifies the position and momentum of each molecule in the gas. If you are simulating the particles of a gas then at a given time, the gas is in a single microstate. It isn't one particle that occupies a microstate. It is the whole gas.
 
  • #22
Stephen Tashi said:
You're completely ignoring the point that the "volume of a gas" is not defined unless the gas is at equilibrium.
Maybe you are right if we take this rigorously, but there is no gas in a real environment in which the gas is in perfect equilibrium. For example in my very room the air flows because of my breathe, causing turbulence, maybe there are even several microliters of vacuum in it. Still we can say that it is in general in a given volume, since at average it fills up the space. I wanted to say that when you open a (tiny) door between the chambers, then the slow (relatively to the movement of the particles) process of balancing have no rigorous effect on determining the volume, since the gas in the two chambers in average have specific, slowly changing macroparameters (pressure and entropy) that can be calculated. Maybe I'm wrong.

Stephen Tashi said:
You don't understand the definition of a "microstate". One microstate of a gas specifies the position and momentum of each molecule in the gas. If you are simulating the particles of a gas then at a given time, the gas is in a single microstate. It isn't one particle that occupies a microstate. It is the whole gas.
No, I understand this. I just mean that I can not only compute the actual microstate, but every time I can calculate every microstate and I can classify them. I can compare the current, single microstate to all of the possible ones, and draw conclusions, measure the probability. This method is similar to that if I run lots of simulations with random initial parameters, but better: I can map every possible states, and not only many of them.
 
  • #23
zrek said:
Maybe you are right if we take this rigorously, but there is no gas in a real environment in which the gas is in perfect equilibrium.
I agree. However, the thermodynamic laws that refer to "Volume" are based on a volume enclosing a gas in equilibrium. So for such laws to apply, the gas must at least be in an approximate equilibrium. For example, you can't claim ##U'(t) = T S'(t) - P V'(t)## if ## V(t) ## is the volume of a container enclosing a gas that is not in equilibrium. In the scenario you describe, a partition is removed between two gases at different pressures. So time elapses before the gas mix and reach equilibrium. If you are interested in what happens during the time the gases are mixing, you are trying to deal with a (very) non-equilibrium state of the gases.
No, I understand this. I just mean that I can not only compute the actual microstate, but every time I can calculate every microstate and I can classify them. I can compare the current, single microstate to all of the possible ones
It's unlikely that the gas in one run of your simulation will visit each possible microstate - if "possible" refers to those microstates that might be visited by gases that began in slightly different initial conditions. (There are lots of initial conditions that are consistent with the verbal description that two gases, "each at equilibrium" are in chambers separated by a partition.)

Those microstates that the gas does occupy during the non-equilibrium phase of the simulation will likely be visited only once. The idea of "microstate" is that it is a very fine division of the intervals of position and momentum.

Can you give an example of how you intend to define the microstates for a 3 particle system? Can you list four of the possible microstates?

Furthermore, at a given time (e.g. 2 seconds) the gas will be in a single microstate. If the gas is not in equilibrium then to simulate the a probability distribution for what microstate the gas is in at t = 2 seconds you would have run multiple repetitions of the simulation with different initial conditions in order to explore the possible microstates at t = 2 seconds.

The microstate the gas is in at t = 100 seconds is not valid data for the probability distribution for the microstates of the gas at t = 2 seconds unless the gas is in equilibrium from t = 2 seconds to t = 100 seconds.

(Which illustrates why a very useful consequence of equilibrium is the "ergodic" property . For example if the gas is in equilibrium from t = 2 to t = 100 seconds then data at any time in that interval does provide valid information about the probability distribution for the gas visiting various microstates at t = 2 seconds.)
 
Last edited:
  • #24
Stephen Tashi said:
I agree. However, the thermodynamic laws that refer to "Volume" are based on a volume enclosing a gas in equilibrium. So for such laws to apply, the gas must at least be in an approximate equilibrium. For example, you can't claim ##U'(t) = T S'(t) - P V'(t)## if ## V(t) ## is the volume of a container enclosing a gas that is not in equilibrium. In the scenario you describe, a partition is removed between two gases at different pressures. So time elapses before the gas mix and reach equilibrium. If you are interested in what happens during the time the gases are mixing, you are trying to deal with a (very) non-equilibrium state of the gases.
I try to understand what you mean and try to find a solution paralelly so I continue with questions if you don't mind, maybe you will have further ideas. (Thanks in advance)
So, in the initial conditions, with two separated chambers, I have clear volume values, each of the volumes of the chambers are 1 unit, total volume of the two separated gases are 2 units. (The particles have same properties, I use one type of gas molecules) Now I open the door between them. Say that the left chamber have higher pressure, so the gas flows from the left chamber to the right one. The total volume does not change. Isn't this information enough?
If not, then I assume you mean I have to calculate the two new volume values of the two gases. I'm sure that the sum of these values is 2 units. I have two options (at least):
1. As the time passes in tiny steps, I can simply make good approximation with regression, how the volume changes. During the process as much the left gas gain volume, the right gas loses the same amount, they "transfer" volumes. The pressure is known (I can count continously the hits on the wall of the chambers), by this I can say that if the pressure difference is big, then the volume "transfer" rate is higher, and later in the process the rate decreases, as the pressure balances.
2. I can easily follow every particle if necessary. As soon as I detect one particle stepping to the other chamber, I can say that particle shares the volume with those they were already there, with the ratio of the 1 to the number of the particles are already there. By this I can calculate the new volume values and next time when a new particle changes places, I can use it as base.

What do you think?
 
  • #25
zrek said:
I have clear volume values, each of the volumes of the chambers are 1 unit, total volume of the two separated gases are 2 units.
The volumes of the chambers are clear. But the volumes of the chambers don't make sense as the volumes of the gases after door is open and the gases begin to flow. Unless a gas uniformly fills a chamber, the "volume of the chamber" and the "volume of the gas" are not the same. In fact, if a gas does not uniformly fill a chamber, the "volume of the gas" has no standard definition.

2. I can easily follow every particle if necessary. As soon as I detect one particle stepping to the other chamber, I can say that particle shares the volume with those they were already there, with the ratio of the 1 to the number of the particles are already there.
I don't know what you mean by "shares the volume".

By this I can calculate the new volume values and next time when a new particle changes places, I can use it as base.

Perhaps if you give an example of that calculation, it will be clear what you mean.

The fact that you can do a calculation doesn't establish that the calculation has anything to do with the way "volume of a gas" is defined in thermodynamics. I agree that you can experiment with various calculations.

-----
You have not yet given an example of how you intend to define microstates.
 
  • #26
Stephen Tashi said:
In fact, if a gas does not uniformly fill a chamber, the "volume of the gas" has no standard definition.
...
The fact that you can do a calculation doesn't establish that the calculation has anything to do with the way "volume of a gas" is defined in thermodynamics.
If the "volume of the gas" have no standard definition for the situation, then you can't expect me to give one that is completely correct. This would be a scientific breaktrough :-)
However you are wrong if you state that I can't figure out a calculation that has anything to do with the way "volume of a gas" is defined in thermodynamics. In fact we know very much of it, we have clear limits and good way of approximations. Please do not simply ignore my logic. The upper limit is 2 units in the case I mentioned, since the volume of the gas can't be bigger than the volume of the chamber. Also, at the initial state we know for sure (because it fits perfectly to the standard definition you mentioned) that the volumes of each the gases are 1 unit. Also known that at the end of the process (since the molecules are the same) the volume of the two gases will be at the same ratio as the ratio of the number of their molecules. Also we know that the process is not instantaneous. During this process we can make good approximations for the volume changes for example by those two methods I mentioned.

Stephen Tashi said:
I don't know what you mean by "shares the volume".
Perhaps if you give an example of that calculation, it will be clear what you mean.
If there is a gas A in a chamber and you put in gas B, then they will share the volume. For sure, if the A and B gases have different particle with different behavior, we are in trouble to determine in which ratio they share the space. But if they have the same type of molecules, then we can make a good approximation if we say that the two gases share the volume by the ratio of their number of particles. It is easy to calculate. Isn't this a good approximation?

Stephen Tashi said:
-----
You have not yet given an example of how you intend to define microstates.
Currently I tried to answer in my other browser tab, but it takes more time, thank you for your patience.
 
  • #27
zrek said:
However you are wrong if you state that I can't figure out a calculation that has anything to do with the way "volume of a gas" is defined in thermodynamics. In fact we know very much of it, we have clear limits and good way of approximations. Please do not simply ignore my logic.
You will have to state the algorithm for the calculation before any logic can be evaluated.

The upper limit is 2 units in the case I mentioned, since the volume of the gas can't be bigger than the volume of the chamber. Also, at the initial state we know for sure (because it fits perfectly to the standard definition you mentioned) that the volumes of each the gases are 1 unit. Also known that at the end of the process (since the molecules are the same) the volume of the two gases will be at the same ratio as the ratio of the number of their molecules. Also we know that the process is not instantaneous. During this process we can make good approximations for the volume changes for example by those two methods I mentioned.
All that shows is that at the beginning of the process, your calculation of the volumes of the gases agrees with the thermodynamic definition and at the end of the process, when the gases have reached equilibrium the total volume of the mixed gases agrees with the thermodynamic definition. Any type of calculation that interpolated between those values could be called "logical" in that sense. If you reveal your formula , mathematics may prove that your interpolation is correct at the two extremes. But the logic of your argument doesn't explain why your particular way of interpolating a volume in between the extremes is better than any other way of doing it.

If there is a gas A in a chamber and you put in gas B, then they will share the volume. For sure, if the A and B gases have different particle with different behavior, we are in trouble to determine in which ratio they share the space. But if they have the same type of molecules, then we can make a good approximation if we say that the two gases share the volume by the ratio of their number of particles. It is easy to calculate. Isn't this a good approximation?
How would we judge if it was "good" approximation? I agree that we can select criteria for "good" and test if the approximation is good by those criteria. (For example, we could test the gas law PV = KT and see if the law was upheld by that definition of volume V. ) Without specific criteria, there is no way to tell whether you method is a "good" approxmation.
Currently I tried to answer in my other browser tab, but it takes more time, thank you for your patience.

Ok. This is an interesting discussion. Before this discussion, I didn't pay attention to the fact that the "thermodynamics" taught in textbooks is properly "equilibrium thermodyamics".
 
  • #28
Stephen Tashi said:
This is an interesting discussion. Before this discussion, I didn't pay attention to the fact that the "thermodynamics" taught in textbooks is properly "equilibrium thermodyamics".

I think also that this is interesting and I can learn from you. Finally it would be great if I can find a solution for my problem :-) Please don't be upset if I repeat myself, I just try to understand the things and find an acceptable way.

Before I continue, I'd like to know what do you accept or agree from my statements. Please classify my points one by one. The situation is the same I already described: two chambers, same type of molecules (every particle have the same speed and mass), same volumes, only the number of paricles are different, in the left chamber there is a higher pressure.
1. With the door closed, the total volume of the gases is 1+1=2 units, they are in equilibrium, and this fits to the standard definition. (agree or disagree?)
2. If we open the door, the volumes does not change instantaneously (so at the beginning the volume of the gases are 1 and 1 units even if the door is open) (agree or disagree?)
3. At the end, when the two gases mixed and reach the equilibrium, together their volume is also 2 units, they are in equilibrium, and this fits to the standard definition. (agree or disagree?)
4. During the process, the volume of gas from the left chamber increases, while the volume of the other gas decreases. (a or d?)
5. During the process the total volume of the gases are always 2 units. (a or d?)

Thank you!
 
  • #29
zrek said:
1. With the door closed, the total volume of the gases is 1+1=2 units, they are in equilibrium, and this fits to the standard definition. (agree or disagree?)
Agree - assuming the gases are each at equilbrium.
2. If we open the door, the volumes does not change instantaneously (so at the beginning the volume of the gases are 1 and 1 units even if the door is open) (agree or disagree?)
Agree
3. At the end, when the two gases mixed and reach the equilibrium, together their volume is also 2 units, they are in equilibrium, and this fits to the standard definition. (agree or disagree?)
Agree - the volume of the single gas that results from the combination of the two gases is 2 units.
4. During the process, the volume of gas from the left chamber increases, while the volume of the other gas decreases. (a or d?)
Disagree - because how we define the volume of gas in a non-equilibrium situation had not been decided. Particles from each chamber can go into the other chamber. So if we identify each gas by the particles originally in it, particles from the gas in the chamber initially at lower pressure chamber might go into the chamber that initially had the higher pressure chamber.
5. During the process the total volume of the gases are always 2 units. (a or d?)
Disagree - again because there is no established definition for the volume of a gas that is not in equilibrium.

Suppose we have chamber_A with a volume of 1 unit containing a gas and door that separates it from chamber_B that has a volume of 1,000,000 units and is empty. When the door is opened an a few molecules of gas go into chamber_B , are we to say the combined volume of the gases in each chamber is 1,000,001 units? The first few molecules of the gas that go into chamber_B might be nowhere near a wall of that chamber. At that time, what difference does it make whether chamber_B has a volume of 1,000,000 units or 20,000,000 units?

Consider a cloud (of water vapor) in the sky. How do you define its volume? Do you define it as the volume of the entire atmosphere because the atmosphere "contains" the cloud? Why should the volume of a chamber always have a direct relation to the volume of something within the chamber ?
 
  • #30
OK, then first I have to try to convince you about the disagreed ones before I can step forward.

4. During the process, the volume of gas from the left chamber increases, while the volume of the other gas decreases. (a or d?)

Stephen Tashi said:
Disagree - because how we define the volume of gas in a non-equilibrium situation had not been decided. Particles from each chamber can go into the other chamber. So if we identify each gas by the particles originally in it, particles from the gas in the chamber initially at lower pressure chamber might go into the chamber that initially had the higher pressure chamber.
You mentioned 2 things against it:
4.a: The volume of gas had not been decided in a non-equilibrium situation.
4.b: Particles from lower pressure chamber may go into the higher pressured one.

4.b is not a problem. It is clear that if we run a simulation, we will see that in average more particles will go from the higher pressured place than from the lower pressured one. In the point 4. I ment the volume increases and decreases in average.
Lets refine my statement, please answer (please don't forget that initially the only difference between the contents of the chambers is the number of the particles):
4.2: During the process more particles will go from the higher pressured place to the lower one than to the opposite direction. (a or d?)

4.a is not a real problem.
Please note that you agreed 3. and 2.
That means:
At the end of the process, the particles of the two gases mixed, occupy the available space with the same rights. Every single particle occupies the same amount volume partition in average (sorry for my bad english, I hope you understand what I mean). And since the number of the particles from the left chamber is higher, they occupy more space from the available 2 units. Since there is no other difference, also we can say that the ratio between the volume of the two gases is the same as the ratio between their number of particles. (For example if the left chamber contained 2000 particles and the right camber only 1000, then after the mixing, the total available 2 units of volume also shared between the gas molecules with 2:1 ratio)
At the beginig of the process the volume of the particles was exactly 1 unit from each of the chamber, 1:1 ratio (with opened door too).

I refine my statement here too (please note it is based on the point 2 and 3 that you already accepted)
4.1: At the beginning the gas from the left chamber had 1 unit volume, and at the end it had more. Also, at the beginning the gas from the right chamber had 1 unit of volume, but at the end it had less. This volume change was not happened instantaneously, but during the process. (a or d?)

Stephen Tashi said:
Suppose we have chamber_A with a volume of 1 unit containing a gas and door that separates it from chamber_B that has a volume of 1,000,000 units and is empty. When the door is opened an a few molecules of gas go into chamber_B , are we to say the combined volume of the gases in each chamber is 1,000,001 units? The first few molecules of the gas that go into chamber_B might be nowhere near a wall of that chamber. At that time, what difference does it make whether chamber_B has a volume of 1,000,000 units or 20,000,000 units?

Earlier I also was thinking about this situation, but simply ignored it, as it is an edge problem like the division by zero. But now you forced me to give an explanation.
If the first molecule comes out from the chamber, the main problem is not with the volume, but with the definition of gas. One molecule is not gas. For example one molecule of water can not be solid, fluid or gas. Also problematic to measure its temperature I think you also know why. But in our case it is not a problem. As I mentioned in my earlier post, we can wait until these parameters have meaning, when we can measure these. For example when the first few molecules reach the walls of the chamber_B, I can calculate the pressure in it. Our measuring time scale must fit to the processes of the changes of microstates: for the calculation of the macro values like temperature, pressure, we have to wait a lot compared to the quick movements of the particles. Can you accept this?
 
  • #31
zrek said:
4. During the process, the volume of gas from the left chamber increases, while the volume of the other gas decreases. (a or d?)You mentioned 2 things against it:
4.a: The volume of gas had not been decided in a non-equilibrium situation.
4.b: Particles from lower pressure chamber may go into the higher pressured one.

4.b is not a problem. It is clear that if we run a simulation, we will see that in average more particles will go from the higher pressured place than from the lower pressured one. In the point 4. I ment the volume increases and decreases in average.2

You are speaking as if "the volume" has been defined. It has not. If you want to say something about "the volume" of a gas that is not equilibrium, you need to state your definition of volume for that situation.

An "average" is defined for some population of things. What population are you talking about when you say "in average"?

Lets refine my statement, please answer (please don't forget that initially the only difference between the contents of the chambers is the number of the particles):
4.2: During the process more particles will go from the higher pressured place to the lower one than to the opposite direction. (a or d?)

Disagree.

Are you assuming the high pressure chamber must contain more particles? The high pressure chamber might contain fewer particles than the low pressure chamber. The pressure also depends on the velocity of the particles, not merely the number of particles.

4.a is not a real problem.
It is a real problem to speak of "the volume" when the gases are not in equilibrium. You have not yet defined it. The gases have a defined volume at the beginning and the end of the process when they are in equilibrium. That says nothing about the definition of volume in a non-equilibrium case.

Earlier I also was thinking about this situation, but simply ignored it, as it is an edge problem like the division by zero. But now you forced me to give an explanation.
If the first molecule comes out from the chamber, the main problem is not with the volume, but with the definition of gas. One molecule is not gas. For example one molecule of water can not be solid, fluid or gas. Also problematic to measure its temperature I think you also know why. But in our case it is not a problem. As I mentioned in my earlier post, we can wait until these parameters have meaning, when we can measure these.
If we wait to define volume then there is an interval of time when volume is undefined. Is that the plan?
 
  • #32
Stephen Tashi said:
You are speaking as if "the volume" has been defined. It has not. If you want to say something about "the volume" of a gas that is not equilibrium, you need to state your definition of volume for that situation.
It is defined, because I'm talking about the gas in equilibrium. I'm sorry if I can't wording clearly, please try to understand even if my english is poor.
In the sentence "During the process, the volume of gas from the left chamber increases, while the volume of the other gas decreases." I referred the "volume of gas from" as it was clearly defined in the beginning of the process. On the "increased" or decreased" I ment also the state when the gases were in equilibrium, since at the end they were also in equilibrium. In this sentence I analyse the gas volumes (in timestamps when standard definition apply), and try to make it clear that there are four mentionable possibilities:
p1: From the beginning to the end both of the gases keep their volume
p2: The gas from the left chamber will have bigger volume at the end (compared to its volume was at the begining) and paralelly the gas from the right one decreases
p3: The opposite of p2 (gas from the left decreases)
p4: Other thing happens (for example there is no connection between the properties of the two gases and how their volume changes)
I try to convince you that the p2 is the only logical scenario, even if the volume is not defined between the beginning and ending states, if we want to say something about the volumes, then p2 is the acceptable way for approximate calculations.

Stephen Tashi said:
An "average" is defined for some population of things. What population are you talking about when you say "in average"?
I referred to the population of the gas molecules originated from the chambers. And "on average" I referred to a timescale (may happen that for tiny intervals the volume changes irregulary, but as we increase the time steps, the irregularities "averages out"), so the most likely (statistically) change is that the volumes increases and decreases as I stated in the 4.

Stephen Tashi said:
Are you assuming the high pressure chamber must contain more particles? The high pressure chamber might contain fewer particles than the low pressure chamber. The pressure also depends on the velocity of the particles, not merely the number of particles.
Please read back, #28. We are in a scenario, when all of the particles have the same properties, same mass, same speed.
No can you agree this?
4.2: During the process more particles will go from the higher pressured place to the lower one than to the opposite direction. (a or d?)

Stephen Tashi said:
It is a real problem to speak of "the volume" when the gases are not in equilibrium. You have not yet defined it. The gases have a defined volume at the beginning and the end of the process when they are in equilibrium. That says nothing about the definition of volume in a non-equilibrium case.
I think you are wrong. We can say lot. If there is a non-instantaneous process and we have known beginning and ending values, then we can make good assuptions for the values between by analytic continuation. This method is a well accepted logical way in science.
https://en.wikipedia.org/wiki/Analytic_continuation
Since our simulation is deterministic, it is clear that between the two known and accepted volume values we can find a function that can give good approximate informations about the value changes properties. For example it can turn out that the function is strictly increasing, or whatever. Also the formula you mentioned helps: U′(t)=T(t)S′(t)−P(t)V′(t) -- this means the volume function is continuous and derivable during the process.

Stephen Tashi said:
If we wait to define volume then there is an interval of time when volume is undefined. Is that the plan?
It is normal in computer simulations. Only in edge cases and for tiny time intervals happens that the volume (and the other macro properties) can't be defined, and most of the time they can be approximated with interpolation, to make the function continous. For example I already described the method of how the pressure can be calculated during a simulation: we have to wait until several particle reach a wall, and the frequency of the hits and the known surface area gives the pressure in average. Isn't this method acceptable?
 
  • #33
zrek said:
p2: The gas from the left chamber will have bigger volume at the end (compared to its volume was at the begining) and paralelly the gas from the right one decreases

In the final equilibrium state the combined gas has a volume of two units.

Let us attempt to visualize the volumes of the two gases separately. Suppose the gas particles initially in chamber_A (of volume 1 unit) are colored red and gas particles initially in chamber_B (of volume 1 unit) are colored blue. In the final equilibrium state, we imagine that the red particles are uniformly distributed over both chambers. So if we consider the red particles as a gas, they have a volume of 2 units. Likewise the blue particles considered as a gas have a volume of 2 units.

You wish to say that the gas of red particles increases in volume and the gas of blue particles decreases its volume.
In each gas, the particles spread out as time passes. I don't understand how you intend to define "volume" of a gas so that the volume of a gas decreases when its particles spread out.
 
  • #34
Stephen Tashi said:
You wish to say that the gas of red particles increases in volume and the gas of blue particles decreases its volume.
I'm not sure: is it necessary at all to know what happens with the red and blue? I'm thinking on this only because I assumed from your earlier posts that this is necessary for the calculation of entropy.
Stephen Tashi said:
In each gas, the particles spread out as time passes. I don't understand how you intend to define "volume" of a gas so that the volume of a gas decreases when its particles spread out.
We can't even say that the red and blue are separated gases (and this is important, since the entropy calculated correctly if the particles are excangable). They have the same kind of molecules, mixed, and act mutually together for every calculations of the macro values like temperature and pressure. I tried to thinking on their future separatedly because I thought you mean this is necessary for the calculation of entropy.
If this is necessary, then I can try to visualize for you how I intend to define the volume of an already mixed gas.
For example imagine that the blue gas is not a gas, but a non-Newtonian fluid that stays in one body, does not keep its volume, can be compressed with the same energy-force-pressure behavior just like if it was a gas. This scenario result the same for the red gas as if the blue were gas, but they will never mix.
To calculate this new volumes (which at the end finally balances), I think it is a good way if we reserve volumes for each and every particles, and calculating just like I mentioned before, in #30: "Since there is no other difference, also we can say that the ratio between the volume of the two gases is the same as the ratio between their number of particles. (For example if the left chamber contained 2000 particles and the right camber only 1000, then after the mixing, the total available 2 units of volume also shared between the gas molecules with 2:1 ratio)" This analogy will result the proper volume and pressure at the end of the process. But if we are thinking like you mentioned "the red particles are uniformly distributed over both chambers" and "the red" and "the blue particles considered as a gas have a volume of 2 units", this will lead us nowhere (2+2=4).

I have an easier visualization.
Say that between the chambers there is no door, but a zero-mass piston, a wall that prevents mixing the gases. What if we calculate this way?
 
Last edited:
  • #35
zrek said:
I'm not sure: is it necessary at all to know what happens with the red and blue? I'm thinking on this only because I assumed from your earlier posts that this is necessary for the calculation of entropy.

What is necessary to calculate entropy in non-equilibrium situations is to first define entropy in those situations.

In all situations where Shannon entropy can be defined, there must be a specific probability distribution involved. This is a greater requirement than simply saying that there are complications involved or that the visual impression of the process shows (subjective) "disorder".

In situations where thermodynamic entropy is involved we have equations defining entropy in equilibrium conditions. These equations are derived from a statistical model of gases. Thus these equations are also based on a model that involves a probability distribution.

You are proposing to do a deterministic simulation. A single run of this simulation does not involve a probability distribution. The deterministic simulation simulates a process that is theoretically reversible. The main consequence of entropy in thermodynamics is that when entropy increases, it characterizes this processes that are not reversible.

The intended point of my posts is that a deterministic simulation with states of non-equilibrium contradicts attempts to define entropy.
1) It contradicts attempts to define entropy in terms of the entropy of a probability distribution.
2) It contradicts attempts to define entropy in terms of equations used in equilibrium states such as U'(t) = TS'(t) - PV'(t) because quantities like V(t) are undefined in non-equilibrium states.

I am not saying that there exists a useful definition for V(t) in non-equilibrium conditions. I am not saying that there exists some definition of V(t) that we must use in order to define the entropy in non-equilibrium states. The main point of my posts is that attempts to define entropy by methods 1) and 2) appear to be dead-ends.

If this is necessary, then I can try to visualize for you how I intend to define the volume of an already mixed gas.
For example imagine that the blue gas is not a gas, but a non-Newtonian fluid that stays in one body, does not keep its volume, can be compressed with the same energy-force-pressure behavior just like if it was a gas. This scenario result the same for the red gas as if the blue were gas, but they will never mix.
That would contradict the proposed deterministic simulation wouldn't it? You intend to allow the particles to intermingle. I think you must drop the condition that the fluid "stays in one body".

To calculate this new volumes (which at the end finally balances), I think it is a good way if we reserve volumes for each and every particles, and calculating just like I mentioned before, in #30
I assume you say that it is a "good" way because it mathematically keeps the total volume equal to 2 at all times during the particular situation we are considering. However (to me) it doesn't make physical sense. It seems to be a model where each particle has a compressible "balloon" around it that defines the particle's volume.

If there are initially N_A particles in Chamber_A and Chamber_A has volume 1 unit then each of the particles is inside a little balloon of volume 1/N_A units. Likewise, each of the N_B particles in Chamber_B is initially inside a balloon of volume 1/N_B units. Let the door be opened and let 1 particle from Chamber_A enter Chamber_B. Then instantly, the balloon around this particle increases from size 1/N_A to size 1/(N_B +1) and instantly the balloons around the particles in Chamber_B decrease in size from 1/N_B to 1/(N_B+1).

That doesn't agree with the process modeled by your deterministic simulation. A particle from Chamber_A that enters Chamber_B doesn't instantly affect all the particles in Chamber_B. It doesn't affect any particle in Chamber_B until it collides with the particle.
I have an easier visualization.
Say that between the chambers there is no door, but a zero-mass piston, a wall that prevents mixing the gases. What if we calculate this way?

That's fine if you goal is visualize a physical situation that justifies a mathematical calculation. But I think the goal is to analyze the deterministic simulation you proposed, which didn't have a piston in it.We can invent an arbitrary definition for the "volume" V(t) of a non-equilibrium gas and ask if it is possible to test whether the equation mentioned in 2) is satisfied. I don't think it is possible to do such a test using your deterministic simulation. The terms U(t) and T(t) makes sense in your simulation. However P(t) is problematic. For example, at a given instant of time, there may be no particles at all that collide with the walls of the chambers, so P(t) (interpreted as a force per unit area on a physical surface ) drops to zero at such instants. How is such a discontinuous function going to work as a term in a differential equation ?
 
  • #36
Stephen Tashi said:
The main point of my posts is that attempts to define entropy by methods 1) and 2) appear to be dead-ends.
Please try thinking with my head. I'm not posting here just because I'd like to convince you, my intension is only that I'd like to solve the problem I faced and I need some help form others who have greater knowledge on the topic. I don't really need explanations on why I can't calculate entropy -- but describing the problems may help to solve them one by one. For example if you say that "It would be possible to calculate the entropy if we could find a way to numerize the volume change through non-equilibrium conditions" then together maybe we will be able to find a good, analitycal approximation, and then we can step forward. I think I had several good ideas for this problem, but if it is not necessary or dead-end, then let's skip it, and find another way to entropy.

I answered your questions and reacted to your critics, but then I decided to not post here, because I'm not sure it leads to a solution. If you are interested, I'd be happy to send you my thoughts in a personal message.

I think you also would like the result if I would be able to create a simulation in which a deterministic process with particles demonstrates the change of macro values (temperature, pressure, entropy). If you have any ideas or suggestion on how to accomplish this, I'd be thankful for it.
 
Back
Top