Skip to content

2lambda123/monte-carlo-2D-ising

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Monte Carlo Simulation of the 2D Ising model

Summary

Explores the properties of the generalized Ising Model in 2 dimensions. The spins are arranged in a square lattice and interact with the nearest neighbours only. Periodic boundardary conditions are imposed in both directions. Video demo of 2d ising visualization for monte carlo algorithm applied over time here.

ising2D Function Input Variables

The ising2D.m uses the Monte Carlo algorithm to simulate the behaviour of a General 2D Ising Model under specified conditions. If the plot flag is set to 1 then it will show the real time change of the cell matrix over time.

T = Temperature

N = linear lattice size

J = Ising coupling

plot_flag - 1 to have the script plot the cell matrix evolution in real time

Figure of real time Ising Model(J = 1, T = 3, N = 40)

alt text

tempChange and T_C_investigation

These scripts graph the energy, magnetization, heat capacity, and magnteic susceptibility as temperature changes. The difference between them is that T_C_investigation.m focuses more on the range around the critical temperature.

Thermalization

The thermalization time is how long it takes for the algorithm to reach an equilibrium.

thermalization_relationship plots the thermalization time of the simulated ising models as the value of N is increased. This script is dependant on the thermalization.m script.

Calculation for initial model energy:

Optimization for Metropolis Algorithm

Predetermined all the possible probabilities for the Metropolis algorithm. This way the code does not have to execute the relatively taxing ‘exp’ function every iteration.

alt text

Equation for calculating magnetic susceptibility:

Equation for calculating heat capacity

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages