Physics students now have access to interactive molecular dynamics simulations that can model and animate the motions of hundreds of particles, such as noble gas atoms, that attract each other weakly at short distances but repel strongly when pressed together. Using these simulations, students can develop an understanding of forces and motions at the molecular scale, nonideal fluids, phases of matter, thermal equilibrium, nonequilibrium states, the Boltzmann distribution, the arrow of time, and much more. This article summarizes the basic features and capabilities of such a simulation, presents a variety of student exercises using it at the introductory and intermediate levels, and describes some enhancements that can further extend its uses. A working simulation code, in html5 and javascript for running within any modern Web browser, is provided as an online supplement.

1.
R. P.
Feynman
,
R. B.
Leighton
, and
M.
Sands
,
The Feynman Lectures on Physics
(
Addison-Wesley
,
Reading, MA
,
1963
), Vol. I, available online at <http://www.feynmanlectures.caltech.edu/>. The “atomic hypothesis” quote is on p.
1-2
.
2.
For a video interview of Feynman applying his imagination and thinking to the atomic hypothesis, see “
Fun to Imagine I: Jiggling Atoms
,” BBC program first broadcast July 8, 1983, <http://www.bbc.co.uk/archive/feynman/10700.shtml>, also available at <https://www.youtube.com/watch?v=v3pYRn5j7oI>.
3.
Boston University Center for Polymer Studies, “
Virtual Molecular Dynamics Laboratory
,” <http://polymer.bu.edu/vmdl/>. This Web site also introduces molecular dynamics with the Feynman “atomic hypothesis” quote, which is too good not to steal.
4.
S.
Novick
and
J.
Nussbaum
, “
Pupils' understanding of the particulate nature of matter: A cross-age study
,”
Sci. Educ.
65
(
2
),
187
196
(
1981
).
5.
R.
Driver
 et al,
Making Sense of Secondary Science: Research into Children's Ideas
(
Routledge
,
London
,
1994
), Chap. 11.
6.
A. B.
Arons
,
A Guide to Introductory Physics Teaching
(
Wiley
,
New York
,
1990
), pp.
274
281
.
7.
M. P.
Allen
and
D. J.
Tildesley
,
Computer Simulation of Liquids
(
Clarendon Press
,
Oxford
,
1987
).
8.
J. M.
Haile
,
Molecular Dynamics Simulation
(
Wiley
,
New York
,
1992
).
9.
D. C.
Rapaport
,
The Art of Molecular Dynamics Simulation
, 2nd ed. (
Cambridge U.P.
,
Cambridge
,
2004
).
10.

Stark Design, “Atomic Microscope” (Windows and Mac Classic application). This software, first released around 1999, is apparently no longer available, but is described in Ref. 11 and is similar in many ways to Atoms in Motion, Ref. 12.

11.
S.
Carlson
, “
Modeling the atomic universe
,”
Sci. Am.
281
(
4
),
118
119
(
1999
).
12.
Atoms in Motion LLC, “
Atoms in Motion
” (iPad app), <http://www.atomsinmotion.com/> (2011–2012).
13.
PhET project, “
States of Matter
” (Java Web Start application), <http://phet.colorado.edu/en/simulation/states-of-matter> (2009–2012).
14.
The Concord Consortium, “
Molecular Workbench
” (Java simulations and modeling tools), <http://mw.concord.org/> (2004–2013). A new html5 version is also available, at <http://mw.concord.org/nextgen/>.
15.
H.
Gould
,
J.
Tobochnik
, and
W.
Christian
,
An Introduction to Computer Simulation Methods
, 3rd ed. (
Pearson Addison Wesley
,
San Francisco
,
2007
).
16.
N. J.
Giordano
and
H.
Nakanishi
,
Computational Physics
, 2nd ed. (
Pearson Prentice Hall
,
Upper Saddle River, NJ
,
2006
).
17.
D. V.
Schroeder
, Physics Simulations in Java: A Lab Manual (unpublished) 2006–2011, <http://physics.weber.edu/schroeder/javacourse/>.
18.
L. M.
Sander
,
Equilibrium Statistical Physics: With Computer Simulations in Python
(
CreateSpace Independent Publishing
, Seattle,
2013
), URL: <http://www-personal.umich.edu/~lsander/ESP/ESP.htm>.
19.
H.
Gould
and
J.
Tobochnik
,
Statistical and Thermal Physics: With Computer Applications
(
Princeton U.P.
,
Princeton
,
2010
).
20.
Open Source Physics Project, “
LJfluidApp
,” <http://stp.clarku.edu/simulations/lj/md/index.html> (
2009
).
21.
See supplemental material at http://dx.doi.org/10.1119/1.4901185 for the simulation program, user instructions, and a version of the exercises in Sec. VI that is customized for this particular simulation. These materials are also available at <http://physics.weber.edu/schroeder/md/InteractiveMD.html>.
22.
In this case, the van der Waals force is also called the London dispersion force; it is caused by quantum fluctuations of the molecules' electronic charge distributions. The 1/r6 dependence is derived using perturbation theory in many quantum mechanics textbooks. See also
B. R.
Holstein
, “
The van der Waals interaction
,”
Am. J. Phys.
69
(
4
),
441
449
(
2001
); and
K. A.
Milton
, “
Resource Letter VWCPF-1: van der Waals and Casimir-Polder forces
,”
Am. J. Phys.
79
(
7
),
697
711
(
2011
).
23.
G. C.
Maitland
 et al,
