Physical Model and Hamiltonian: This simulation investigates the nearest-neighbor interacted spins ($S_i \in \{+1, -1\}$) located on a square lattice, under the external magnetic field. The Hamiltonian of the system is defined as:
$$ \mathcal{H} = -J \sum_{\langle i,j \rangle} S_i S_j - B_z \sum_i S_i $$
Here, $J$ is the exchange interaction constant, $\langle i,j \rangle$ represents the nearest neighbor pairs, and $B_z$ represents the external magnetic field in the z-direction. ($k_B = 1$ is assumed).
Color Coding: The spin states in the magnetic configuration visualization are color-coded as follows:
Monte Carlo (Metropolis) Update: The simulation uses the Metropolis-Hastings algorithm to reach thermodynamic equilibrium. In each trial step:
Observables and Fluctuations:
After the system settles into thermodynamic equilibrium (following a sufficient number of Metropolis sweeps), the susceptibility ($\chi$) and specific heat ($C_v$) of the system are calculated via fluctuation theorems using the averages of magnetization $m$ and energy $e$ per spin. Let $N$ be the total number of spins ($N=100\times 100$):
The left chart shows the instantaneous time series of the magnetization $m$ and energy $e$ per spin (one sample every 50 MCS). The right chart shows a cumulative estimate of the fluctuation formulas above, computed from all samples collected since the last parameter change; the values settle as the number of samples grows. To keep the pre-equilibrium transient out of the averages, the first 500 MCS after each reset (thermalization) are discarded. On a finite lattice at zero field the symmetry is not spontaneously broken and $\langle m \rangle = 0$; therefore $\langle |m| \rangle$ is used in the susceptibility, as is standard.
Critical Temperature: On the infinite square lattice the phase transition occurs at $T_c = 2J/\ln(1+\sqrt{2}) \approx 2.269$ (Onsager's exact solution). The page starts at this value, and the "T = Tc" button returns to it. Near the critical point the correlation length and the autocorrelation time become very large (critical slowing down), so the χ and $C_v$ estimates can take a long time to settle. On a finite lattice the χ and $C_v$ peaks appear slightly above $T_c$ and have finite height.
Parameter Changes and Thermodynamic Memory: When the temperature (T) or magnetic field (Bz) values on the interface are modified, the simulation does not restart from a random spin configuration. Instead, the system treats its current micro-state as the initial condition and continues its evolution under the new parameters. In statistical physics, this behavior allows for the investigation of processes such as simulated annealing (gradual cooling) or thermal quench (sudden temperature drops). To prevent the mixing of data from different thermodynamic equilibrium states and the consequent corruption of variance calculations, the statistical average accumulators and charts are automatically reset upon any parameter change.