Molecular Dynamics (MD) - Basics
The molecular dynamics simultates the time course of atomic positions subject to forces following classical mechanics $\mathbf{F}=m\mathbf{\ddot{x}}$
Simulation algorithms
Lennard-Jones (LJ) potential is one of the most famous potentials for monatomic fluids. For a pair of atoms $i$ and $j$ located at $\mathbf{r}_{i}$ and $\mathbf{r}_{j}$, the potential energy is $u(r_{i,j})= 4\epsilon [ (\frac{\sigma}{r_{ij}})^{12}-(\frac{\sigma}{r_{ij}})^{6} ]$ (for $r_{ij}\lt r_{c}$), and $u(r_{i,j})=0$ (for $r_{ij}\gt r_{c}$).
The force is $\mathbf{f}=-\nabla u(r)$, then the force that atom $j$ exerts on atom $i$ is $\mathbf{f}_{ij}=(\frac{48\epsilon}{\sigma^{2}})[ (\frac{\sigma}{r_{ij}})^{14}-\frac{1}{2}(\frac{\sigma}{r_{ij}})^{8} ]\mathbf{r}_{ij}$.
According to Newton's second law, the equations of motion can be written $m \ddot{\mathbf{r}}_{i}=\mathbf{f}_{i}=\sum_{j=1, j\ne i}^{N_{m}} \mathbf{f}_{ij}$.
With the scalings $r^{*} \rightarrow r/\sigma$, $e^{*} \rightarrow e/ \epsilon$, and $t^{*} \rightarrow t/\sqrt{m\sigma^{2}/\epsilon}$, the equation of motion can be written as $\ddot{\mathbf{r}}^{*}_{i}=48[ r_{ij}^{*-14}-\frac{1}{2}r_{ij}^{*-8} ]\mathbf{r}_{ij}^{*}$.
Integration of equations of motion
The leapfrog method in two-step procedure version is written as $\mathbf{v}_{i}(\mathbf{x}, t+\frac{\Delta t}{2})=\mathbf{v}_{i}(\mathbf{x}, t)+\frac{\Delta t}{2}\mathbf{a}_{i}(\mathbf{x}, t)$, $\mathbf{r}_{i}(\mathbf{x}, t+\Delta t)=\mathbf{r}_{i}(\mathbf{x}, t)+\Delta t \mathbf{v}_{i}(\mathbf{x}, t+\frac{\Delta t}{2})$, $\mathbf{v}_{i}(\mathbf{x}, t+\Delta t)=\mathbf{v}_{i}(\mathbf{x}, t+\frac{\Delta t}{2})+\frac{\Delta t}{2}\mathbf{a}_{i}(\mathbf{x}, t+\Delta t)$.
The Verlet method is written as $\mathbf{r}_{i}(\mathbf{x}, t+\Delta t)=2\mathbf{r}_{i}(\mathbf{x}, t)-\mathbf{r}_{i}(\mathbf{x}, t-\Delta t)+\Delta t^{2}\mathbf{a}_{i}(\mathbf{x}, t)+O(\Delta t^{4})$, $\mathbf{v}_{i}(\mathbf{x}, t)=[\mathbf{r}_{i}(\mathbf{x}, t+\Delta t)-\mathbf{r}_{i}(\mathbf{x}, t-\Delta t) ]/2\Delta t+O(\Delta t^{2})$.
Data analysis
The dimensionless kinetic energy per atom is $E_{k}=\frac{1}{2N_{m}}\sum_{i=1}^{N_{m}}\mathbf{v}_{i}^{2}$, the dimensionless potential energy per atom is $E_{u}=\frac{4}{N_{m}}\sum (r_{ij}^{-12}-r_{ij}^{-6}) $, the temperature of $d$- dimensional system is $T=\frac{1}{dN_{m}}\sum_{i} \mathbf{v}_{i}^{2}$. Pressure is defined as $PV=N_{m}T+\frac{1}{d}\langle \sum_{i=1}^{N_{m}}\mathbf{r}_{i}\cdot \mathbf{f}_{i} \rangle$.
Radial distribution function $g(r)$, RDF for short, is a function that describes the spherically averaged local organization around any given atom. $\rho g(r) d\mathbf{r}$ is proportional to the probability of finding an atom in the volume element $d\mathbf{r}$ at a distance $r$ from a given atom. $4\pi g(r) r^{2} \Delta r$ is the mean number of atoms in a shell of radius $r$ and thickness $\Delta r$ surrouding the atom.