About this simulation

This simulation runs a live 2D Ising model on an N×N lattice of ±1 spins, updated with the Metropolis Monte Carlo algorithm: a random spin's energy change ΔE = 2Jsi(Σⱼsⱼ + H) is computed, and the flip is accepted unconditionally if ΔE ≤ 0 or with probability exp(−ΔE/kBT) otherwise. Below the Onsager critical temperature Tc ≈ 2.269 J/kB the lattice spontaneously magnetises into large aligned domains; above it, thermal noise scrambles the spins into a disordered paramagnet. Live statistics track the magnetisation order parameter and the susceptibility, which diverges as the system approaches Tc.

🔬 What it shows

A colour-coded spin lattice (blue = +1, orange = −1) evolving under Metropolis dynamics, alongside a live magnetisation-vs-temperature curve. Near Tc the domain pattern shows scale-free clusters at every zoom level — critical opalescence — because the correlation length diverges exactly at the transition.

🎮 How to use

Drag the Temperature slider slowly across Tc ≈ 2.269 to watch order collapse into disorder. Adjust Lattice size N for sharper transitions on bigger grids, Sweeps/frame to equilibrate faster, and External field H to break the up-down symmetry (which destroys the sharp transition). Use the Random/Align buttons or the Cold/Tc/Hot presets to jump straight to a given state, and Space or P to pause.

💡 Did you know?

Lars Onsager's 1944 exact solution of the 2D Ising model — giving Tc = 2J/(kB·ln(1+√2)) ≈ 2.2692 J/kB — is considered one of the greatest achievements of theoretical physics, and remains the only exactly-solved non-trivial interacting model of its kind in two dimensions.

Frequently asked questions

What is the order parameter in this ferromagnetic phase transition?

The order parameter is the spontaneous magnetisation per spin, m = (1/N²)|Σsᵢ|. It equals 1 in a perfectly aligned ground state at low temperature and drops toward 0 above the critical temperature Tc, giving a direct quantitative measure of how ordered the spin lattice is at any moment.

How does the Metropolis Monte Carlo algorithm decide whether to flip a spin?

A spin is chosen at random and its energy change if flipped, ΔE = 2Jsi(Σⱼsⱼ + H), is computed from its four neighbours. If ΔE ≤ 0 the flip is accepted unconditionally because it lowers the system's energy; otherwise it is accepted with probability exp(−ΔE/kBT). This rule satisfies detailed balance and guarantees the lattice converges to the correct Boltzmann distribution at temperature T.

Why does the magnetic susceptibility diverge at the critical temperature?

Susceptibility χ = N²(⟨m²⟩ − ⟨m⟩²)/kBT measures how strongly magnetisation fluctuates in response to a small field. Near Tc, spin correlations extend over the entire system, so fluctuations grow without bound and χ diverges as |T − Tc|^(−γ) with γ = 7/4 in two dimensions — the defining signature of a second-order (continuous) phase transition.

What are critical exponents and why are they universal?

Critical exponents describe how quantities like magnetisation, susceptibility and correlation length diverge or vanish as temperature approaches Tc: β = 1/8 for magnetisation, γ = 7/4 for susceptibility, ν = 1 for correlation length in the 2D Ising model. Remarkably, systems with completely different microscopic physics — magnets, binary fluid mixtures, even certain cosmological models — share identical exponents whenever they have the same dimensionality and order-parameter symmetry, a phenomenon called universality.

How does an external magnetic field change the phase transition?

A nonzero external field H breaks the up-down symmetry between the two magnetised states, so magnetisation then varies smoothly with temperature instead of jumping sharply at Tc. A true second-order phase transition exists only exactly at H = 0, terminating at the critical point (Tc, H = 0); for any H ≠ 0 there is no genuine discontinuity, only a crossover.