Suggested languages for you:

Americas

Europe

Q 8.27

Expert-verifiedFound in: Page 354

Book edition
1st

Author(s)
Daniel V. Schroeder

Pages
356 pages

ISBN
9780201380279

Modify the ising program to compute the average energy of the system over all iterations. To do this, first add code to the initialise subroutine compute the initial energy of the lattice; then, whenever a dipole is flipped, change the energy variable by the appropriate amount. When computing the average energy, be sure to average over all iterations, not just those iterations in which a dipole is actually flipped (why?). Run the program for a 5 x 5 lattice for T values from 4 down to l in reasonably small intervals, then plot the average energy as a function of T. Also plot the heat capacity. Use at least 1000 iterations per dipole for each run, preferably more. If your computer is fast enough, repeat for a 10x 10 lattice and for a 20 x 20 lattice. Discuss the results. (Hint: Rather than starting over at each temperature with a random initial state, you can save time by starting with the final state generated at the previous, nearby temperature. For the larger lattices you may wish to save time by considering only a smaller temperature interval, perhaps from 3 down to 1.5.)

Hence, heat capacity with respect to temperature is given in the picture.

Modify the ising program to compute the average energy of the system over all iterations. To do this, first add code to the initialise subroutine compute the initial energy of the lattice; then, whenever a dipole is flipped, change the energy variable by the appropriate amount. When computing the average energy, be sure to average over all iterations, not just those iterations in which a dipole is actually flipped. Run the program for a 5 x 5 lattice for T values from 4 down to l in reasonably small intervals, then plot the average energy as a function of T.

Below is the code for determining the average energy:

This graph depicts average energy (y-axis) as a function of temperature (x-axis):

And the heat capacity is:

94% of StudySmarter users get better grades.

Sign up for free