Intermolecular Forces: Their Origin and Determination
(
Clarendon Press
,
Oxford
,
1981
). This monograph makes an exhaustive assessment of the limitations of the Lennard-Jones 6-12 potential.
24.

The walls can be hard, producing instantaneous reversals in velocity, or soft, exerting a spring-like repulsive force that grows as atoms penetrate into the walls more deeply. The accompanying code (Ref. 21) uses soft walls (with a spring constant of 50 in natural units), because of the simplicity of all forces being smoothly varying functions of position. A disadvantage of this method is that the volume of the simulated space is somewhat variable and hence ambiguous, especially at high temperatures.

25.

As of this writing, the current versions of all major browsers for personal computers deliver impressive JavaScript performance that is more than adequate for the simulations described in this article. Performance of javascript on mobile devices, however, is much more variable.

26.

Another popular interpreted language is python, which offers advantages in a computational physics course or other setting where students will be writing or modifying the code. As of this writing, python's relatively poor performance limits the size of an interactive molecular dynamics simulation running at a reasonable animation rate. However, through use of the NumPy library (<www.numpy.org>) to vectorize the calculations (see, e.g., the program simplemd.py in Ref. 18), one can still reach a performance level that is adequate for most of the examples and exercises in this article.

27.

The most powerful optimization technique is to divide the simulation space into a grid of “cells” whose widths are no smaller than the cutoff distance. Then each atom can interact only with atoms in its own cell and the eight nearest neighbor cells. The algorithm is described in Refs. 7 and 9 and is used in the code of Ref. 21. The additional coding can be done in only a few dozen lines and is well worth the trouble for simulations of 500 or more particles, but provides no benefit at all when N100.

28.

The configuration shown in Fig. 3(f) will not spontaneously equilibrate, but it can be annealed by gradually adding energy.

29.
Apple Computer, Inc.
,
Inside Macintosh
(
Addison-Wesley
,
Reading, MA
,
1985
), p.
I-27
.
30.

Implementing “permissiveness” in a molecular dynamics simulation can be challenging, because some potential user actions (e.g., placing the atoms so they overlap) can add large amounts of energy to the system, triggering the numerical instability described in Sec. III. The accompanying simulation (Ref. 21) tries to adapt to dangerous user actions by decreasing the time step dt and limiting the rate at which particles can be manually pushed together. Still, it is not hard for a curious user to “break” the simulation, generating an error message and necessitating a reset. This experience can sometimes be instructive but is usually just frustrating.

31.

Some molecular dynamics software (Refs. 3 and 20) goes further to include built-in plotting of various data. This feature can be useful for quick demonstrations, but it usually reduces the degree to which the student is actively engaged in deciding how to gather and analyze the data. Also, as a practical matter, it is difficult to pre-program all of the different types of plots that students and instructors might wish to make.

32.

The online supplement (Ref. 21) to this article includes a version of the exercises with instructions and hints that are specific to the accompanying software.

33.
Feynman et al., Ref. 1, Chap. 46. See also
H. S.
Leff
and
A. F.
Rex
,
Maxwell's Demon 2: Entropy, Classical and Quantum Information, Computing
(
Institute of Physics Publishing
,
Bristol
,
2003
), Sec. 1.2.5, and references therein.
34.
Besides the usual approaches to quantum statistical mechanics found in every textbook, see (for example)
T. A.
Moore
and
D. V.
Schroeder
, “
A different approach to introducing statistical mechanics
,”
Am. J. Phys.
65
(
1
),
26
36
(
1997
);
M.
Ligare
, “
Numerical analysis of Bose-Einstein condensation in a three-dimensional harmonic oscillator potential
,”
Am. J. Phys.
66
(
3
),
185
190
(
1998
); and
J.
Arnaud
 et al, “
Illustration of the Fermi-Dirac statistics
,”
Am. J. Phys.
67
(
3
),
215
221
(
1999
).

Supplementary Material

AAPT members receive access to the American Journal of Physics and The Physics Teacher as a member benefit. To learn more about this member benefit and becoming an AAPT member, visit the Joining AAPT page.