Each cell is a tiny magnet pointing up (blue) or down (orange). A magnet would rather agree with its four neighbors, but heat makes it flip at random: the hotter it is, the more often a magnet flips against its neighbors' wishes. Slide the temperature and watch two worlds appear: cold, and the magnets line up into big single-color domains; hot, and the picture is noise. Press Play. Click or drag to flip magnets.

This is the Metropolis method on a grid that wraps around. In the exact solution of Lars Onsager the two worlds meet at a temperature of 2 / ln(1 + √2), about 2.27 in these units, so the slider starts just above it (2.3), where the domains are big and ragged and keep changing. Below it a start from all blue stays almost all blue; above it a start from all blue melts to noise. The magnetization in the status line is the fraction by which one color wins (0 for an even mix, 1 for all one color); the energy is per magnet, and is -2 when every magnet agrees with every neighbor.

This page was created with Claude Code.