Ising Model
The Ising model is used to model a system of interacting spins in a ferromagnetic material. The model was first conceived by Wilhelm Lenz in 1920. He presented the model to his student, Ernst Ising, for analysis. It is a central model in the domain of statistical mechanics.
Simulation
The model consists of a 2D lattice of spins. Each spin can be either +1 (yellow) or -1 (blue). Initially, all spins are randomly assigned. The system is evolved using the Metropolis algorithm (described below).
(changing grid size automatically restarts the simulation)
Energy of the Lattice
The energy of a lattice is calculated using the following formula: \[ E = - J \sum_{\lt ij \gt} s_i s_j \] Intuitively speaking, the energy of the lattice is minimum if all the spins are aligned in the same direction. In large lattices, this can be achieved after long wait times, provided the temperature is low enough. More commonly, we see regions of the lattice having the same spin. This is a reasonably low energy state.
Metropolis Algorithm
In every step, a random spin is chosen and flipped. The change in energy of the system (\( \Delta E \)) is calculated. If energy has decreased (which is favourable), then the flip is accepted. If energy has increased (unfavourable), then the flip is accepted with a probability of: \[ P = \exp\left(\frac{-\Delta E}{k_B T}\right) \] The intuition behind this formula is:
- As the value of \(\Delta E\) increases, it becomes less likely that the unfavourable flip will be accepted
- A higher value of temperature \(T\) in the denominator decreases the value of the fraction, thereby increasing the probability of all unfavourable flips. Higher temperature promotes disorder.
What to try
- With low temperature \(T\) and a positive interactive strength \(J\), you will observe the characteristic magnetic lattices of ferromagnets: huge regions of the lattice have the same spin. These regions are known as 'domains'. If you increase \(T\), then disorder is promoted and it will take slightly longer for domains to form.
- If you set the interaction strength \(J\) to be negative, then energy is minimized if neighbouring spins are dislike. In such a case, the system will evolve to be disordered.
Note:
- The boundary condition is periodic.
- This simulation may hang on lower-end devices, for large grid sizes and large values of steps per second.
Developed by ChanRT | Fork me at GitHub