Verlet Integration¶
Source code: https://github.com/osscar-org/quantum-mechanics/blob/master/notebook/molecular-dynamics/verlet_integration.ipynb
Goals¶
- Familiarize yourself with the main features of the Verlet integration scheme employed in the molecular dynamics simulations.
- Know the relationship between position, velocity, and acceleration.
- Acquaint yourself with the numerical technique of finite-differences.
- Appreciate the consequences of the order of the error of the Verlet algorithm.
- Master the mathematics of Verlet integration.
Background theory¶
Tasks and exercises¶
Choose a small time step, see how the earth orbits the sun, and check how the total energy and angular momentum evolutes with time.
Solution
The earth is moving in an elliptical orbit. The earth moves slowly at the end of the ellipse farthest from the sun whilst it moves quickest at the end of the ellipse nearest the sun. However, the total energy and angular momentum remain constant. With a sufficiently small time step the Earth shall remain in this orbit for a very long time.Does the earth still remain in the same orbit when a large time step is used? And why?
Solution
When choosing a large time step, the earth is not keeping on the same ellipse orbital anymore. The ellipse orbitals are shifting for each circle. In the numerical method, we treat the velocities as constant in a short time. But this is not true in the real physical world. When using a large time step, large errors will be introduced into the calculations.In molecular dynamics simulations, what are the problems associated with choosing (1) a very small timestep, (2) a very large timestep.
Solution
In MD simulations, choosing a small time step can improve the accuracy of the results. However, a small time step means taking a longer computing time to obtain the results. Practically, we cannot afford a very small time step for the MD simulations. On the other hand, a large time step will introduce large errors. For example, particles can be too close to each other (in the real world, the nuclear-nuclear repulsion energy is considerable at short distances). Hence, it is crucial to choose a reasonable compromise for our time step in MD simulations.
Interactive visualization¶
(be patient, it might take a few seconds to load)
There was an error when executing cell [5]. Please run Voilà with --show_tracebacks=True or --debug to see the error message, or configure VoilaConfiguration.show_tracebacks.