This module illustrates symplectic methods for numerically solving ordinary differential equations whose solutions satisfy a conservation law, such as dynamical systems for which total energy is conserved. The term symplectic essentially means area preserving in phase space. Approximate solutions generated by symplectic methods are conservative even at finite resolution, in contrast with numerical methods that generate approximate solutions that are conservative only in the limit as the time step size approaches zero, and tend to gain or lose energy at finite resolution.
Ten numerical methods are implemented in this module, five of them
symplectic and five nonsymplectic, and these can be applied to any of
six example systems of ODEs: a simple pendulum, harmonic oscillator,
Morse oscillator, Lennard-Jones oscillator, Kepler's orbit problem for
two bodies, and a population model due to
Lotka and Volterra. The first five problems are mechanical systems
governed by Newton's second law of motion
(
The user first selects a problem and a method from the menus provided. The user can additionally choose the time step size and the final time of integration using the sliders provided. The user then clicks Solve and the resulting solution components, energy, and phase portrait are plotted.
The four Euler methods are only first-order accurate, and thus produce relatively poor solutions unless the step size is relatively small. The nonsymplectic Euler methods either gain or lose energy over time, whereas for the symplectic Euler methods the energy is constant or oscillates about a constant level, neither gaining nor losing energy in the long run. (Some of these effects become more evident for the more challenging problems and for longer integration times.)
The midpoint and trapezoid methods are second-order accurate, and thus yield better accuracy for relatively larger step sizes. Again, the symplectic methods conserve energy, but the nonsymplectic methods also do reasonably well because of the relatively higher accuracy and the fact that they fairly closely mimic their symplectic analogs.
The symplectic velocity Verlet method is second-order accurate and is specifically designed for mechanical systems, so its effectiveness is not surprising, and accounts for its popularity in such contexts. (Note, however, that the Lotka-Volterra model is not a mechanical system, and the Verlet method is not designed for it.) The classical fourth-order Runge-Kutta method is not symplectic, but because of its relatively high accuracy it may appear to be conservative in the short run, although it still tends to gain energy over a sufficiently long integration time.
References:
Developers: Sukolsak Sakshuwong and Michael Heath