Skip to content

A harmonic oscillator advanced by fixed Verlet steps follows an ellipse with a calculable period. This explains how its energy error can remain bounded while its phase error grows. Even that energy bound can disappear if two individually stable step sizes alternate. In dimensionless canonical coordinates use H=(q2+p2)/2H=(q^2+p^2)/2, so one physical period is 2π2\pi.

Required background. Poisson brackets and Hamiltonian flows fixes the Hamilton equations. The initial point in the numerical comparison is (q,p)=(1,0)(q,p)=(1,0).

The potential flow over h/2h/2 is p↦p−hq/2p\mapsto p-hq/2, and the kinetic flow over hh is q↦q+hpq\mapsto q+hp. Apply a half kick, a full drift and a half kick in that order. Each shear is canonical, hence so is the composition. The one-step matrix is

Mh=(1−h2/2h−h(1−h2/4)1−h2/2). M_h=\begin{pmatrix} 1-h^2/2 & h\\ -h(1-h^2/4)&1-h^2/2 \end{pmatrix}.

Its determinant is one and M−h=Mh−1M_{-h}=M_h^{-1}. For 0<h<20\lt h\lt2 define α=1−h2/4\alpha=1-h^2/4 and θ=arccos⁡(1−h2/2)\theta=\arccos(1-h^2/2). Then sin⁡θ=hα\sin\theta=h\sqrt\alpha. Direct multiplication shows that K=(p2+αq2)/2K=(p^2+\alpha q^2)/2 is invariant. The matrix rotates the scaled plane (α q,p)(\sqrt\alpha\,q,p) clockwise through angle θ\theta per step. Thus the exact time-hh Hamiltonian generating this particular discrete oscillator on the branch continuous at h=0h=0 is H~=(θ/sin⁡θ)K\widetilde H=(\theta/\sin\theta)K. The scalar matters for timing, even though KK has the same level curves. Hairer, lecture 2, Theorem 2, p. 2, equation (2), PDF

At small hh, θ/h=1+h2/24+O(h4)\theta/h=1+h^2/24+O(h^4). At h=2h=2 the eigenvalues coalesce and the matrix is a nontrivial Jordan block. For a nonlinear Hamiltonian the modified series is generally asymptotic. If the fixed-step numerical orbit stays in a compact set on which a modified Hamiltonian exists, an order-rr symplectic method gives Hn−H0=O(hr)H_n-H_0=O(h^r) over long intervals determined by the truncation. Analyticity of the Hamiltonian and method in a neighborhood permits optimal truncation and exponentially long times for sufficiently small hh. Here a two-by-two matrix logarithm gives the quadratic Hamiltonian exactly. Hairer, lecture 3, §3, Theorem 3 and the analytic case, pp. 6–7, PDF

With h=0.2h=0.2 and 10001000 steps, the original energy in a binary64 calculation ranges from 0.495000050.49500005 to 0.500000000.50000000. This agrees with the exact interval [α/2,1/2][\alpha/2,1/2] from the elliptic orbit. The largest absolute drift of KK is below 2×10−152\times10^{-15}. Yet the accumulated phase error is 1000(θ−h)=0.334842321000(\theta-h)=0.33484232 radians. Decreasing hh while holding the physical final time fixed tests the predicted second-order phase error.

Forward Euler instead has matrix (1h−h1)\left(\begin{smallmatrix}1&h\\-h&1\end{smallmatrix}\right). It multiplies the true energy by 1+h21+h^2 at every step, giving (1+h2)1000/2=5.40×1016(1+h^2)^{1000}/2=5.40\times10^{16} for the same data. This growth and the Verlet phase lead are different errors. For an integrable nonlinear lattice the discrete spectrum provides a further observable; the two-particle Toda comparison shows what additional structure its exact update needs. Reproduce the oscillator range and phase (Python)

For the numerical phase measurement start with (q,p)=(1,0)(q,p)=(1,0) and follow the angle atan2⁡(−p,α q)\operatorname{atan2}(-p,\sqrt{\alpha}\,q), unwrapping it after each step. The minus sign counts the oscillator’s clockwise motion as positive phase. On 0≤t≤2000\le t\le200 the rotation per step is below π\pi, so no integer winding is lost. Subtract tt from the unwrapped angle. For an anharmonic system one can compare the full trajectory to an independently computed flow, as in the three-particle open Toda calculation. For colliding pulses one can track the separated crests at specified endpoints, as in the KdV time-step calculation.

What happens when two stable steps alternate?

Section titled “What happens when two stable steps alternate?”

Apply a unit step, then a step of 9/59/5, and repeat this pair. Repeating either step on its own would confine the oscillator to an ellipse. The quadratic coefficient α\alpha is 3/43/4 for the first ellipse and 19/10019/100 for the second. The matrix for one pair follows by multiplying in the order in which the steps act.

P=M9/5M1=(−1.660.280.294−0.652),tr⁡P=−2.312. P=M_{9/5}M_1= \begin{pmatrix}-1.66&0.28\\0.294&-0.652\end{pmatrix}, \qquad \operatorname{tr}P=-2.312 .

The displayed entries are exact terminating decimals. Each step preserves area, hence det⁡P=1\det P=1. Its two multipliers solve μ2−(tr⁡P)μ+1=0\mu^2-(\operatorname{tr}P)\mu+1=0 and are approximately −1.736-1.736 and −0.576-0.576. A component along the growing eigenvector changes sign and grows by a factor of 1.7361.736 every two steps. The initial state (1,0)(1,0) has such a component because the first column of PP has nonzero momentum. A stability test for a repeating step schedule therefore needs the multipliers of an entire period. Reproduce the pair using exact rational arithmetic (Python)

The figure locates other growing pairs. For dimensionless steps 0<a,b<20\lt a,b\lt2, let T=tr⁡(MbMa)T=\operatorname{tr}(M_bM_a). Multiplication gives T−2=(a+b)2(ab−4)/4<0T-2=(a+b)^2(ab-4)/4\lt0, while

T+2=14 [a(a+b)−4] [b(a+b)−4]. T+2=\tfrac14\,[a(a+b)-4]\,[b(a+b)-4].

Exponential growth occurs where the two factors have opposite signs. The curves meet at a=b=2a=b=\sqrt2, where Ma2=−IM_a^2=-I and the orbit repeats after four steps. Elsewhere on either curve the upper right entry (a+b)(1−ab/2)(a+b)(1-ab/2) is nonzero. The double multiplier −1-1 then has a Jordan block, giving linear growth for initial points off its eigenline.

Two hatched regions of growing solutions meet where both steps equal the square root of two. The pair one and 1.8 lies inside the upper region.

Stability of the oscillator sampled after each pair of Verlet steps, with angular frequency one. Hatched pairs have a growing multiplier. In the unshaded interior away from the dividing curves, both multipliers have unit modulus and every orbit is bounded. The axes show dimensionless step sizes.

  • Hairer, E. (2010). Geometric Numerical Integration. TU München lecture course. Lecture 2, “Symplectic integrators,” and lecture 3, “Backward error analysis.” Lecture 2, author PDF · Lecture 3, author PDF.