MD solves Newton's equations for every particle, one small time step at a time. Most of the skill lies in four choices. You have to decide how to step forward in time, how far to compute forces, what to do at the edges of the box, and how to hold the temperature.
The simplest idea, Euler's method, updates positions with the old velocity and velocities with the old force. It looks fine for one step but adds a little energy every time, so the orbit spirals outward.
Velocity Verlet splits the velocity update into two halves around the position update. It is time-reversible and keeps the energy bounded, which is why almost every MD code uses it, or its close relative, the leapfrog scheme.
Try: raise dt. Euler blows up quickly, while Verlet stays on a slightly distorted ellipse until dt gets close to 2/ω, where it also becomes unstable. In real systems, the fastest motion, often an X-H bond vibration, sets dt (1 to 2 fs).
Computing every pair costs O(N2). Short-range forces such as Lennard-Jones are therefore cut at a distance rc, usually 2.5σ or about 1 to 1.2 nm, and neighbor lists keep track of which particles are close.
A plain cut makes the energy jump when a pair crosses rc, which spoils energy conservation. Shifting the potential fixes the energy, but the force still jumps. Force-shifted or switched potentials make both smooth. Long-range electrostatics are not cut at all, but handled with Ewald sums or PME.
Try: switch between the three kinds at a short cutoff, such as 1.3, and look at what happens at rc.
A simulation box holds thousands of particles, far fewer than a real sample, and a large share of them would sit at a surface. Periodic boundaries remove this surface. The box is surrounded by copies of itself, and a particle that leaves one side comes back on the other.
Each particle only interacts with the nearest copy of every other particle, which is called the minimum image. This is also why the cutoff must be less than half the box length.
Try: click a particle near an edge. Some of its neighbors are on the far side of the box.
Plain MD conserves energy (the NVE ensemble). To simulate at a fixed temperature, a thermostat adds or removes kinetic energy. The temperature itself comes from the kinetic energy, which in 2D gives kBT = Σ m v2 / 2N.
Try: start with no thermostat and watch T drift as the lattice melts. Then, switch on Berendsen and Langevin, and compare the size of the fluctuations.
Plain MD solves Newton's equations of motion, m dv/dt = F. They keep the total energy constant, so the temperature is whatever the energy allows (the NVE ensemble). To hold the temperature at a set value, a thermostat changes the equations. Here, the same starting configuration is copied six times. The first two copies follow Newton's equations with two different time-step rules. The other four add a thermostat, or, in the Brownian case, drop inertia.
Try: push dt up and watch Euler fail first, and then everything else. If you change the target T, the two Newton copies ignore it, while the thermostats follow. If you raise γ, the Langevin and Brownian copies slow down, while DPD still flows.