PhysSandbox
Classical MechanicsWaves & SoundElectricity & MagnetismOptics & LightGravity & OrbitsLabs
🌙Astronomy & The Sky🌡️Thermodynamics🌍Biophysics, Fluids & Geoscience📐Math Visualization🔧Engineering🧪Chemistry

More from Thermodynamics

Other simulators in this category — or see all 31.

View category →
NewUniversity / research

Lorentz Gas (Billiard)

Point particle specularly reflected from fixed disks in a box: chaotic paths and MSD growth toward diffusion.

Launch Simulator
NewUniversity / research

Site Percolation (2D)

Square lattice occupation p: clusters, left–right spanning, p_c ≈ 0.593; rough box-counting D̂ on the largest cluster.

Launch Simulator
NewUniversity / research

Bose–Einstein vs Fermi–Dirac

Grand-canonical occupation f(E) at the same T and μ: FD, BE, and classical Maxwell–Boltzmann comparison.

Launch Simulator
FeaturedSchool

Ideal Gas Simulator

Bouncing particles in a box. See PV=nRT in action.

Launch Simulator
School

Gas Laws Interactive

Boyle's, Charles's, Gay-Lussac's laws with interactive piston.

Launch Simulator
School

Heat Transfer

Conduction, convection, and radiation with temperature gradients.

Launch Simulator
PhysSandbox

Interactive physics, chemistry, and engineering simulators for students, teachers, and curious minds.

Physics

  • Classical Mechanics
  • Waves & Sound
  • Electricity & Magnetism

Science

  • Optics & Light
  • Gravity & Orbits
  • Astronomy & The Sky

More

  • Thermodynamics
  • Biophysics, Fluids & Geoscience
  • Math Visualization
  • Engineering
  • Chemistry

© 2026 PhysSandbox. Free interactive science simulators.

PrivacyTermsContact
Home/Thermodynamics/2D Ising Model

2D Ising Model

The Ising model is a cornerstone of statistical mechanics, providing a simplified framework for understanding phase transitions and cooperative phenomena. This simulator implements the two-dimensional Ising model on a square lattice. Each lattice site holds a magnetic spin variable, σᵢ, which can be in one of two states: 'up' (+1) or 'down' (–1). The system's energy is governed by the Hamiltonian: H = –J Σ_{<i,j>} σᵢ σⱼ – h Σᵢ σᵢ. The first sum runs over all nearest-neighbor pairs and describes the exchange interaction with strength J > 0, favoring alignment (ferromagnetism). The second sum represents the interaction with an external magnetic field, h. The simulator evolves the system using the Metropolis Monte Carlo algorithm, a stochastic process that samples spin configurations with a probability proportional to the Boltzmann factor, exp(–H/k_B T), where k_B is Boltzmann's constant and T is temperature. By tracking the average magnetization per spin, m = (1/N) Σᵢ σᵢ, and the average energy per spin as temperature varies, one observes a sharp, continuous phase transition at a critical temperature, T_c ≈ 2.27 J/k_B. Below T_c, spontaneous symmetry breaking occurs, and the system develops a net magnetization (|m| > 0) even with h=0. Above T_c, thermal fluctuations destroy long-range order, and m averages to zero. Interacting with this simulator reveals how microscopic interactions (neighbor alignment) lead to macroscopic order, illustrates the concept of universality, and provides a computational window into the behavior of real magnetic materials, binary alloys, and other systems exhibiting collective order.

Who it's for: Upper-level undergraduate and graduate students in physics, chemistry, or materials science studying statistical mechanics, computational physics, or phase transitions.

Key terms

  • Ising Model
  • Phase Transition
  • Critical Temperature (T_c)
  • Metropolis Algorithm
  • Spontaneous Symmetry Breaking
  • Ferromagnetism
  • Monte Carlo Simulation
  • Boltzmann Distribution

Monte Carlo

2.4
0
4

Ferromagnetic Ising on a square lattice with periodic boundaries. Below T_c domains grow; near T_c clusters are fractal-like. Field h biases up vs down. This is a teaching Metropolis run, not a finite-size scaling study.

Measured values

|m|0.000
E / (JN)0.000
~sweeps0

How it works

Classic equilibrium stat-mech demo: local flips with exp(−ΔE / kT) acceptance connect microscopic dynamics to phase transition phenomenology.

Frequently asked questions

Why does the magnetization sometimes flip direction during a simulation run at low temperature?
In a finite-sized system with periodic boundary conditions and no external field (h=0), the energy barrier between the two degenerate ground states (all spins up vs. all spins down) is finite. Over a long enough simulation time, rare but large thermal fluctuations can overcome this barrier, causing the entire system to flip. This is a finite-size effect; in an infinitely large thermodynamic system, such a flip would have an infinitely low probability, and the symmetry breaking is truly spontaneous.
What real-world systems does the 2D Ising model actually represent?
While its original purpose was to model ferromagnetism, the Ising model's binary degrees of freedom make it a versatile lattice model. It can describe the order-disorder transition in binary alloys (e.g., copper-zinc), the liquid-gas critical point via the lattice gas model, and even simplified models of neural networks or social opinion dynamics. Its greatest value is as a paradigmatic model for understanding the universal features of continuous phase transitions.
The simulation seems 'jumpy' or noisy, especially near the critical temperature. Is this an error?
No, this is a fundamental physical feature. Near the critical point (T_c), the correlation length—the typical size of aligned spin clusters—diverges. The system exhibits critical fluctuations at all scales, leading to large, slow fluctuations in macroscopic quantities like magnetization and energy. This increased variance and slow dynamics are hallmarks of a critical point and are correctly captured by the Monte Carlo algorithm.
What is the main simplification of the Ising model compared to a real magnet?
The primary simplification is that real atomic spins are quantum mechanical vectors that can point in any direction, not just purely 'up' or 'down'. A more accurate classical model is the Heisenberg model. The Ising model restricts spins to one axis, which mathematically simplifies the problem while still retaining the essential physics of a phase transition driven by competition between interaction energy and thermal disorder.