|
Ising Model |
|
Program Notes |
This applet makes use of the Java 1.1 virtual machine's event model. As a result it will not run on Netscape 4.x for the Macintosh, nor on sufficiently old browsers. It has not currently been tested on Internet Explorer. This applet is currently not tested on Internet Explorer or on the Macintosh. Reports of its performance would be appreciated. |
|
|
|
||
About This Applet |
The main display presents a cross-section of the simulated lattice, along a (user-selected) plane. Each point of the lattice gets a circular wedge representing the direction of the magnetic moment at that site. Wedges colored blue point above the plane of the screen, towards the viewer; wedges colored red point into the screen, away from the viewer. The more intense the color, the greater the `vertical' direction; a gray wedge lies in the plane of the screen. The direction of the wedge indicates in what direction the portion of the magnetic moment in the plane of the screen points: the exact direction is from the central lattice point to the middle of the circular edge. If the magnetic moment is nearly perpendicular to the plane of the screen, a circle (red or blue) is drawn instead of the wedge. The `Start' button begins the simulation and reveals the `Stop' button; the `Stop' button halts the simulation and reveals `Start.' These functions are the same as the `Start' and `Stop' menu selections under the `File' menu in the `Set Model Parameters' window. `Higher' and `Lower' increase and decrease the level of the slice of the lattice displayed in the picture. If the lattice has only one level in the display dimension (which can be changed in the `Set Model Parameters' window), these buttons are disabled. `Change Parameters' opens the `Set Model Parameters' window, described below. It allows all the interesting properties of the lattice model to be altered. Under the `File' menu in the `Set Model Parameters' window, the command `New' resets the existing lattice, choosing new magnetic moments for each lattice point. `Start' and `Stop' under the `File' menu make the simulation begin, and halt, running. They do the same work that the `Start' and `Stop' buttons on the main window do. The `Close' command closes the parameter window. None of the changes made in the window `Set Model Parameters' will take effect until the `Set These Parameters' button is pressed. The `Clear' button restores the system to all its default settings, clearing all changes; the `Reset' button resets the lattice (and the measurements made of it) while respecting the last set parameters. Note that `Reset' does the same job as `New' under the `File' menu. The number of lattice points in the x, y, and z direction represent the number of points in each of those directions. Changing the number of points (and clicking `Set These Parameters') will force the lattice to reset, wiping out any existing magnetic states in the simulator. The temperature in the system may be positive, zero, or negative. It relates to how likely a given rotation will be. The temperature decline percentage reflects by what percentage the temperature should `decrease' after every sweep through the lattice. (The simulation makes one sweep if it has tried -- not necessarily accepted -- a number of rotations equal to the total number of sites in the lattice.) `Decrease' in this case means approaching zero; a negative temperature which `decreases' actually becomes greater. Note that despite the name (and typical use) of this field, negative numbers are accepted for the `decline' percentage -- so that after each sweep the temperature actually increases. The Interaction Strength J represents how strong the main pairwise interactions of the lattice are. The Magnetic Field strength, X, Y, and Z, reflects how strong and in what direction the externally applied magnetic field is. The Periodic X, Y, and Z boundary checkbox indicate the desired boundary conditions. If checked, the boundaries are periodic: the rightmost points regard the leftmost ones as their neighbors, the topmost ones regard the bottommost ones as neighbors, and so on. If unchecked, the lattice has a free boundary in that dimension. Note these boundaries may be checked or unchecked independently of one another. The Maximum Rotation per Step, if enabled, reflects by how great an angle a single site's magnetism may be rotated in a single step. If the rotation is 2.0, for instance, then the magnetism may be rotated between -Pi and +Pi radians from its current alignment (in any direction). If the rotation were 0.2, the magnetism could be rotated only between -Pi/10 and +Pi/10 from its current alignment. Note that while larger maximum rotations provide more dramatic changes early on in a simulation, smaller rotations are more likely to be accepted in the later stages because they represent smaller energy changes overall. Maximum Rotation per Step may be disabled entirely, if the magnets are set `Constrained to Z Axis,' that is, forced to be parallel (or antiparallel) to the Z axis, or if it is set to one of the other constraints which similarly allow only a very few separate states. Magnets constrained this way can only flip direction, from one extreme to another; no intermediate states are allowed. If the Maximum Rotation per Step window is disabled, very likely the cause is the magnetic moment's constraint. Display Lattice Level represents which level should be pictured. Moving about here will typically be faster than using the `Lower' and `Higher' buttons on the main simulation screen. The `View From (X, Y, Z) Slice' choice allows one to select whether one looks at the lattice from a plane of constant X, constant Y, or constant Z value. `Display Lattice Level' selects which plane to represent. The magnetism constraint reflects whether the magnetic moments on each lattice site should be allowed `Free Movement'; whether they should be `Confined to XY Plane,' in which case they will all have z-component equal to zero but will be allowed to freely move in the XY plane; or 'Constrained to Z-Axis,' in which they will all be parallel or antiparallel the Z axis; or `Constrained to Square Corners,' in which case they are in the XY plane, pointing to the corners of the two-dimensional square; or `Constrained to Cube Corners,' in which case they are constrained to one of the corners of the three-dimensional cube. Note that if the magnetic moments are constrained to parallel or antiparallel the Z axis, to the square corners, or to the cube corners, then the `Maximum Rotation per Step' box will be disabled, as the simulation will not allow anything but a flip of the magnetic moment consistent with those constraints. Changing the magnetism constraint will force the lattice to reset all the magnetic moments, just as it would if the number of lattice points were changed. The `Equalize' button takes the existing lattice state and flips sites until the total net magnetic moment is as nearly balanced as possible. (If the total number of sites is even, the system will balance so the net magnetism in any direction is zero. If the total number of sites is odd, the system will balance as close to zero as possible.) This may take time, particularly if the magnetic moments are unconstrained; very likely one should stop the simulation before pressing this button. The `Set These Parameters' button checks all the existing parameters for sanity (that there are to be a positive, whole number of lattice sites in each dimension, for example); if they all pass, then the new parameters are put into the system. If the size of the lattice has changed, or if the magnetism constraint has changed, then all the magnetic moments will be randomly reselected. In any case the other settings -- temperature, temperature decline, and so on -- are passed on to the system. Note that the parameters may be changed while the simulation runs. The `Clear' button restores the system to all its default settings, clearing all changes; the `Reset' button resets the lattice (and the measurements made of it) while respecting the last set parameters. Note that `Reset' does the same job as `New' under the `File' menu. `Cancel' and `Close' both close the `Set Model Parameters' window without enacting any of the changes on it. They are separate buttons to provide for possible future use in which they serve separate functions. Known bugs: When run as an application, or through the command line appletviewer, the simulator sometimes crashes when running larger lattices. This appears to be a threading problem, very likely caused by the command-line Java virtual machines working considerably faster than the Netscape 4.76 one -- the problem does not seem to occur there. More work remains to be done on the problem. |
|
About The Ising Model |
The nearest-neighbor Ising model begins with a regularly spaced lattice of crystal sites each holding a magnetic spin. The Monte Carlo simulation picks a lattice site randomly and experimentally rotates the magnetic spin at that site to a new direction. The simulator calculates by how much the energy of the system would change if that rotation were permitted; if it satisfies a given criteria, the rotation is allowed to stand. Otherwise the system is left as it originally was. This simulator uses only the nearest-neighbor interactions and the interaction with the applied external magnetic field. The Hamiltonian potential is then: H = \sum^{N}_{i \ne j} { J \vec{S_i} \cdot \vec{S_j} - \sum^{N}_{i = 1} \vec{M} \cdot \vec{S_i} where N is the number of sites, J is the nearest neighbor interaction strength, S_i is the magnetism at site i, and M is the external magnetic field. The criteria to determine whether a rotation is accepted is: if a (uniformly distributed) [pseudo] random number between 0 and 1 is less than 1 / (1 + exp(energyChange / temperature)), then the rotation is accepted. This is independent of whether the energy change is a net gain or loss of energy, and is also indepenent of whether the temperature is positive or negative. If the temperature is zero, then any change which decreases the energy of the system is accepted; any change which increases energy is rejected. The Correlation Probability in the report window represents the probability that any given site has a neighbor whose magnetic moment points in the same direction its own does. The Correlation Length is an approximate measure of the size of uniformly-pointing patches within the field; in a model such as this, the correlation length grows infinitely large (or at least grows to the maximum floating point number available to the system) when the system's temperature drops below the critical temperature. |
|
Source Code |
The source code for the Ising model applet may be downloaded. The program is designed to run as an applet or an application. (An example web page for the applet is not included in the file; one may look at the HTML for this page for an example of its installation.) The main file is MonteCarlo.java. | |
Web Master |
Web page designed by Joseph Nebus ( nebusj@rpi.edu ). Last updated 7 August 2001. |
|