- #1
Firben
- 145
- 0
Homework Statement
In a XY - model in two dimensional square lattice. I want to calculate specific heat capacity, <E> and <E^2>. By using the formula:
H = -Jsum(<i,j>)Cos(tetha(i)-tetha(j))
The Metropolis algorithm reads:
Simulations for Statistical and Thermal Physics
Homework Equations
H = -Jsum(<i,j>)Cos(tetha(i)-tetha(j))
The Attempt at a Solution
Here is my code for the Hamiltonian:
http://s716.photobucket.com/user/Pitoraq/media/MC_zpsqqzwctgg.png.html?sort=3&o=0
What is wrong with my code ?