Monte Carlo-Based Modeling of 2-D Ising Systems Using Metropolis Algorithm, Simulation Techniques, Thermodynamic Behavior and Magnetization Patterns
Monte Carlo-Based Modeling of 2-D Ising Systems Using Metropolis Algorithm, Simulation Techniques, Thermodynamic Behavior and Magnetization Patterns
Abstract: This study presents a comprehensive Monte Carlo simulation of the two-dimensional (2-D) Ising model using the
Metropolis algorithm to investigate critical phenomena and thermodynamic behavior in spin-lattice systems. The model,
implemented in MATLAB with periodic boundary conditions, explores equilibrium properties such as magnetization,
internal energy, specific heat, and susceptibility across a range of temperatures. By employing various initial spin
configurations—ordered and random—the simulations demonstrate the system's ergodicity and convergence to thermal
equilibrium. Key results include a sharp decline in magnetization and a pronounced peak in specific heat near the critical
temperature, consistent with second-order phase transition behavior. The simulation captures microscopic domain
evolution, highlighting the transition from ferromagnetic to paramagnetic phases as thermal fluctuations increase. The study
further evaluates algorithmic efficiency, discusses the impact of lattice size on statistical accuracy, and proposes
improvements using advanced cluster algorithms and parallel computing frameworks. The findings validate theoretical
predictions from Onsager's solution and underscore the versatility of Monte Carlo techniques in modeling collective
behavior in magnetic systems. The simulation framework offers a robust foundation for analyzing critical dynamics and
extends its relevance to broader applications in material science, computational physics, and complex systems modeling.
Keywords: Monte Carlo, Modeling, 2-D, Ising Systems, Metropolis Algorithm, Simulation Techniques, Thermodynamic Behavior,
Magnetization Patterns.
How to Cite: Adama Gaye. (2025). Monte Carlo-Based Modeling of 2-D Ising Systems Using Metropolis Algorithm, Simulation
Techniques, Thermodynamic Behavior and Magnetization Patterns. International Journal of Innovative Science and
Research Technology, 10(5), 511-526. https://doi.org/10.38124/ijisrt/25may414.
The analysis is restricted to lattice dimensions favoring Where ⟨𝑖, 𝑗⟩ indicates summation over nearest-neighbor
computational feasibility while maintaining statistical pairs, ℎ is the external magnetic field, and 𝜎𝑖 denotes the spin
relevance, with simulations conducted across a range of sub- at site 𝑖. In the absence of an external field (ℎ = 0), the model
critical and super-critical temperatures. Only canonical simplifies, and the system's behavior becomes purely
ensemble dynamics are evaluated, and quantum mechanical temperature-driven.
effects, three-dimensional lattice extensions, and alternative
spin models fall outside the boundaries of this investigation. The Ising model’s success lies in its abstraction and
versatility. Beyond ferromagnetism, it has been extended to
The remainder of this paper is structured as follows: model phenomena in fields ranging from neuroscience and
Section 2 presents a review of relevant literature on the Ising sociophysics to computational biology and quantum
model, Monte Carlo simulation techniques, and information. Despite its simplicity, the model encapsulates
thermodynamic observables. Section 3 details the simulation criticality, universality, and collective behavior, making it a
methodology, including initialization protocols, algorithmic canonical example for exploring phase transitions in
design, and model assumptions. Section 4 discusses the equilibrium statistical mechanics (Yeomans, 1992).
numerical results, providing visual and statistical
interpretations of energy fluctuations, magnetization trends, B. Applications of the Metropolis Algorithm in Physics
and phase transitions. Finally, Section 5 offers conclusions Simulations
and targeted recommendations for future extensions of the The Metropolis algorithm remains one of the most
work, including potential improvements in algorithmic influential stochastic methods in computational physics,
efficiency and applicability to more complex physical particularly in simulating systems governed by statistical
systems. mechanics. Originally developed by Metropolis et al. (1953)
for simulating the behavior of particles in a fluid, the
II. LITERATURE REVIEW algorithm introduced a probabilistic rule for accepting or
rejecting state transitions based on energy differences. This
A. Historical Development of the Ising Model method has since been adapted to lattice models like the Ising
The Ising model, one of the cornerstones of modern model to simulate thermal equilibrium configurations at a
statistical mechanics, originated from the early attempts to fixed temperature 𝑇.
understand ferromagnetism at the microscopic level.
Introduced by Wilhelm Lenz in 1920 and further developed At the heart of the Metropolis algorithm lies the
by his student Ernst Ising in 1925, the model proposed a principle of detailed balance, which ensures that the Markov
lattice-based system of binary variables (spins), each taking a chain converges toward the Boltzmann distribution. For any
value 𝜎𝑖 = ±1, to mimic magnetic dipole moments in a two microstates 𝑖 and 𝑗, the detailed balance condition is
crystalline solid (Ising, 1925). Although Ising initially satisfied if:
analyzed the one-dimensional (1D) system and concluded
that it exhibited no phase transition at non-zero temperature, 𝑃(𝑗 → 𝑖) 𝐸𝑖 − 𝐸𝑗
this limitation was soon overcome by higher-dimensional = exp (− )
𝑃(𝑖 → 𝑗) 𝑘𝐵 𝑇
generalizations.
Where 𝐸𝑖 and 𝐸𝑗 are the energies of states 𝑖 and 𝑗,
The two-dimensional (2D) variant of the Ising model respectively. The transition probability is defined such that
gained prominence with the exact solution by Lars Onsager moves to lower energy states are always accepted, while
in 1944. Onsager demonstrated that the 2D Ising model on a
square lattice with zero external magnetic field undergoes a
Beyond magnetic systems, the Metropolis algorithm has Moreover, research by Binder and Luijten (2001) has
found applications in polymer dynamics, quantum Monte emphasized the importance of order parameter distributions
Carlo simulations, and optimization problems such as and Binder cumulants in pinpointing 𝑻𝒄 , especially in
simulated annealing. Its flexibility and ease of simulations of finite systems. These cumulants provide
implementation have made it a cornerstone in diverse fields dimensionless quantities that intersect at 𝑻𝒄 for different
such as materials science, lattice gauge theory, and biophysics system sizes, offering a robust estimator free from non-
(Kalos & Whitlock, 2008; Newman & Barkema, 1999). universal amplitudes.
C. Prior Research on Phase Transitions in Lattice-Based Modern computational studies have also explored more
Models complex interactions such as long-range coupling, quenched
The study of phase transitions in lattice-based systems disorder, and anisotropy, extending the understanding of
has been a central theme in statistical physics, offering criticality into disordered and frustrated systems (Anyibama,
fundamental insights into critical behavior and universality et al., 2025). Notably, 3-D extensions and quantum lattice
classes. The Ising model, in particular, has served as a models have uncovered novel quantum phase transitions,
primary vehicle for analyzing second-order (continuous) where quantum fluctuations dominate thermal ones (Sachdev,
phase transitions due to its analytically solvable 2-D case and 2011).
rich phenomenology. Onsager’s exact solution for the 2-D
Ising model revealed that the system undergoes a spontaneous D. Thermodynamic Properties of Magnetic Systems in 2-D
symmetry-breaking transition at a finite critical temperature Models
𝑻𝒄 , marking the boundary between ferromagnetic and The thermodynamic behavior of magnetic systems in
paramagnetic phases (Onsager, 1944). two-dimensional (2-D) lattice models, particularly the Ising
model, has been extensively explored to elucidate phenomena
One of the hallmark features of continuous phase such as spontaneous magnetization, energy fluctuations, and
transitions in such systems is the divergence of correlation critical behavior. In these systems, key macroscopic
length 𝝃 as the temperature approaches 𝑻𝒄 . Near the critical observables—internal energy 𝑼, magnetization 𝑴, specific
point, the correlation length exhibits a power-law behavior heat 𝑪𝒗 , and magnetic susceptibility 𝝌—are derived from
given by: microscopic spin interactions governed by a Hamiltonian of
the form:
𝝃 ∼∣ 𝑻 − 𝑻𝒄 ∣−𝝂
𝓗 = −𝑱 ∑ 𝝈𝒊 𝝈𝒋 − 𝒉 ∑ 𝝈𝒊
⟨𝒊,𝒋⟩ 𝒊
To enhance statistical robustness, thermal averaging is Here, periodic boundary conditions are applied to
applied after an equilibration phase, typically consisting of manage edge interactions using modular arithmetic. The spin
𝟏𝟎𝟓 MCSS, beyond which observable quantities such as 𝝈𝒊,𝒋 is flipped with probability:
magnetization 𝑴, energy 𝑬, specific heat 𝑪𝒗 , and
susceptibility 𝝌 are averaged over an additional 𝟏𝟎𝟔 MCSS. 𝟏 if 𝜟𝑬 ≤ 𝟎
The magnetization per spin is computed as: 𝑷accept = { 𝜟𝑬
𝐞𝐱𝐩 (− ) if 𝜟𝑬 > 𝟎
𝒌𝑩 𝑻
𝑳𝟐
𝟏
𝑴 = 𝟐 ∑ 𝝈𝒊 This condition preserves detailed balance and ensures
𝑳
𝒊=𝟏 convergence to the canonical ensemble distribution
(Metropolis et al., 1953; Binder & Heermann, 2010).
While the energy per spin is:
In the MATLAB implementation, the random spin site
𝑱 is selected using randi, and neighbors are retrieved with a
𝑬 = − 𝟐 ∑ 𝝈𝒊 𝝈𝒋
𝑳 user-defined Neighbor function that maps lattice coordinates
⟨𝒊,𝒋⟩
via periodic indices. The energy and magnetization are
updated dynamically using global variables to track state
Fluctuation-based estimates of thermodynamic
quantities across iterations. Energy per spin is computed as:
quantities follow:
𝟏 𝟏 𝑱
(⟨𝑬𝟐 ⟩ − ⟨𝑬⟩𝟐 ), (⟨𝑴𝟐 ⟩ − ⟨𝑴⟩𝟐 ) 𝑬=− ∑ 𝝈𝒊 𝝈𝒋
𝑪𝒗 = 𝝌= 𝑳𝟐
𝒌𝑩 𝑻𝟐 𝒌𝑩 𝑻 ⟨𝒊,𝒋⟩
The random number generator used in the Metropolis and the total magnetization as:
algorithm is selected for uniformity and long periodicity,
ensuring statistically independent configurations. 𝑳𝟐
Furthermore, binning analysis is employed to estimate the 𝟏
𝑴 = 𝟐 ∑ 𝝈𝒊
variance of computed quantities and eliminate autocorrelation 𝑳
𝒊=𝟏
effects (Newman & Barkema, 1999).
The MATLAB code incorporates control logic to
Advanced implementations incorporate temperature differentiate between the equilibration phase and the
parallelization, where different processors simulate measurement phase. During equilibration (typically 𝟏𝟎𝟓
independent replicas at distinct temperatures, enabling Monte Carlo steps), observable quantities are not recorded to
simultaneous data generation and more efficient computation allow the system to stabilize. In the measurement phase,
(Preis et al., 2009). All simulations are conducted in statistical quantities such as ⟨𝑴⟩, ⟨𝑴𝟐 ⟩, ⟨𝑬⟩, and ⟨𝑬𝟐 ⟩ are
MATLAB, utilizing matrix-vectorized operations for calculated over successive iterations to compute specific heat
efficient handling of spin arrays and periodic indexing. 𝑪𝒗 and susceptibility 𝝌 via fluctuation formulas (Ferrenberg
et al., 2018).
C. Metropolis Algorithm Implementation in MATLAB
The Metropolis algorithm is one of the most widely To enhance computational efficiency, precomputed
adopted Monte Carlo methods for simulating statistical tables of 𝐞𝐱𝐩(−𝜟𝑬/𝒌𝑩 𝑻) values for all possible 𝜟𝑬 ∈
systems in equilibrium. It provides an efficient mechanism {−𝟖𝑱, −𝟒𝑱, 𝟎, 𝟒𝑱, 𝟖𝑱} are stored and referenced in real time.
for sampling the Boltzmann distribution in high-dimensional This avoids repeated exponential evaluations and speeds up
configuration spaces, such as those encountered in the 2-D the simulation significantly (Newman & Barkema, 1999).
Ising model. In this study, the algorithm is implemented in
MATLAB due to its matrix computation capabilities and ease Furthermore, graphical output functions such as
of managing lattice-based structures. MATLAB’s inherent imagesc and plot are used to render spin configurations and
support for vectorized operations and graphical rendering thermodynamic observables in real time. MATLAB's
further facilitates efficient iteration, data analysis, and vectorized matrix operations also allow for the simultaneous
visualization (Higham & Higham, 2017). updating of lattice elements when parallelizing operations
across temperature sweeps or initial conditions (Preis et al.,
2009).
At 𝑻 = 𝟐. 𝟎, the system exhibits strong spontaneous Conversely, at 𝑻 = 𝟐. 𝟓, the thermal agitation surpasses
magnetization, as seen in the high average magnetization per the ordering tendency of spin interactions. As a result, the
spin of approximately 0.98. The majority of the lattice spins magnetization drops significantly to 0.12, and the lattice
are aligned, forming large coherent spin domains. This shows randomly oriented spin domains with high
phenomenon is indicative of the system residing below the configurational entropy. The increase in system energy to -
critical threshold, where thermal fluctuations are insufficient 1.21 confirms the destabilization of cooperative behavior
to disrupt the ferromagnetic order. The energy per spin is also among spins, reflecting the onset of paramagnetic
low, measured at approximately -1.95, consistent with a disordering. This state is characterized by frequent spin flips
minimized interaction energy resulting from aligned and domain fragmentation, in line with the statistical
neighboring spins. suppression of long-range order above 𝑻𝒄 .
At lower temperatures such as 𝑻 = 𝟐. 𝟎, the system confirms these thermal dynamics. The stable, narrow
resides in a near-minimum energy state due to strong spin fluctuation band at 𝑻 = 𝟐. 𝟎 contrasts with the broader,
alignment. As depicted in the accompanying line graph, the irregular trajectory at 𝑻 = 𝟐. 𝟓. This temporal evolution
energy per spin stabilizes around an average value of reveals that the system below 𝑻𝒄 rapidly relaxes into a
approximately -2.0, with minimal fluctuations. This behavior metastable energy basin, while above 𝑻𝒄 , the system explores
is indicative of a thermodynamically favorable, low-entropy a wider set of microstates with comparable energy, resulting
ferromagnetic phase. The convergence to equilibrium is in dynamic fluctuation behavior.
rapid, and the system maintains coherence with only minor
perturbations arising from local spin flips. These patterns are essential in determining the sampling
period post-equilibration, as they influence the statistical
In contrast, at 𝑻 = 𝟐. 𝟓, the energy landscape reflects reliability of observables such as specific heat and magnetic
increased thermal disorder. The energy per spin fluctuates susceptibility derived from energy fluctuations. The high
around -1.32 with greater amplitude, revealing the influence stability at 𝑻 = 𝟐. 𝟎 allows for shorter equilibration times,
of frequent spin reversals. This is consistent with the onset of whereas the noisy energy signature at 𝑻 = 𝟐. 𝟓 necessitates
paramagnetic behavior, where thermal agitation overcomes extended simulation durations to ensure accurate ensemble
the cooperative interaction energy 𝑱 between neighboring averages.
spins. The energy profile demonstrates slower convergence
and larger variance, typical of systems near or above the The table titled Energy Variation Across Time provides
critical temperature 𝑻𝒄 , where long-range order diminishes a snapshot of energy per spin values at distinct time intervals
and configurational entropy increases. during the simulation. These values align well with expected
thermodynamic behavior, reinforcing the system’s physical
Quantitatively, the energy time series plotted across realism and validating the simulation protocol.
Monte Carlo time steps (expressed in units of 𝟏𝟎𝟑 MCSS)
At 𝑻 = 𝟐. 𝟎, well below the critical temperature 𝑻𝒄 , the This formulation links the observed fluctuations in 𝑴 to
system stabilizes rapidly into a strongly magnetized state, the system’s response to an external perturbation (e.g., a
characterized by a mean magnetization per spin close to 0.98. magnetic field). Although no external field is applied in this
As shown in the plotted magnetization trajectory, fluctuations simulation, the intrinsic susceptibility peaks near the phase
remain minimal over time, indicating that most spins remain transition due to enhanced fluctuations. As 𝑻 → 𝑻𝒄 , 𝝌
coherently aligned due to dominant ferromagnetic diverges in the thermodynamic limit, confirming the onset of
interactions. This ordered state is thermodynamically criticality.
favorable at low thermal energy and marks the persistence of
long-range spin correlation across the lattice. The high stability of magnetization at 𝑻 = 𝟐. 𝟎 allows
for precise susceptibility calculations with low variance,
Conversely, the magnetization at 𝑻 = 𝟐. 𝟓 shows a while the erratic magnetization at 𝑻 = 𝟐. 𝟓 necessitates larger
marked departure from stability. The plotted magnetization statistical sampling and binning correction to suppress
curve for this temperature exhibits wide fluctuations and a autocorrelation effects. The magnetization values also guide
significant decrease in mean value, hovering around 0.06– phase classification—systems with ⟨𝑴⟩ → 𝟏 are deemed
0.13 across time steps. This behavior is symptomatic of ferromagnetic, while those with ⟨𝑴⟩ ≈ 𝟎 are indicative of
paramagnetic disorder, where thermal agitation disrupts spin paramagnetic states.
alignment, resulting in transient and spatially incoherent
magnetization domains. The loss of macroscopic order above The figure titled Magnetization Variation Over Time
𝑻𝒄 is thus statistically captured in the suppression of 𝑴 over clearly demonstrates the contrasting behaviors across
time. temperature regimes, while the table titled Magnetization
Variation Across Time quantifies magnetization at discrete
From a thermodynamic standpoint, the magnetic time intervals. This comparative analysis substantiates the
susceptibility 𝝌 is defined via the fluctuation–dissipation critical transition from ordered to disordered phases,
relation: emphasizing the predictive power of 𝑴(𝒕) trajectories in
detecting equilibrium phase states.
𝟏
𝝌= (⟨𝑴𝟐 ⟩ − ⟨𝑴⟩𝟐 )
𝒌𝑩 𝑻
The mean energy per spin ⟨𝑬⟩ quantifies the average critical sensitivity of magnetization to thermal excitation
interaction energy between neighboring spins and evolves compared to energy.
with temperature due to changing spin configurations. As
shown in the plotted graph, ⟨𝑬⟩ begins at approximately Furthermore, the tabular data under Mean Energy and
−𝟏. 𝟖𝟕 at 𝑻 = 𝟏. 𝟓, indicative of a low-entropy, energy- Magnetization vs Temperature provides discrete numerical
minimized state where spins are predominantly aligned. As values that trace the trajectory of these observables across the
temperature increases, ⟨𝑬⟩ smoothly increases (less negative) sampled thermal regime. This dual analysis, combining visual
due to enhanced spin flipping, reaching approximately −𝟏. 𝟏 and statistical perspectives, confirms that both observables
near 𝑻 = 𝟑. 𝟎. This transition is continuous and reflects the serve as effective thermodynamic signatures of the Ising
thermally driven destruction of spin coherence. phase transition, with ⟨𝑴⟩ functioning as a sharper indicator
of criticality.
The mean magnetization per spin ⟨𝑴⟩, on the other
hand, exhibits a sharper transition. At low temperatures (𝑻 < E. Interpretation of Phase Transition Characteristics
𝟐. 𝟎), ⟨𝑴⟩ remains close to unity, reflecting robust long-range The transition from an ordered to a disordered state in
ferromagnetic order. However, as the system approaches the the two-dimensional Ising model is a hallmark of second-
critical point (𝑻 ≈ 𝟐. 𝟐𝟕), ⟨𝑴⟩ rapidly decays due to order phase transitions. This transformation is driven by
intensified thermal agitation and critical fluctuations. Beyond thermal fluctuations and characterized by sharp changes in
𝑻𝒄 , ⟨𝑴⟩ trends toward zero, signifying the loss of global spin macroscopic observables. In this context, two primary
alignment in the paramagnetic phase. This steep decay is indicators of phase transition—namely the order parameter
characteristic of a second-order phase transition and reflects (mean magnetization ⟨M⟩) and the specific heat 𝑪𝒗 —are
spontaneous symmetry breaking in the order parameter. evaluated to dissect the critical dynamics near the Curie point
𝑻𝒄 ≈ 𝟐. 𝟐𝟕.
The line plots in the figure titled Mean Energy and The order parameter, defined as:
Magnetization vs Temperature visually capture these trends, 𝑵
𝟏
with sigmoid-like transitions centered around 𝑻𝒄 . The smooth ⟨𝑴⟩ = ⟨∣ ∑ 𝝈𝒊 ∣⟩
rise in ⟨𝑬⟩ contrasts with the steep fall in ⟨𝑴⟩, underlining the 𝑵
𝒊=𝟏
quantifies the degree of spontaneous magnetization. As specific heat across the simulated temperature range. These
shown in the plot, ⟨M⟩ remains close to 1.0 at low values consolidate the graphical trends and demonstrate the
temperatures, indicating coherent spin alignment and strong system’s critical behavior with high fidelity.
ferromagnetic ordering. However, as temperature increases
and approaches 𝑻𝒄 , ⟨M⟩ experiences a sharp decline, V. CONCLUSION AND RECOMMENDATIONS
asymptotically approaching zero. This reflects the breakdown
of long-range order due to enhanced thermal agitation and the A. Summary of Key Findings
emergence of symmetric spin distributions. The sigmoid This study rigorously explored the thermodynamic
decay of ⟨M⟩ mirrors the mean-field prediction and behavior of the two-dimensional Ising model using
substantiates the role of ⟨M⟩ as an effective symmetry- Metropolis-based Monte Carlo simulations implemented in
breaking order parameter. MATLAB. Key physical observables, including energy,
magnetization, specific heat, and magnetic susceptibility,
In parallel, the specific heat 𝑪𝒗 , defined via energy were computed across a finely sampled temperature range to
fluctuations as: characterize the model’s critical phenomena.