home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 16
/
016.d81
/
t.crystals
< prev
next >
Wrap
Text File
|
2022-08-26
|
2KB
|
150 lines
RANDOM CRYSTALLIZATION
Written by: Mark Zimmerman
Random Thoughts: Programming,
Philosphy, and Crystals
Commodore Microcomputers, October 1985
Page 110
A crystal has a regular arrangement
of atoms or molecules, yet it forms
from a chaotic melt or solution,
where the atoms move around randomly
relative to each other. Perfect
crystals form slowly. If you try to
grow a crystal too fast, defects or
dislocations develop. Annealing, a
process of slow heating and cooling,
can get rid of some defects without
having to melt the crystal and start
over.
To experiment with this little
phenomena, you can use the CRYSTALS
program on this issue.
The program CRYSTALS is a short
BASIC program that simulates the
motion of atoms in a two-dimensional
world. The atoms move in a limited
area, surrounded by a solid wall of
"frozen" atoms to keep them confined.
Atoms tend to stick to each other.
They have lower energy if they have
neighbors. This stickiness accounts
for crystallization. The chance of
an atom moving depends on the
temperature and the difference of
energy before and after the move.
Specifically, atoms obey the
Boltzmann Law, which says that the
chance of an atom moving is
proportional to:
-(change in energy)/temperature
e
This means that things tend to move
"downhill", toward lower energy, with
random fluctuations from time to
time.
CRYSTALS defines the area as a
10x10 grid. The energy of an atom is
defined to be -1 for each neighbor it
has. An atom with no neighbors has
zero energy. One with four neighbors
has energy of -4. The user supplies
the temperature and the number of
atoms (1-99). Once the model is
running, an atom is represented by a
small dot in the grid. The program
will then find a random atom and
check its energy for movement. The
program will then update the display
and continue. If you want to exit to
try again or to return to LOADSTAR,
simply press a key.
*** NOTE ***
The screen display is not the same
as that in the magazine. It was
enhanced by Alan Gardner.
This program is copyrighted by
Commodore magazine. All rights to it
are reserved. LOADSTAR has relieved
you from the burden of keying in this
program. For more complete
information about this program, refer
to the October 1985 issue of
Commodore Microcomputers magazine.
>Files used: CRYSTALS
----------< end of article >----------