Molecular Dynamics
The series of videos below give an introduction to molecular dynamics using NetLogo starting from the very basics of NetLogo. No prior knowledge of either NetLogo or molecular dynamics is assumed. You can access NetLogo, either the desktop version which requires a download or the web version, for free here: https://www.netlogoweb.org.
Introduction to NetLogo
The following video is a short introduction to NetLogo.
Note: NetLogo in these videos is made with a new version of NetLogo which hasn't been released yet and therefore the interface looks a bit different (more modern), but the functionality is the same.
Newton's 1st law in NetLogo
Newton's 1st law states that an object in motion will stay in motion unless acted on by an outside force. Another way of saying this is: an object's velocity will stay constant unless acted on by an outside force. The video below shows how to model this computationally in NetLogo.
Newton's 2nd law in NetLogo
Newton's 2nd law states that $F=ma$, or equivalently, $a=\frac{F}{m}$, meaning that the acceleration of an object (how quickly its velocity will change) is equal to the total force acting on it divided by its mass. The video below shows how to model this computationally in NetLogo.
Newton's 3rd Law in NetLogo
Newton's 3rd law states that for every action there is an equal and opposite reaction. Or, more precisely, if two bodies exert forces on each other, these forces have the same magnitude but opposite directions. The video below shows how to model this with two objects connected by a spring.
Velocity Verlet algorithm
Whenever we do numerical integration (for example, adding the velocity to the position at each time step to calculate the next position), there is a chance of numerical errors creeping in. The amount of acceptable error and what kind depends on the application. For molecular dynamics, we want to make sure our simulations obey the law of conservation of energy. There are a class of integrators, known as Symplectic Integrators, that guarantee that the total energy represented in the simulation (kinetic + potential) will stay within some margin of error of the true value. One of the simiplest of these is the velocity Verlet algorithm. The video below shows how to integrate it in NetLogo.
A Basic Molecular Dynamics Model
The three videos below show the basics of molecular dynamics. In the first, we modify the force function between the two objects to model the interaction of atoms instead of two objects connected by an ideal spring (for more details on the interatomic potential see Section 4.5). In the second video, we extend the model to account for more than two interacting atoms (starting with just three atoms). In the third video, we add more atoms and show how to adjust the temperature of the system.