1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Monte Carlo Simulation, Ising model in 2D

  1. Jun 11, 2017 #1
    1. The problem statement, all variables and given/known data
    Lo,Im stuck on how to retrieve the specific heat capacity from an MC simulation, with the metropolis algorithm. I want my graph to look something like this:

    2. Relevant equations
    C_v = ((<E^2>-<E>^2)/T^2

    3. The attempt at a solution

    My code is similar to this guy:

    but without magnetization

    To retrieve C_v i wrote the following code to 4:19 from the video above.

    Cv = (E2/16384 - E.*E/16384^2)./(T(i).^2);


    Where E2 is given by the code:

    function [E2] = ising_energy(u,J)

    [L1,L2] = size(u);
    for i=1:L1
    for j=1:L2

    end;clear j
    end;clear i

    However my graph looks more like the plot of <E> vs T.

    Attached Files:

  2. jcsd
  3. Jun 16, 2017 #2
    Thanks for the thread! This is an automated courtesy bump. Sorry you aren't generating responses at the moment. Do you have any further information, come to any new conclusions or is it possible to reword the post? The more details the better.
  4. Jun 18, 2017 #3
    No, im still stuck atm. Cant get any reasonable graph. Is there someone that have done this type of simulation before ?
  5. Jul 9, 2017 #4
    Someone that knows what iam missing ?
  6. Aug 26, 2017 #5
    where is your code?
  7. Aug 28, 2017 #6
    I solved it
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted