Skip to content
Tutorials Center
My learning

Topics

Lesson 28 of 47 · Molecular Dynamics

Chapter overview: molecular dynamics

What molecular dynamics is, how a simulation loop works, and what you will build in this chapter: forces, the Verlet integrator, and measured temperature and pressure.

A glass of water contains about 10²⁵ molecules. You cannot follow all of them, but you can follow a few hundred or a few million and learn a surprising amount. Molecular dynamics (MD) does exactly that: it treats atoms as little classical particles, computes the force on each one from its neighbors, and steps Newton's second law forward in tiny time intervals. From the resulting trajectories you can measure temperature, pressure, diffusion and structure.

MD was invented by Berni Alder and Thomas Wainwright, who simulated hard spheres in the 1950s, and Aneesur Rahman, who published the first simulation of a realistic liquid (argon with a Lennard-Jones potential) in 1964. Today the same idea drives drug design, materials research and climate-relevant chemistry.

A box of atoms with periodic images and a four-step loop: forces, move, wrap, measure
A molecular dynamics program is one loop: compute forces, move the atoms, wrap them into the box, measure.

What you will learn

  • What problem MD solves and when it is the right tool.
  • The four steps of every MD loop.
  • What reduced units are and why simulations use them.
  • What the next three lessons cover.

Key terms

Trajectory: the list of positions and velocities of all atoms at every time step.

Force field (potential): the formula for the energy as a function of atom positions; forces are minus its gradient.

Time step (Δt): the small interval over which we advance the equations of motion.

Periodic boundary conditions: the box is surrounded by copies of itself, so there are no walls.

Reduced units: units in which the particle mass, energy scale and length scale are all set to 1.

The loop at the heart of MD

  1. Forces. For each atom, add up the forces from all neighbors, F = −∇U.
  2. Move. Update velocities and positions using Newton's law a = F/m (we use the velocity Verlet scheme).
  3. Wrap. If an atom leaves the box, bring it back in from the opposite side.
  4. Measure. Record kinetic energy, pressure and distances between atoms.

Then go back to step 1. A typical production run repeats it a million times or more. Step 1 is by far the most expensive: with N atoms there are N(N−1)/2 pairs, which is why real programs use neighbor lists and cut-off distances.

Reduced units

Argon is the textbook case. Its Lennard-Jones parameters are approximately σ = 0.3405 nm and ε/k_B = 119.8 K, with atomic mass 39.95 u. A simulation sets σ = ε = m = k_B = 1. Then:

  • Lengths are in units of σ, energies in units of ε, temperatures in units of ε/k_B.
  • The natural unit of time is τ = σ·√(m/ε), which is about 2.16 ps for argon.
  • A typical time step is Δt = 0.005 τ, about 11 fs.

Working in reduced units means one simulation describes argon, krypton and xenon alike; you only rescale at the end.

Why simulate atoms?

Too small to watch Atoms move in femtoseconds
Hard to measure Simulations see everything
Real uses Drugs, alloys, batteries
1 / 3

What each lesson covers

Try it

Convert reduced units to real argon values. This is a calculator that applies the definitions above.

Python From reduced units to argon

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

And a quick sense of cost: the number of atom pairs grows like N², which is why cut-offs and neighbor lists matter.

Python Why pairs are expensive

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What does an MD program do at each time step?

    MD integrates classical equations of motion using forces from the potential.
  2. 2. What is the advantage of reduced units?

    With σ, ε and m set to 1, results can be converted to any substance with a known σ, ε and mass.
  3. 3. Why do simulations use periodic boundary conditions?

    A small box would otherwise have most atoms near a wall; periodic copies mimic a bulk fluid.
  4. 4. The cost of a naive force calculation with N atoms grows roughly like...

    Every pair of atoms must be considered, and there are N(N−1)/2 pairs.

Summary

  • MD follows classical atoms by computing forces and integrating Newton's equations step by step.
  • Every simulation is a loop: forces, move, wrap, measure.
  • Reduced units (σ = ε = m = k_B = 1) make results transferable; argon's time unit is about 2.16 ps.
  • Force evaluation dominates the cost, growing like N² without tricks.

Next: Forces and boundaries