Second law of thermodynamics and a bunch of magnets Say I put a bunch of powerful square magnets on a nearly frictionless table in a disordered fashion. The second law of thermodynamics states that the system shall spontaneously get more disordered, yet the magnets will attract each other and form a chain (typically), thereby increasing the order of the system-and, seemingly, decreasing its entropy.
It would seem to me that the system is closed and the lattice is indeed the equilibrium state. Therefore, I suspect that by attracting each other, the magnets increase their own entropy by a larger amount than the decrease in entropy caused by the lattice formation. Is it true? If yes, what are the thermodynamics of magnets responsible for this? Is there a microscopic explanation?
Thanks!
 A: It's actually a nice example of why the 2nd law is useful: if you go around trying to account in microscopic detail the balance of things like energy and entropy, then you can easily go wrong. I used to have a student who would do this all the time; I don't know if he ever learnt the lesson...
In this specific case, you neglected damping --- without it, you would never come to an equilibrium and the 2nd law does not apply. With damping, you necessarily dissipate heat, and that loss will more than make up for the macroscopic ordering. This dissipation can be either mechanical friction, or (as an example of why you would be wrong about this situation being "closed") electro-magnetic --- oscillating dipoles emit radiation!
A: The magnets will indeed attract each other. This attraction will put them in motion, and they will head towards each other, converting electromagnetic energy into kinetic energy. Then they will collide, and loose their kinetic energies in the collision, finally coming to rest in a more ordered, low-energy state.
In terms of energy, the outcome of the experiment is that you have converted electromagnetic energy into heat: the heat released in the collisions. This conversion creates far more entropy than the entropy lost by arranging the magnets in a more ordered fashion.
A: Consider this for an outrageous answer,
since it is impossible to have an isolated system,
hence the magnetic field of the bar magnets in the scattered state interacts with the system around it and will cause some increase in entropy,
Now the magnets align to form a larger and stronger magnet which interacts with its surroundings in a more agressive way compared to the previous case,
hence increasing the entropy of the system,
DAmping is the major factor which is increasing disorder here, but this factor will also contribute so small , yet non zero amount to the entire entropy increase.
