org.opensourcephysics.sip.ch15
Class ManyDemons

java.lang.Object
  extended by org.opensourcephysics.sip.ch15.ManyDemons
All Implemented Interfaces:
Drawable

public class ManyDemons
extends java.lang.Object
implements Drawable

ManyDemons simulation of thermal gradient using a demon at each site. The left end can add energy, the right end takes it out.


Field Summary
 int acceptedMoves
           
 int[] demonEnergy
           
 double[] demonEnergyAccumulator
           
 double[] mAccumulator
           
 int magnetization
           
 int mcs
           
 int N
           
 int[] s
           
 int systemEnergy
           
 double systemEnergyAccumulator
           
 int timeToAddEnergy
           
 
Constructor Summary
ManyDemons()
           
 
Method Summary
 void boundarySpins()
           
 void draw(DrawingPanel panel, java.awt.Graphics g)
          Draws a representation of an object in a drawing panel.
 void initialize()
           
 void resetData()
           
 void step()
           
 double temperature(int i)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

s

public int[] s

N

public int N

systemEnergy

public int systemEnergy

demonEnergy

public int[] demonEnergy

mcs

public int mcs

systemEnergyAccumulator

public double systemEnergyAccumulator

demonEnergyAccumulator

public double[] demonEnergyAccumulator

magnetization

public int magnetization

mAccumulator

public double[] mAccumulator

acceptedMoves

public int acceptedMoves

timeToAddEnergy

public int timeToAddEnergy
Constructor Detail

ManyDemons

public ManyDemons()
Method Detail

initialize

public void initialize()

temperature

public double temperature(int i)

resetData

public void resetData()

step

public void step()

boundarySpins

public void boundarySpins()

draw

public void draw(DrawingPanel panel,
                 java.awt.Graphics g)
Description copied from interface: Drawable
Draws a representation of an object in a drawing panel.

Specified by:
draw in interface Drawable