SimSurface Help
Summary
SimSurface is a program designed for use in instruction of computational
science in general and of the specific numerical techniques used in the
program.
SimSurface demonstrates two commonly used computational
techniques.
The first, simulated annealing, is an often-used method for finding
global maxima and minima of complicated multi-dimensional functions. It
can be used any time you have a function that gets big when things are
bad and small when things are good (or vice-versa). The problem being solved
in SimSurface is a minimization of potential energy. The question we are
trying to answer is: given n stationary electrons/protons confined
to a 2-dimensional surface by four charged walls, what arrangement of electrons
has the minimum total energy and is therefore the configuration preferred
by nature? Simulated annealing works by randomly varying each parameter,
and storing the configuration with the lowest energy. We use that as a
starting point for the next random process, but each time we change the
parameters a little less. The collection of parameters that we are changing
is sometimes refered to as an amoeba, as each change we make in
the parameters is like a pod of an amoeba, spreading out, and then moving
in the direction of least resistance.
Typical initial configuration
Typical final configuration
The second commonly used numerical technique is the relaxation method.
Once the system has reached a minimum energy (to within a specified tolerance),
we would like to know what the electrical potential looks like around the
electrons. This could of course just be calculated directly at each point,
but a much faster and widely used technique called relaxation is actually
used to solve Laplace's equation. Laplace's equation says that the net
curvature of the potential surface is zero everywhere (del^2 phi=0) on
the surface (except at the point charges themselves), but the relaxation
method is very easy to understand, even for those that do not fully understand
the equation it is solving. It is an iterative process, which at each iteration
sets the value of a grid point equal to the average of its 4 neigbors.
The charges and walls are held constant throughout this process. SimSurface
displays the end result of this process: the potential on the plate.
Note that the colored bands in the image are equipotential lines
of the field.
Running SimSurface on Windows & Macintosh
Simulation Menu
Settings - bring up the settings dialog box.
Restore Minimum - return to last known minimum configuration. This is reset
when charges are randomized.
Randomize Charges - place non-pinned charges in a random configuration.
Anneal - Begin simulated annealing calculation. Determine the configuration
with the minimum energy.
Calculate Potential - Given a charge configuration, and the charge distribution
of the walls, calculate the electrostatic potential due to the charge configuration.
Calculate Field - Once the potential has been calculated, calculate the
electric field strength.
Settings Dialog Box
Wall charges - set the negative charge spread evenly over each wall.
number of electrons - set the number of electrons in the model.
Cooling Factor - this multiplier gives the temperature of successive iterations
as a fraction of the temperature of the current interation.
Trials per Temperature - number of trials used within each iteration.
Temp to step ratio - as the temperature is reduced, so is the step size
of the amoeba used in the simulated annealing process. The length of the
"pods" of the amoeba are propotional to the current temperature.
Tolerance - code finishes when the percent difference in electron positions
from one iteration to the next are less than the specified tolerance.
Toolbox
Move - lets you drag charges to move them.
Add - adds a charge when you click on the screen.
Remove - removes a charge when you click on it.
Pin - sets a charge in place, will not move during the annealing process.
Start SimSurface, and randomize the charges. Select Anneal form the
Simulation menu, and watch the electrons move by random motion, at a lower
and lower temperature with each move. Notice the configuration that the
electrons finally reach. Depending on which version you have, the toolbox
may or may not show the energy of any given configuration, but you can
always open the notebook before annealing, and see the change in energy
with each iteration.
Assorted Notes and Frequently Asked Questions
-
Occasionally the final energy obtained is different, or the pattern
is slightly varied. Why?
-
The simulated annealing process used by
SimSurface is inherently
random in nature. Thus when run with different random seeds, the program
may produce different output patterns. However the differences in energies
should
be very small.
-
SimSurface is great, but I'm looking for an example of simulated annealing
that does not require as much understanding of physics. Any suggestions?
-
Why yes. We also have a program titled
SimElevator which uses the
same annealing process to model the way in which people arrange themselves
in an elevator. If there's sufficient interest in this (mail us), we would
consider creating a Mosaic front end to this as well.
-
Is source code for SimSurface publicly available?
-
In a word, no. In two words, not yet . Multiple versions of SimSurface
have been written to run on UNIX environments, over the web, and on both
PC and Macintosh. If you are interested in collaborating with us to create
a version of the code to run on a different platform, or to improve the
features of the code, contact David
Joiner at djoiner@shodor.org.
-
What's the coolest thing about SimSurface?
-
Our opinion: when we find the minimum energy configuration of 64 electrons,
we are in essence solving a global minimum problem in 128 dimensions. If
instead we just tested each coordinate at each of 10 values (a very coarse
sampling), we would have 1.0e128 energy calculations. Needless to say this
would take longer than the age of the universe. Instead, our program runs
in about 6 seconds. Thus as you can see the algorithm used is far
more important than whether the program is run on a Cray, an SGI or a Macintosh.
Ben Davenport (bpd@phoenix.princeton.edu)
Robert Panoff (rpanoff@ncsa.uiuc.edu)