You can use mouse to rotate the structure.
The above applet: LJ3MDApp.java
Command-line version: LJMD.java (no GUI).
The C program (a snapshot is shown on the right)
uses OpenGL for better 3D rendering.
It also has better keyboard support.
The source code is here: lj3.c
(needs -lglut -lGLU
to compile).
A command-line version: ljmd.c (no GUI simpler).
Precompiled executables:
chmod +x lj3mac
then run it as ./lj3mac
or double-click it.)
† Contrary to my speculation, the C version is only marginally faster than the Java one. With optimal flags (icc -O3, gcc -O3 -march=pentium4 -mfpmath=sse, and Java -O) the relative speed for Intel C/GCC/Java is 1.0/0.9/0.76. Note, GCC could make a terribly slow version without the -mfpmath=sse flag.
The potential between two particles is given by
where r is the distance between the two particles. The potential energy of the system is the sum of potentials from all pairs.
To reduce the finite-size effect, we have used the periodic boundary conditions,
The potential is truncated at the half-box size, at which point the force becomes discontinuous (a minor artifact, usually negligible).
The pressure is computed from the sum of the ideal gas part ρkT and virial divided by 3V.
The tail corrections are applied to the potential energy and pressure.
Many people would choose to simulate a system of 108, 256 or 500 particles (N), especially at a low temperature. Is there is a reason? (Hint: N = l3/2).
Does the use of a thermostat make a difference?
Compare the simulation results with those in: The Lennard-Jones equation of state revisited, J. Johnson, J Zollweg and K. Gubbins, Mol. Phys. 1993, Vol 78, No. 3, 591-618