Basics · VASP · LAMMPS · 5 min read

What is molecular dynamics?

Checked against the docs · VASP wiki and LAMMPS manual, stable release 30 Sep 2026 · Last checked 11 November 2026 · Spot a mistake? Tell us

Short answer

Molecular dynamics (MD) is a simulation that follows how atoms move over time: it computes the force on every atom, moves all of them a tiny step forward with Newton's equations of motion, and repeats, often millions of times. The result is a trajectory, from which you measure things a single static structure cannot give, such as diffusion, melting or how a structure fluctuates at a temperature.

What does molecular dynamics do?

A static calculation tells you about one arrangement of atoms. Molecular dynamics lets them move. In the VASP wiki's words, MD is used to study the movement of atoms over time, which makes it useful whenever a static ground-state calculation is not enough: thermal disorder, diffusion, structural fluctuations, phase stability, melting, or how a system settles under realistic conditions.

The method is the same in every code. At each time step (a very short interval, typically around a femtosecond, 10⁻¹⁵ s), the program:

  1. computes the force on every atom from the current positions;
  2. moves every atom, and updates its velocity, using Newton's equations of motion;
  3. repeats.

The list of positions over time is the trajectory. How the moving is done is the subject of the companion page, "How does molecular dynamics move atoms?" (another page in this series).

Where do the forces come from?

This is the biggest choice in any MD study.

Forces fromExampleWhat you gain and give up
The electrons, solved at every step (ab initio MD)VASP with DFTNo fitted potential; the VASP wiki says an ab initio calculation at every step is frequently too expensive, so runs are short and cells small
A machine-learned force field trained on such calculationsVASP's own machine-learned force fields, or external modelsMuch longer runs on more atoms, once a reliable model exists for your system
A classical interatomic potentialLAMMPS with an EAM, Tersoff or similar potentialVery large and long runs; the physics is only as good as the potential

What is an ensemble, and why does it matter?

An ensemble is the set of conditions held fixed: the number of atoms (N) and two of volume (V), pressure (p), energy (E) and temperature (T). The VASP wiki describes MD as generating the configurations of an ensemble by integrating Newton's equations of motion. The common ones:

  • NVE (microcanonical): nothing touches the atoms but the forces, so the total energy should stay constant. The wiki recommends it for dynamical observables, such as vibrational spectra, and for testing the time step.
  • NVT (canonical): a thermostat adds or removes energy to keep the temperature near a target.
  • NpT (isothermal-isobaric): the cell is also allowed to change size and shape, so the pressure is held instead of the volume.

The wiki's advice for most workflows is to begin with NVT and then check the time step and the force quality in NVE, and to use NpT only when the cell should change.

What does it look like in practice?

In VASP, MD uses the same four input files as any calculation, with these INCAR tags:

INCAR
IBRION = 0      ! molecular dynamics
NSW    = 2000   ! number of time steps (an example)
POTIM  = 1.0    ! time step in fs (an example; it must be set for MD)
TEBEG  = 300    ! starting temperature in K (an example)
MDALGO = 2      ! the thermostat: 2 is Nosé-Hoover
ISIF   = 2      ! keep the cell fixed
ISYM   = 0      ! no symmetry: thermal motion breaks it

If POSCAR holds no velocities, VASP draws random ones at the start. The trajectory goes to XDATCAR, with the energies and temperature step by step in OSZICAR and OUTCAR.

In LAMMPS, the input script sets the time step (timestep) and how atoms are moved (fix nve, fix nvt or fix npt), then run with the number of steps. The thermo command prints temperature, energy and pressure every N steps to log.lammps, and dump writes the trajectory.

What do people mix up?

The mix-upWhat is true
"MD finds the lowest-energy structure."MD samples the structures a system visits at a temperature. To find a minimum you relax the structure instead (VASP's IBRION = 1 or 2, LAMMPS's minimize).
"The temperature should be exactly the target."The instantaneous temperature fluctuates, more in a small cell; a thermostat holds its average.
"A longer time step gives a longer simulation for free."The step must be short enough to follow the fastest motion; too long a step makes the energy drift or the atoms fly apart.
"The first steps are the result."A run first has to settle from its starting point; only the stretch after that is used for averages.

Which value should I use?

Verlet sets up MD runs with VASP or LAMMPS and plots their temperature and energy as they go; everything on this page works without it.

Updated
11 November 2026
Applies to
VASP 5.4 and 6.x; LAMMPS stable release 30 Sep 2026
Source check
Checked against the docs, 11 November 2026

Where can I read more?

What was this page checked against?

Checked against the VASP wiki and the LAMMPS stable release 30 Sep 2026, 11 November 2026. VASP: Molecular dynamics calculations (last edited 6 August 2026), Category: Molecular dynamics (5 August 2026), Ensembles (21 September 2026), IBRION (18 June 2026), POTIM (18 October 2024). LAMMPS (git info 30Sep2026 update1): Overview, fix nve, run_style, thermo, dump. Every link on this page was opened.

The example values in the INCAR are illustrations, not recommendations; the guides above say how to choose them. The femtosecond in the opening matches the VASP wiki's example inputs (POTIM = 1.0) and LAMMPS's defaults in metal and real units (1 fs).