Education app demonstrating 2nd law of thermodynamics

In summary, this app simulates the free expansion of a gas, and it is interesting to see how the second law is violated.
  • #1
bcrowell
Staff Emeritus
Science Advisor
Insights Author
Gold Member
6,724
429
I recently posted about a browser-based educational app that graphs the position, velocity, and acceleration of the mouse's vertical motion. In the same spirit, I've written an app that demonstrates the statistical basis of the second law of thermodynamics by simulating the free expansion of a gas: http://www.lightandmatter.com/entropy
 
  • Like
Likes jasonRF and Greg Bernhardt
Science news on Phys.org
  • #2
Not unlike watching an aquarium --- almost hypnotic.
 
  • #3
bcrowell said:
I recently posted about a browser-based educational app that graphs the position, velocity, and acceleration of the mouse's vertical motion. In the same spirit, I've written an app that demonstrates the statistical basis of the second law of thermodynamics by simulating the free expansion of a gas: http://www.lightandmatter.com/entropy

I understand this is an elementary presentation, but free expansion can be isentropic, isothermal, or somewhere in between:

http://www.engineeringtoolbox.com/compression-expansion-gases-d_605.html

It's not clear which you are trying to simulate.

Another point- while not stated, I suspect your 'atoms' are all indistinguishable; thus you can't easily resolve Gibbs' paradox:

http://bayes.wustl.edu/etj/articles/gibbs.paradox.pdf
 
  • #4
Thanks for your comments, Andy. If you watch the simulation, I think it should be clear that it's simulating what are essentially perfectly elastic billiard balls, so the expansion is isothermal. Although I hadn't stated it explicitly in the documentation, I think you can tell that it's simulating an ideal gas, and the free expansion of an ideal gas is isothermal.

Gibbs' paradox is interesting. However, I don't see its relevance here, since it deals with a different situation than the one I'm simulating.
 
  • #5
bcrowell said:
Thanks for your comments, Andy. If you watch the simulation, I think it should be clear that it's simulating what are essentially perfectly elastic billiard balls, so the expansion is isothermal. Although I hadn't stated it explicitly in the documentation, I think you can tell that it's simulating an ideal gas, and the free expansion of an ideal gas is isothermal.

Gibbs' paradox is interesting. However, I don't see its relevance here, since it deals with a different situation than the one I'm simulating.
In the free adiabatic expansion of a gas, Q=W=0, so ΔU is zero. This also means that, if the gas is an ideal gas, ΔT is also zero. So, for an ideal gas, free expansion in a closed container is both adiabatic and isothermal. Of course, for a real gas, there will be a temperature change.

I regard free adiabatic expansion of a gas in a closed container as the closed-system analog of the Joule-Thompson effect for adiabatic flow of a gas through a valve or porous plug. In the case of free expansion in a closed container, one is interested in the effect of the pressure (or volume) change on temperature at constant internal energy. In Joule-Thompson, one is interested in the effect of the pressure change on the temperature at constant enthalpy.

Chet
 
  • #6
I've done some more work on the simulation and worked out several different demonstrations that I intend to use in lecture. I thought others might be interested to see them.

http://www.lightandmatter.com/entropy?wait

The basic demo of free expansion and the second law. Click the Start button to see the demonstration run. (This is the reason for the "wait" option in this url and the others below; in a lecture, it gives time to say something to the class before everything starts moving.) On the graphs you can see the system reaching equilibrium and fluctuating away from equilibrium. By increasing the number of particles you can see that the fluctuations get smaller in relative terms. If you hit the "Reverse velocities" button you can see the system move back to its initial state, violating the second law.

http://www.lightandmatter.com/entropy?flock,wait

The particles are all initially concentrated in one region of space and moving in the same direction. Because this particular version of the system is not ergodic, thermal equilibrium is never reached. Although the flock spreads out spatially due to collisions, it remains confined to a small portion of the phase space in terms of momentum. This doesn't violate the second law, since the second law doesn't demand that the entropy increase at any nonzero rate.

http://www.lightandmatter.com/entropy?gy=2,flock,wait

