0% found this document useful (0 votes)
16 views9 pages

Variable Time Step Integration With Symplectic 1997 Applied Numerical Mathem

This article presents a meta-algorithm that enables the use of variable time steps in symplectic methods for Hamiltonian systems, preserving their favorable long-time integration properties. The algorithm is theoretically justified through backward error analysis and is illustrated with numerical experiments. It addresses the challenge of maintaining efficiency in variable step scenarios, particularly in cases like Kepler's problem with high eccentricity.

Uploaded by

Rafael S. Moraes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views9 pages

Variable Time Step Integration With Symplectic 1997 Applied Numerical Mathem

This article presents a meta-algorithm that enables the use of variable time steps in symplectic methods for Hamiltonian systems, preserving their favorable long-time integration properties. The algorithm is theoretically justified through backward error analysis and is illustrated with numerical experiments. It addresses the challenge of maintaining efficiency in variable step scenarios, particularly in cases like Kepler's problem with high eccentricity.

Uploaded by

Rafael S. Moraes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

@=oI;.

WI
MATHEMATICS
ELSEVIER Applied Numerical Mathematics 25 (1997) 219-227

Variable time step integration with symplectic methods


E. H a i r e r 1
Section de Math~matiques, Universitd de GenOve, CH-1211 Gendve 24, Switzerland

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.

2. Symplectic meta-algorithm for variable step sizes

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

(:)' = s(p,q) Hp(p,q) " (2)

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

h = c s(p, q, c), (3)


where s(p, q, e) > 0 is a state-dependent given function and e > 0 is a small parameter. Then we
consider, for a fixed initial value (P0, q0) with H0 = H(po, qo), the new Hamiltonian

K(p, q, c) = s(p, q, c) (H(p, q) - Ho), (4)


E. Hairer / Applied Numerical Mathematics 25 (1997) 219-227 221

and the corresponding Hamiltonian system

p ' = -s(p,q,~)Hq(p,q) - Sq(p,q,e)(H(p,q)- Ho),


(5)
q' = s(p, q, e)Hv(p, q) + sp(p, q, e)(H(p, q) - 14o).
Compared to (2) we have introduced a perturbation, which vanishes on the solution of (1) passing
through (Po, qo), but which makes the system Hamiltonian.

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

a(t,e) = / s(P('r),O(T),c) dT.


0

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. []

We are now ready to present the principle of our algorithm.

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

3. Backward error analysis

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

#(p,q,~) := ~(p, q,~)/8(p, q,c) + H0.


The solution iY(t), ~(t) of the corresponding Hamiltonian system satisfies by Lemma 1
?(t) = ~(~(t, ~)), O(t) = ~(~(t,e)),
where
t

~(t,~):= f s(?(~-),~)(~-),e)d~-=~(t,c)+eal(t)+.... []
0
E. Hairer / Applied Numerical Mathematics 25 (1997) 219-227 223

4. Practical considerations for separable Hamiltonians

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)

where M is a constant symmetric matrix.

4.1. Symplectic Euler method with q-dependent step size function

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

Pl = po_es(qo, e)Vq(qo)_eSq(qo, e)(1~ PlT1vl


. . - I pl + V(qo) - Ho), (9)
ql = qo + es(qo, ¢ ) M - l p l
and yields an approximation at tl = to + ¢s(qo, ¢). We get a quadratic equation in pl, which can
be solved as follows: we consider the norm [[p[[2 := pTM-1 p and compute the scalar quantity
/3 := p T M - l p l = [[pl[[2 from the relation

/3----liP0- es(qo, e)Vq(qo)- eSq(qo, e)(/3/2 q- V ( q o ) - H0) 11264•


This scalar quadratic equation can easily be solved for /3. Then, the numerical solution pl, ql is
obtained in an explicit manner from (9).

4.2. Symplectic Euler method with arc-length parameterization

For general step size functions h -- es(p, q, e) the symplectic Euler method, applied to (5), reads

Pl = PO -- es(pl , qo, e) Vq(qo) - CSq(Pl, qo, e) ( l p T1M- lpl + V (qo ) - Ho) ,


(10)
ql = qo + es(pl, qo, e ) M - l p l -t- eSp(pl, qo, e ) ( l p T M - l p l + V(qo) - Ho).
Here, the first equation is implicit in Pl. However, if the function s(p, q, e) only depends on q and on
pT M - lp, we again can first solve a scalar equation for/3 := pT M - lpl and the remaining computations
are explicit. Such step size functions include the arc-length parameterization of the solution (see, e.g.,
McLeod and Sanz-Serna [11] and Huang and Leimkuhler [6]), where
s(p, q, e) = ( p T M - l p + Vq(q)TM-1Vq(q))-l/2. (1 1)

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.

4.3. Verlet scheme with q-dependent step size function

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

Pn+l /2 -: Pn -- 1cS(qn, C) Vq(qn) -- l csq(qn, e) ( H (pn+,/2, qn) - H0),


qn+l : qn + ½c(s(qn, c) + S(qn+l,c))M-lpn+l/2, (13)
Pn+l = P~+1/2 - ½cs(qn+l,c)Vq(qn+l) - ½CSq(qn+l,c)(H(P~+l/2, qn+l) - HO).
The first equation is equivalent to that of (9), and can be solved for Pn+l/2 as explained in Section 4.1.
The second equation of (13) is implicit in q~+l. However, it is sufficient to solve the scalar equation

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].

5.1. Kepler's problem

We consider Kepler's problem, for which the Hamiltonian is


1 9 9
H(p,q) = ~(p~ + p~) (14)
~/q~ + q~'

and we take initial values

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

Method (17) r = 1 135 2244 18024 129698


arclength 138 1964 15938 116441

arc length ( p, q ) 1 - arc length ( q ) 1 constant step size I -

, , ,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

16 steps _!_ 27 steps -1- 86 steps -l i-

Fig. 2. Various step size strategies for Kepler's problem.

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.

5.2. The adaptive Verlet method of Huang and Leimkuhler

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),

where crn+l/2 is defined by the recursion


1 1 2
O'1/2 = 8(qo, E), - - q- - - -- (18)
O'n+l/2 fin--l~2 s ( q n , ¢)
E. Hairer / Applied Numerical Mathematics 25 (1997) 219-227 227

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.

You might also like