Conservation Laws Demo version 0.1 Copyright (c) 1994 Karl J. Runge. Hi, This is a kinda kludgy (...but looks marvelous....) X windows demo on momentum and energy conservation laws. The system is a 2D periodic box filled with particles interaction with 1/r^7 pairwise repulsive force law. (this can be changed in ./MD/force.h and ./MD/get_forces.f if you want). The Verlet Molecular Dynamics algorithm is used. But the forces don't really matter, all that matters is total momentum and total energy (=Kinetic+Potential) is conserved. The motion of the particles is shown via the LasspTools "PlotAtoms" program (provided here, but also available at ftp://lassp-ftp.msc.cornell.edu/pub/LASSPTools/...) The individual momenta and vector sum are displayed as arrows in a separate window. So it is neat that with all the chaotic motion, one can see the total momentum and energy are conserved. In addition: There is a somewhat klunky "quiz mode" called "Making Predictions", and a kind of silly little "Aiming" game. Similar such examples are possible. The "Melting/Freezing" demo is one I already had setup and since it is Monte Carlo it conserves neither momentum nor energy. But it is fun. The melting temperature is about T=2 or so. Adjust the temperature which the slider or arrow keys or entry box and send it with the "Send" button. +++++++++++++ DEPENDENCIES+ +++++++++++++ This collections of programs works on Unix. With much difficultly it could be made to run on Winows95. But it has not been modified to do so. Atom viewer "PlotAtoms" only runs on Unix + X11. You will need to be able to compile X11 programs on Unix (Linux binary provided) +++++++++++++ INSTALLATION+ +++++++++++++ This program requires the "tcl/tk" windowing shell "wish" binary. tcl/tk is available at ftp://ftp.cs.berkeley.edu/ucb/tcl. Most Linux systems come with "wish" pre-installed. Make sure "wish" is in your PATH now before running the "./Install" command below. Unpack the tar file via zcat .tar.Z | tar -xvf - This will create a directory called "conservation". cd down into it (where you find this README again). Then type: ./Install That will check some things and alter some scripts, and make a startup script called "demo", that could be placed in your path. To run the demo just type demo If the system is Linux, it won't recompile the binaries unless you type "./Install -compile". On other systems, i.e it will try to recompile the fortran and "PlotAtoms" binaries...good luck. +++++++++++++ Instructions+ +++++++++++++ There are some instructions Richard Scalettar wrote for the students to read available in the files "instruct.tex", "instruct.dvi", or "instruct.ps". This demo needs some more on-line documentation and more "visual hints" as to what to do next. Any suggestions/volunteers? +++++++++++ Kiosk Mode+ +++++++++++ Under Linux (or in general something using the "fvwm" X window manager) In the directory "User" there are some "dot files" (i.e. .Xresources, .xinitrc, .xsession, .fvwmrc) so that one can define a user "demo", say, and so when that user logs in and/or starts X the demo will start automatically. There is very little available to the user, just xcalc basically. If one types Alt-F6 a small menu with useful things pops up, including how to exit the X session. Alt-F5 lists all the applications running. You'll have to put the directory ./Demo in the user demo's PATH variable. Either in .cshrc or hardwire into .xsession or .xinitrc. +++++++++++++++++++ Modifying examples+ +++++++++++++++++++ You can make your own demos as well by modifying the initial conditions via the input files ./Demo/MD-inputs/md*.in. Note that some have more coordinates than particles, for a N particle demo only the first N coordinates and velocities are read in. The remaining format and parameters of these input files is a bit hard to understand, stream-of-consciousness programming is (again) the culprit. email me for more info if you are interested. You can change which demos are available by changing the "pack" line in the file ./Demo/chooser. It is sort of obvious what to change. It should work "out of the box" under Linux. On any other Unix box the my fortran and C programs and PlotAtoms have to be recompiled, hope it is not too much trouble...email me if it is. +++++++++++++ Miss Cellany+ +++++++++++++ If your monitor is "low resolution", i.e. 1024x768 you may want the PlotAtoms viewer to be smaller. Set this with the "resolution" switch, e.g.: demo -r 320 makes the PlotAtoms window 320x320 pixels. I think default is 400x400 +++++++++++++++++++++ System V vulgarities+ +++++++++++++++++++++ SYSV machines (i.e. SGI, ULTRIX, MIPS) don't seem to have the usleep() micro-second sleep system call. So you may have to play with the file ./MD/milli.c a bit. If all else fails just use the sleep(time_in/1000) line. SYSV also has a messed up "ps" command (in my humble opinion). If "ps x" gives an error, you should copy the file ./Demo/ps_sysv to ./Demo/ps to override your system's "ps". comments/suggestions/demo_input_files are welcomed, Karl runge at-sign karlrunge.com