Adding gravity in the y direction breaks part of the system's unrealistically perfect symmetry and causes the y momentum to equilibrate.

http://www.lightandmatter.com/entropy?gx=3,gy=2,flock,wait

Adding an x component to gravity makes all the degrees of freedom equilibrate.

http://www.lightandmatter.com/entropy?island,flock,wait

Another way of getting rid of the non-ergodic behavior is to add a circular island in the middle of the box. This is known as Sinai's billiards. The island acts as a diverging lens.

http://www.lightandmatter.com/entropy?temps,n=300,wait

The whole box is uniformly filled with particles, but with unequal temperatures on the two sides

http://www.lightandmatter.com/entropy?temps,n=300,wait,mark

By adding ",mark" to any of these URLs, you can cause one of the particles to be marked in red. This allows you to look at ideas like diffusion and the mean free path.

Various other options are described in the documentation: https://github.com/bcrowell/entropy/blob/master/README.md
 
  • Like
Likes jasonRF and Greg Bernhardt
  • #7
These are great simulations - certainly a lot of fun to watch and could be useful for students at many levels. I especially like the versions with the marked ball that let us see a random walk in action. The item on your to-do list would be fun to see; along the same lines, plots of mean velocity and temperature may be interesting for all the sims.

jason
 
  • Like
Likes bcrowell
  • #8
bcrowell said:
<snip> If you hit the "Reverse velocities" button you can see the system move back to its initial state, violating the second law.

http://www.lightandmatter.com/entropy?flock,wait

<snip>
Like!

Just back from vacation, so I haven't fully explored these yet. But I do like the 'reverse velocities'- it is known that indeed, viscous flow can be reversible under certain circumstances- dye can be 'unwound', for example:

 
  • #9
Cool video, Andy! (I love how he obviously miscounts and asks his helpers to confirm his miscount, which they do -- and then at the end they tell him that he miscounted.)
 

1. What is the second law of thermodynamics?

The second law of thermodynamics states that the total entropy of a closed system always increases over time, or remains constant in ideal cases where the system is in a steady state or undergoing a reversible process. This law also states that heat cannot spontaneously flow from a cold object to a hot object.

2. How can an education app demonstrate the second law of thermodynamics?

An education app can demonstrate the second law of thermodynamics through interactive simulations and visualizations. For example, the app can show the flow of heat from a hot object to a cold object, and how entropy increases as a result. It can also include real-world examples and scenarios to help students understand the concept better.

3. What are some practical applications of the second law of thermodynamics?

The second law of thermodynamics has many practical applications, such as in refrigerators and heat engines. It also explains why certain natural processes, such as the flow of heat and the direction of chemical reactions, occur in a specific direction. Understanding this law is crucial in fields such as engineering, chemistry, and environmental science.

4. How does the second law of thermodynamics relate to energy efficiency?

The second law of thermodynamics states that some energy is always lost when it is converted from one form to another. This means that it is impossible to have a completely efficient process, as some energy will always be lost as heat. Therefore, the law serves as a reminder for the importance of energy conservation and finding ways to increase energy efficiency.

5. What are some common misconceptions about the second law of thermodynamics?

One common misconception about the second law of thermodynamics is that it contradicts the first law, which states that energy cannot be created or destroyed. However, the second law only applies to closed systems, where no energy is exchanged with the surroundings. Another misconception is that the law only applies to thermal energy, when in fact it applies to all forms of energy. Finally, some people believe that the second law means that everything in the universe is constantly becoming more disordered, but this is not always the case as some systems can become more ordered through energy input.

Similar threads

  • Thermodynamics
Replies
33
Views
2K
  • STEM Educators and Teaching
Replies
2
Views
2K
  • STEM Educators and Teaching
Replies
2
Views
1K
  • Introductory Physics Homework Help
Replies
5
Views
363
Replies
152
Views
5K
Replies
22
Views
2K
  • STEM Educators and Teaching
7
Replies
233
Views
18K
Replies
7
Views
2K
  • Quantum Physics
Replies
4
Views
2K
Back
Top