Runge-Kutta versus Velocity-Verlet Solutions for the Classical Harmonic Oscillator
Runge-Kutta versus Velocity-Verlet Solutions for the Classical Harmonic Oscillator
The harmonic oscillator is an idealized system widely used in many physical applications. It consists of a mass that oscillates without friction around an equilibrium position under a conservative attractive force. The energy is therefore constant. There is another conserved quantity, often not mentioned—the phase-space two-form (where is a coordinate and the conjugate momentum). The conservation of this quantity in a Hamiltonian system is a necessary and sufficient condition for conservation of the total number of particles, relevant if the system contains a fixed number of particles.
dxdp
x
p
This Demonstration aims to show the differences between Runge–Kutta 4 (RK4) and Velocity-Verlet (VV) in the approximation of the classical harmonic oscillator problem, and is often considered a good simple test to evaluate an algorithm’s reliability on more complex Hamiltonian systems. Both are fourth-order algorithms that approximate the solution by calculating the trajectory’s point separated by a fixed . The smaller the , the better the approximation is for the true stability of the algorithm. It can be seen how going forward in "time" and changing in the approximated solutions makes the former quantities change in an appropriate way using VV and RK, in a catastrophic case.
dt
dt
dt
Details
Details
The Demonstration aims to simulate a classical molecular model for bond vibrations[1] in which the force fields[2] are approximated as harmonic oscillators[3]. Usually simulations are carried out in isolated conservative systems so it is important to have both energy and the total number of particles[4] conserved by the approximate solution. This is achieved by conservtion of the product . In the above example you can see the best that can be achieved for the former product is a strongly oscillating value with a constant mean and not a single point constant value. This result is reached by the VV algorithm but not by the RK algorithm. Algorithms able to conserve are referred to as symplectic integrators[5]. Typical molecular calculations are carried out with .
dxdp
dxdp
dt=1fs
A typical real vibration has ∼1fs so the used in molecular dynamics to approximate the equations is roughly consistent with the width of a single vibration (or at least, the shortest vibration in the system).
1
ν
dt
The harmonic oscillator in the simulation has ∼0.3 so the following values of (in seconds) have been chosen: 0.01; 0.06; 0.1; 0.3.
1
ν
dt
Increasing increases the difference in behavior of the two algorithms up to the (at this value, molecular world and real world proportions are the same). It is clear that RK, not being a symplectic integrator, cannot be used as an algorithm to integrate the equation of motion in a molecular dynamics simulation.
dt
dt=0.3
References
References
[4] Wikipedia. "Liouville's Theorem." (Mar 18, 2012) en.wikipedia.org/wiki/Liouville's_theorem _(Hamiltonian).
External Links
External Links
Permanent Citation
Permanent Citation