This is a numerical simulation of the ising-model in two dimensions, using the metropolis algorithm.

The cells of the grid represent coupled
elementar magnets of a ferromagnetic solid. In a cubic grid with dimension d and grid length
a, we number grid points k = 1, ..., N with N = a^{d}. If s_{k} = ±1 is the index of the third spin component, then a physical state of the ising-model is defined by (s_{1}, s_{2}, ..., s_{N}). There are 2^{N} possible states, and the energy of the state i in the ising-model is E_{i} = -(ε/2)Σ^{N}_{k=0}Σ_{j in U(k)}s_{k} s_{j}
with the coupling constant ε > 0 and the nearest neighbours U(k) of grid point k.
The canonical probability for the state i at Temperature T is p_{i} = exp(-E_{i}/kT)/Z
with the partition function Z := Σ_{j} exp(-E_{j}/kT).
Spontaneous phase-transitions occur at low temperatures. With the definiton T' := kT/ε
the critical temperature is T' = 2.27 (solution by L. Onsager, 1944).

energy | 0 |

spin | 0 |

mean(spin) | 0 |