NetLogo banner

Home
Download
Help
Resources
Extensions
FAQ
NetLogo Publications
Contact Us
Donate

Models:
Library
Community
Modeling Commons

Beginners Interactive NetLogo Dictionary (BIND)
NetLogo Dictionary

User Manuals:
Web
Printable
Chinese
Czech
Farsi / Persian
Japanese
Spanish

  Donate

NetLogo User Community Models

(back to the NetLogo User Community Models)

[screen shot]

Download
If clicking does not initiate a download, try right clicking or control clicking and choosing "Save" or "Download".(The run link is disabled for this model because it was made in a version prior to NetLogo 6.0, which NetLogo Web requires.)

WHAT IS IT?

This is a model of cooling, intended to illustrate the laws of thermodynamics. In this simple universe, an iron block (grey) sits in a cloud of gas (black). Particles turn red when excited, and back to black or grey when unexcited. The first law of thermodynamics states that energy is conserved, so the total number of excited particles remains constant throughout. The distribution of excited particles changes, however, as the particles jostle each other and transfer their energy to each other. Monitors and graphs show the temperature and entropy of the system (the iron block) and the surroundings (the gas) as the iron block cools down.

HOW IT WORKS

Patches represent particles and turtles represent units of energy. Each time step, energy is transferred from one particle to an adjacent particle on a random basis.

HOW TO USE IT

Click the SETUP button to charge the iron block with an amount of energy specified by the ENERGY slider.

Click the GO button to start the simulation. The simulation then runs for 500 time clicks and stops.

The ONE-STEP button allows you to step through the simulation one turn at a time.

The COOL button cools the iron block by turning one excited particle in the system OFF and turning one unexcited particle in the surroundings ON.

The HEAT button heats the iron block by turning one unexcited particle in the system ON and turning one excited particle in the surroundings OFF.

THINGS TO NOTICE

The second law of thermodynamics states that the total entropy of the universe can never decrease. In this model, however, it does occasionally decrease by a small amount. This is because the second law of thermodynamics is a statistical law, and in small systems such laws are less reliable. The universe in this model is very small, consisting only of 1681 particles (100 iron particles, and 1581 gas particles), and so the second law is not so reliable here. The second law should really say that the total entropy of the universe is merely UNLIKELY to decrease, with the degree of improbability depending on the size of the system. Of course, the real universe is so large that the second law is never likely to be contravened.

When the system (the iron block) and the surroundings are at thermal equilibrium, the total entropy of the universe will have reached its maximum point.

THINGS TO TRY

Try varying the amount of energy in the universe. What effect does this have on the reliability of the second law?

EXTENDING THE MODEL

Try changing the energy slider so that more than 49 units of energy can be poured into the iron block at the start. What happens to the temperature of the iron block under those conditions? Can you make sense of the result?

The model uses an approximation for calculating entropy that is only valid for large systems. The best way to calculate the entropy would be to use Boltzmann's equation, S = k ln W. Assuming k to be 1, and W to be equal to N! / Noff! Non!, this equation simplifies to S = ln N! - (ln Noff! + ln Non!). Try coding this way of calculating entropy. Does it corroborate the approximation used here?

NETLOGO FEATURES

Look at the DISPERSE routine in the Procedures window. Can you work out what this routine is doing and why it is necessary?

RELATED MODELS

BOILING, HEAT DIFFUSION and THERMOSTAT

CREDITS AND REFERENCES

This model was written by Dylan Evans (© Dylan Evans, 2003) http://www.dylan.org.uk.
A page about this model can be found at http://www.dylan.org.uk/entropy
It is based on a model developed by Peter Atkins in The Second Law: Energy, Chaos, and Form, Scientific American Library, 1984.

(back to the NetLogo User Community Models)