Variable Time Step Integration With Symplectic 1997 Applied Numerical Mathem
Variable Time Step Integration With Symplectic 1997 Applied Numerical Mathem
WI
MATHEMATICS
ELSEVIER Applied Numerical Mathematics 25 (1997) 219-227
Abstract
Symplectic methods for Hamiltonian systems are known to have favorable properties concerning long-time
integrations (no secular terms in the error of the energy integral, linear error growth in the angle variables instead
of quadratic growth, correct qualitative behaviour) if they are applied with constant step sizes, while all of these
properties are lost in a standard variable step size implementation. In this article we present a "meta-algorithm"
which allows us to combine the use of variable steps with symplectic integrators, without destroying the above
mentioned favorable properties. We theoretically justify the algorithm by a backward error analysis, and illustrate
its performance by numerical experiments. © 1997 Elsevier Science B.V.
Keywords: Hamiltonian systems; Symplectic integration; Variable step sizes; Backward error analysis; Kepler's
problem; Verlet scheme
1. Introduction
Hamiltonian systems of ordinary differential equations arise in many applications (e.g., mechanics,
astrophysics, molecular dynamics) and are of the form
p' = -Hq(p, q), q' = Hp(p, q), (1)
where H ( p l , . . . ,Pd, q l , . . . ,qd) denotes the Hamiltonian function and Hp, Hq are vectors of partial
derivatives. Such systems have the properties that (a) the Hamiltonian function is a first integral of
the system, and (b) its flow is a symplectic transformation, i.e., it preserves the differential 2-form
dp A dq.
In this article we consider the numerical integration of Hamiltonian systems by symplectic one-
step methods, i.e., methods for which the numerical flow (Pl, ql) = ~Sh(PO,qo) is for all sufficiently
small h > 0 a symplectic transformation. For such methods, the numerical solution can be formally
interpreted as the exact solution of a perturbed Hamiltonian system (backward error analysis), and
thus preserves the qualitative features of the original system.
E-mail: [email protected].
0168-9274/97/$17.00 © 1997 Elsevier Science B.V. All rights reserved.
I'll S0168-9274(97)00061-5
220 E. Hairer / Applied Numerical Mathematics 25 (1997) 219-227
It has been observed numerically by Gladman et al. [2] and by Calvo and Sanz-Serna [1] that
symplectic integrators, when used with variable step sizes, lose their favorable properties for long-
time integrations and are no longer superior to standard non-symplectic methods. It appeared that
symplectic methods could not solve efficiently problems where variable steps are indispensable (e.g.,
Kepler's problem with high eccentricity), and McLachlan and Scovel [10] presented as an open problem
to "develop variable time step symplectic integrators so that they are competitive ... with standard
m e t h o d s . . , while retaining the good long-time behaviour of constant time-step symplectic methods".
There are several attempts to overcome the difficulties mentioned above. Skeel and Biesiadecki
[14] decompose the vector field and integrate over a basic time step h different parts with different
step sizes (multiple-time-step method), so that the overall method defines a symplectic transformation.
Since the basic step size is not altered, its long-time behaviour is like that of a constant step size
method (similar as if we apply a symplectic method with steps of alternating size h and 2h). In the
case where the system is reversible and the method symmetric, several step size strategies have been
found that retain the good long-time behaviour. Such so-called reversible step size strategies have been
proposed and studied by Hut et al. [7], Stoffer [18], Hairer and Stoffer [5], and Huang and Leimkuhler
[6].
Our approach of this article is conceptually completely different. We do not make any reversibility
assumptions on the system, and the approach works for all (not necessarily symmetric) one-step
methods. The idea is to add small perturbations to the discretization, such that the qualitative behaviour
for long-time integrations is re-established, without affecting the order of convergence (Section 2).
The algorithm is theoretically justified in Section 3, and practical considerations for an implementation
together with numerical experiments are discussed in the final sections.
We attack the problem by considering a time transformation t ~ T satisfying dt/dT = s(p('r), q('r))
such that the system (1) becomes
Applying a numerical method with constant step size z to (2) yields approximations (Pn, qn) to
(p(tn), q(tn)), where tnH --tn ~ e S(pn, qn). It has been pointed out by Stoffer [17,18] and Skeel
and Gear [15] that the system (2) can be Hamiltonian only if s(p, q) is constant along solutions of (1),
what makes this approach unattractive.
The new idea, proposed here, is the following: suppose that we want to integrate the system (1)
with steps of size
L e m m a 1. Let (p(t), q(t)) and (P(t), Q(t)) be the solutions of (1) and (5), respectively, both with
initial values (P0, qo). Then, it holds
P(t) = p(a(t,e)), Q(t) = q(a(t,e)),
where
t
Proof. This follows from the fact that along the considered solution of (5) we have K(P(t), Q(t)) =
K(p0, %) = 0, so that H(P(t), Q(t)) = Ho. Therefore, (P(t), Q(t)) and (p(a(t, e)), q(a(t, e))) satisfy
the same differential equation (2) with the same initial values. []
Algorithm 1. Apply a symplectic one-step method with constant step size c to the Hamilto-
nian system (5), augmented by t' = s(p, q, e). This yields numerical approximations (Pr~,qn) to
(P(n¢), Q(nc)), and tn to ot(nc, c). Hence we have
pn c)), qn
where (p(t), q(t)) is the solution of the original system (1).
R e m a r k 2. 2 Time transformations such as in Eq. (4) are already used in classical mechanics for an
analytic treatment of Hamiltonian systems. They date back to the work of Levi-Civita [8, p. 313], and
[9, pp. 120 and 134], where the three-body problem is considered with the special time transformation
dr/dr = r = [[ql]. Levi-Civita calls this the "Darboux-Sundman transformation" (see Sundman [16]).
Zare and Szebehely [20] consider such time transformations for numerical purposes. These authors
are not interested in symplectic methods, but they consider the additional term in Eq. (5) as control term
stabilizing the numerical integration. Their favorite choice of s(p, q, e) is the inverse of the Lagrange
function, for which the partial derivatives Sp and Sq are already known. Waldvogel and Spirig [19]
apply the transformations proposed by Levi-Civita to Hill's lunar problem and solve the transformed
equations by composition methods in order to preserve the symplectic structure.
R e m a r k 3. The idea of considering the Hamiltonian (4) for a symplectic variable step size integration
has been found independently by Reich [ 12].
2 We are grateful to W.M. Seiler (University Karlsruhe) and B. Leimkuhler (University of Kansas) for drawing our attention
to these references.
222 E. Hairer / Applied Numerical Mathematics 25 (1997) 219-227
The favorable long-time behaviour of symplectic methods for Hamiltonian systems, in the case of
constant step sizes, can be understood by a backward error analysis (see, e.g., Sanz-Serna and Calvo
[13] or Hairer and Lubich [4]). Although our algorithm yields numerical approximations on a non-
equidistant grid, it can be considered as a fixed step size, symplectic method applied to a different
Hamiltonian system. This interpretation allows us to apply the standard results on backward error
analysis. In particular, we have the following result.
Theorem 4. Consider the Hamiltonian system (1) and let (pn, qn) be the numerical solution obtained
by Algorithm 1 with a symplectic one-step method. Then, there exist a perturbed Hamiltonian
H(p, q, e) = H(p, q) + ell1 (I9, q) + eZHz(p, q) + . . . , (6)
and a perturbed time transformation
~(t, e) ----o~(t, e) q- gO~l(t) q- g2ct2(t) q--.. (7)
with a(t, e) from Lemma 1, such that (formally)
Pn = ~(~(n~, e)), qn = ~(~('~, ~)),
where ~(t), ~(t) is the exact solution of
=
If the underlying one-step method is of order r, the perturbations in (6) and (7) start with the er-terms.
Proof. For the symplectic method applied with constant step size e to the Hamiltonian system (5),
standard backward error analysis yields the existence of a perturbed Hamiltonian
If(p, q, e) = K(p, q, e) + EI~ 1 (p, q) ~- e2Kz(p, q) + . . .
(without loss of generality we may assume that Kj(po, qo) = 0 for all j), such that formally
Pn = ~ ) ( n c ) , an = ~2(ne),
where Jh(t), Q(t) is the exact solution of the Hamiltonian system corresponding to B[(p, q, e) with
initial values (P0, q0). We now define
~(t,~):= f s(?(~-),~)(~-),e)d~-=~(t,c)+eal(t)+.... []
0
E. Hairer / Applied Numerical Mathematics 25 (1997) 219-227 223
In the case of separable Hamiltonians H(p, q) = T(p) + V(q), it is known that there exist explicit
symplectic integrators. However, the transformed Hamiltonian (4) is no longer separable. We shall see
in this section that the advantage of explicit symplectic integrators can nevertheless be preserved. We
illustrate this for the important case of Hamiltonian functions
H(p, q) = ½p T M - l p + V(q), (8)
The most simple symplectic integration scheme is the combination of the implicit Euler method (for
the p-variables) and the explicit Euler method (for the q-variables). If we consider step size functions
of the form h = es(q, e), where s is independent of p, this method, when applied to the system (5)
with Hamiltonian (8), reads
For general step size functions h -- es(p, q, e) the symplectic Euler method, applied to (5), reads
We have chosen the norm II. 1164 instead of the Euclidean norm, because it leaves the expression (11)
invariant with respect to linear coordinate changes.
224 E. Hairer / Applied Numerical Mathematics 25 (1997) 219-227
Since the Hamiltonian (8) is constant along solutions of the system, the step size function of Eq. (11)
can be replaced by the p-independent function
s(q,c) = (2(H0 - V(q)) + Vq(q)XM-lVq(q)) -1/2. (12)
Numerical experiments revealed that the use of (11) and (12) give nearly identical results.
One of the most important symplectic integration schemes is the StOrmer or Verlet method, which
is equivalent to the 2-stage Lobatto IIIA-IIIB pair. In contrast to the method of Eq. (10), it is also
symmetric. This property is important for the integration of time reversible problems. Applied to the
system (5) with H(p, q) given by (8) and with p-independent function s, it is of the form
for '7 :-- s (q,~+l, c). This can be done efficiently by Newton iterations, because the derivative Sq (p, q, c)
is available. The last equation in (13) is explicit. The scheme (13) gives approximations at t~, where
: tn + +
Composition methods (see, e.g., [13]) are an interesting tool for the derivation of higher order
integration methods. Since they are based on the second order Verlet scheme, there is no obstacle in
applying them with variable step sizes in the form of Eq. (13).
5. Numerical experiments
Here we study different choices of step size functions s(p, q, c), and we compare the algorithm (13)
to the so-called adaptive Verlet method of Huang and Leimkuhler [6].
qj(O)= l-e, q2(O) =o, p (O) =o, p2(0) ---- V ~ q-e-e ' (15)
E. Hairer / Applied Numerical Mathematics 25 (1997) 219-227 225
8000 number \ / \ [
ofsteps \ \ ~:0.9999 /
6000 \ \ ~ )
,000 e:0.99\ \
/ e--°.999 /
ooo :o \`
f , ~ , "-..~, • .- . .,__-Jr
0.0 0.5 1.0
Fig. 1. Minimum number of steps as function of r.
Table 1
Minimum number of steps, such that the error in the Hamiltonian is ~<0.01
Eccentricity e = 0.9 e = 0.99 e = 0.999 e = 0.9999
Method (13) minimum 34 215 1323 4412
r = 0 2192 229479 -- --
r = 1 110 469 1608 5210
arclength 116 439 1761 6673
Method (17) r = 1 249 1440 6037 22825
arclength 211 1264 5484 21205
such that in the (ql, q2)-plane the solution is an ellipse with eccentricity e. The movement is fast when
the point (qi, q2) is close to the origin. Hence, it is natural to take small time steps when q~ + q~ is
small, and large time steps when q2 + q2 is large. We thus consider
s ( q , c ) = (q2 + q~)T (16)
as step size function. For many different values of r between 0 and 1.1 we have integrated Kepler's
problem on the interval [0,27r] with the symplectic variable step size Verlet scheme (13). We have
adapted the value of e in such a way that the maximal error in the Hamiltonian is approximately
equal to 0.01. Fig. 1 shows the necessary work (i.e., number of steps to achieve this goal) as function
of r. We see that the constant step size implementation, which corresponds to 'r : 0, does not give
satisfactory results at all. The optimal value of r lies somewhere between 0.5 and 1, and is closer to 1
for larger eccentricities.
In Table 1 these numbers are explicitly given for some particular values of r. We have also included
the results of the arclength parameterization (12). They are similar to those obtained with r = 1,
because the function of Eq. (12) behaves like [[qll2 for small ]]qll. The results of a similar experiment,
where we consider the error in the solution instead of the error in the Hamiltonian, are shown in Table 2.
We give the minimum number of steps, such that the Euclidean norm of the error in the position and
momentum variables is not larger than 0.1 (ion the whole integration interval). The reference solution
226 E. Hairer / Applied Numerical Mathematics 25 (1997) 219-227
Table 2
Minimum number of steps, such that the error in the solution is ~<0.1
Eccentricity e = 0.684 e = 0.900 e = 0.968 e = 0.990
Method (13) r = 0 875 29483 920751 --
r = 1 123 688 3785 21620
arclength 172 1140 6449 36418
, , ,oIKi ii Ii
-1
i i la ii i w I
I p~
• --]
~ I I I I I I h I I i i i ~
•
i
dr"'"'.....
iJlal i i i i i i
0000 OOD
is obtained by an eighth order explicit Runge-Kutta method with Tol = 10 -14. In Tables 1 and 2 we
have also included the results of the adaptive Verlet scheme (see (17) below).
Fig. 2 illustrates how the different step size functions influence the position of the output points.
We have chosen e = 0.6. The picture to the left uses the function of Eq. (12), in the middle we use
s(q, c) = 1/v/Ho - V(q) (arclength parameterization in the q-variables only), and the picture to the
fight corresponds to s(q, c) -- 1 (constant step size). In each case we have adjusted the parameter c
in such a way that the maximal error in the Hamiltonian is close to 0.023.
A variable step size method, closely related to (13), has recently been proposed by Huang and
Leirnkuhler [6]. It also generalizes the Verlet scheme, and is for separable Hamiltonians (8) and for
q-dependent step size functions s(q, c) given by
P n + ! / 2 -~ Pn -- l ~ ° ' n + l / 2 V q ( q n ) ,
qn+l = qn q- C c r n + l / 2 M - l p n + l / 2 , (17)
1
Pn+l = Pn+l/2 - ~c°-n+l/2Vq(qn+l),
Both methods, (13) and (17), are symmetric and they preserve the angular momentum (for (13) one
has to restrict the step size function such that the system (5) preserves also the angular momentum).
Method (17) has the advantage of being explicit. Method (13), on the other hand, is implicit (limited
tests revealed that one step of (13) is about three times as expensive as one step of (17) with the
same c), but it retains the symplecticness of the fixed step size Verlet scheme.
References
[1] M.E Calvo and J.M. Sanz-Serna, The development of variable-step symplectic integrators, with application
to the two-body problem, SIAM J. Sci. Comput. 14 (1993) 936-952.
[2] B. Gladman, M. Duncan and J. Candy, Symplectic integrators for long-term integrations in celestial
mechanics, Celestial Mech. Dynam. Astronomy 52 (1991) 221-240.
[3] E. Hairer, Backward analysis of numerical integrators and symplectic methods, Ann. Numer. Math. 1 (1994)
107-132.
[4] E. Hairer and C. Lubich, The life-span of backward error analysis for numerical integrators, Numer. Math.
76 (1997) 441-462.
[5] E. Hairer and D. Stoffer, Reversible long-term integration with variable step sizes, SIAM J. Sci. Comput.
18 (1997) 257-269.
[6] W. Huang and B. Leimkuhler, The adaptive Verlet method, SIAM J. Sci. Comput. 18 (1997) 239-256.
[7] P. Hut, J. Makino and S. McMillan, Building a better leapfrog, Astrophys. J. 443 (1995) L93-L96.
[8] T. Levi-Civita, Sur la r6solution qualitative du probl6me restreint des trois corps, Acta Math. 30 (1906)
305-327.
[9] T. Levi-Civita, Sur la r6gularisation du probl6me des trois corps, Acta Math. 42 (1920) 99-144.
[10] R.I. McLachlan and C. Scovel, A survey of open problems in symplectic integration, Fields Inst. Commun.
10 (1996) 151-180.
[ 11 ] R.J.Y. McLeod and J.M. Sanz-Serna, Geometrically derived difference formulae for the numerical integration
of trajectory problems, IMA J. Numer. Anal. 2 (1982) 357-370.
[ 12] S. Reich, Backward error analysis for numerical integrators, Preprint, Konrad-Zuse-Zentrum, Berlin (1996).
[13] J.M. Sanz-Serna and M.E Calvo, Numerical Hamiltonian Problems (Chapman and Hall, London, 1994).
[14] R.D. Skeel and J.J. Biesiadecki, Symplectic integration with variable stepsize, Ann. Numer. Math. 1 (1994)
191-198.
[ 15] R.D. Skeel and C.W. Gear, Does variable step size ruin a symplectic integrator? Phys. D 60 (1992) 311-313.
[16] K.E Sundman, M6moire sur le probl6me des trois corps, Acta Math. 36 (1912) 105-179.
[17] D. Stoffer, On reversible and canonical integration methods, Report 88-05, SAM, ETH Ziirich (1988).
[18] D. Stoffer, Variable steps for reversible integration methods, Computing 55 (1995) 1-22.
[19] J. Waldvogel and E Spirig, Chaotic motion in Hill's lunar problem, in: A.E. Roy and B.A. Steves, eds., From
Newton to Chaos: Modern Techniques for Understanding and Coping with Chaos in N-Body Dynamical
Systems, NATO Adv. Sci. Inst. Set. B Phys. 336 (Plenum Press, New York, 1995).
[20] K. Zare and V. Szebehely, Time transformations in the extended phase-space, Celestial Mechanics 11 (1975)
469-482.