0810.1548/kv.tex
1: %%% Local Variables: 
2: %%% mode: latex
3: %%% TeX-master: t
4: %%% End: 
5: 
6: \documentclass[smallcondensed]{svjour3}
7: 
8: \usepackage{amsmath}
9: \usepackage{natbib}
10: \usepackage{graphicx}
11: \usepackage{mathptmx}
12: %\usepackage{fullpage}
13: 
14: \journalname{Celestial Mechanics and Dynamical Astronomy}
15: 
16: \newcommand{\order}[1]{\mathcal{O}\left(#1\right)}
17: 
18: \bibpunct{(}{)}{;}{a}{}{,}
19: 
20: \bibliographystyle{celestmechdynastro}
21: 
22: \begin{document}
23: 
24: \title{Variational Integrators for Almost-Integrable Systems}
25: \author{Will M. Farr}
26: 
27: \institute{Kavli Institute for Astrophysics and Space Research, MIT
28:   Room 37-624C, 77 Massachusetts Ave., Cambridge, MA
29:   02139\\\email{farr@mit.edu}}
30: 
31: \maketitle
32: 
33: \abstract{We construct several variational integrators---integrators
34:   based on a discrete variational principle---for systems with
35:   Lagrangians of the form $L = L_A + \epsilon L_B$, with $\epsilon \ll
36:   1$, where $L_A$ describes an integrable system.  These integrators
37:   exploit that $\epsilon \ll 1$ to increase their accuracy by
38:   constructing discrete Lagrangians based on the assumption that the
39:   integrator trajectory is close to that of the integrable system.
40:   Several of the integrators we present are equivalent to well-known
41:   symplectic integrators for the equivalent perturbed Hamiltonian
42:   systems, but their construction and error analysis is significantly
43:   simpler in the variational framework.  One novel method we present,
44:   involving a weighted time-averaging of the perturbing terms, removes
45:   all errors from the integration at $\order{\epsilon}$.  This last
46:   method is implicit, and involves evaluating a potentially expensive
47:   time-integral, but for some systems and some error tolerances it can
48:   significantly outperform traditional simulation methods.
49: 
50:   \keywords{N-Body Problems \and Hamiltonian Systems \and Numerical
51:     Methods}
52: 
53:   \PACS{95.10.Ce \and 45.10.Db \and 45.20.Jj \and 45.50.Pk}}
54: 
55: \section{Introduction}
56: 
57: Symplectic integrators have been used since their introduction in
58: \citet{Wisdom1991} for simulations of gravitational systems which are
59: dominated by a central body.  These integrators split the Hamiltonian
60: for a system into two parts:
61: \begin{equation}
62:   H = H^{(A)} + \epsilon H^{(B)},
63: \end{equation}
64: where $H^{(A)}$ represents the influence of the dominant central body
65: on the bodies that orbit it, and $\epsilon H^{(B)}$, $\epsilon \ll 1$,
66: represents the mutual interactions of the bodies in orbit around it.
67: (In our solar system, $\epsilon \sim 10^{-3}$; for stars in orbit
68: around a central galactic black hole, $\epsilon \sim 10^{-6}$.)  These
69: integrators are a composition of evolutions under the separate pieces
70: of the Hamiltonian, which are individually integrable.  The
71: integrators in \citet{Wisdom1991} have a trajectory error which scales
72: as $\order{\epsilon h^3}$ over a single step of size $h$.
73: \citet{McLachlan1995}, \citet{Chambers2000}, and \citet{Laskar2001}
74: present improvements to the basic leapfrog scheme in
75: \citet{Wisdom1991} which involve more composition steps to eliminate
76: error terms at $\order{\epsilon}$; these integrators have errors after
77: a single step of size $h$ which scale as $\order{\epsilon^2 h^3} +
78: \order{\epsilon h^{n+1}}$ and are known as pseudo-high-order
79: integrators.  \citet{Wisdom1996} introduced correctors which can
80: completely eliminate errors at $\order{\epsilon}$ from the
81: integration.
82: 
83: In this work, we present integrators derived from a Lagrangian of the
84: form 
85: \begin{equation}
86:   L = L^{(A)} + \epsilon L^{(B)}
87: \end{equation}
88: based on a discrete variational principle which incorporates the
89: dominant $L^{(A)}$ motion of the system.  These variational
90: integrators subsume traditional symplectic integrators.
91: Section \ref{Sec:VariationalIntegrators} provdies a brief introduction
92: to variational integrators; \citet{Marsden2001} provides a thorough
93: mathematical grounding for these integrators and discusses in detail
94: their properties.  \citet{Lew2004} provides another introduction to
95: the topic, and discusses the use of variational integrators in a
96: space-time (PDE) context.  \citet{Lee2007} demonstrate a geometrically
97: exact method for simulating full-body dynamics in orbital mechanics
98: with a variational integrator.
99: 
100: In this paper, we derive the pseudo-high-order integrators presented
101: in \citet{McLachlan1995}, \citet{Chambers2000}, and \citet{Laskar2001}
102: using the variational framework.  The occurrence of the Gauss-Lobatto
103: quadrature coefficients in the composition formulas for these
104: integrators is a natural consequence in this framework of using
105: Gauss-Lobatto quadrature to approximate the contribution of $L^{(B)}$
106: to the action integral.  We exploit the flexibility of the variational
107: framework to derive a novel implicit integrator which eliminates all
108: errors from the trajectory at $\order{\epsilon}$ through averaging of
109: the perturbing Lagrangian, $\epsilon L^{(B)}$, along the trajectory of
110: $L^{(A)}$.  We present numerical evidence in Section
111: \ref{ExampleCalculationsSection} that this latter integrator can be
112: more efficient than standard symplectic integrators for some systems
113: of physical interest in spite of its higher cost per step.  We argue
114: in Section \ref{OrderEpsilon2Method} that this method should be more
115: stable at large stepsize for eccentric systems than the standard
116: symplectic integrators, even with symplectic correctors.
117: 
118: In this work we use the notation of \citet{Sussman2001}.  The function
119: which is the derivative of a function $f$ is denoted $Df$; if $f$
120: takes a vector argument $x$, then $Df(x)$ is a co-vector.  Similarly,
121: we denote the function which is the partial derivative with respect to
122: the $i$th argument (counting from zero) of a function, $g$, of
123: multiple arguments by $\partial_i g$.  Some examples relating our
124: notation to traditional notation:
125: \begin{eqnarray}
126:   Df(x) & = & \frac{df}{dx}(x) \textnormal{ or } \frac{\partial
127:     f}{\partial {\bf x}}({\bf x}) \\
128:   \partial_1 f(x,y,z) & = & \left. \frac{\partial f(x,b,z)}{\partial
129:       b}\right|_{b = y} \textnormal{ or } \left. \frac{\partial
130:       f({\bf x},{\bf b},{\bf z})}{\partial {\bf b}}\right|_{{\bf b} = {\bf y}}.
131: \end{eqnarray}
132:   
133: \section{Variational Integrators}
134: \label{Sec:VariationalIntegrators}
135: 
136: We can construct a variational integrator for a mechanical system with
137: Lagrangian $L(q,v)$---here assumed to be time-independent for
138: simplicity---by considering the action for the system over a small
139: interval of time \citep{Farr2007,Lew2004}:
140: \begin{equation}
141:   S\left(h,q_0, q_1\right) = \int_0^h dt\, L\left( q(t), Dq(t) \right),
142: \end{equation}
143: where $q(t)$ is the physical trajectory of the system with $q(0) =
144: q_0$ and $q(h) = q_1$.  We choose a function, called the
145: \emph{discrete Lagrangian}, which approximates the action integral:
146: \begin{equation}
147:   L_D\left(h, q_0, q_1 \right) \approx S\left(h, q_0, q_1\right).
148: \end{equation}
149: Then the \emph{discrete Euler-Lagrange equations}
150: \begin{eqnarray}
151:   \label{p0Eqn} \partial_1 L_D\left(h,q_0,q_1\right) & = & -p_0 \\
152:   \label{p1Eqn} \partial_2 L_D\left(h,q_0,q_1\right) & = & p_1
153: \end{eqnarray}
154: define an integrator, $\left(q_0,p_0\right) \mapsto
155: \left(q_1,p_1\right)$.  Depending on the structure of $L_D$, equation
156: \eqref{p0Eqn} may be implicit for $q_1$.  
157: 
158: For example, consider the Harmonic oscillator, which has Lagrangian 
159: \begin{equation}
160:   L = \frac{1}{2}\left( v^2 - q^2 \right)
161: \end{equation}
162: in suitable units.  Adopt the ansatz that $q(t) = q_0 + (q_1 - q_0)
163: (t-t_0)/h$; we can construct a discrete Lagrangian using the midpoint
164: rule:
165: \begin{equation}
166:   L_D\left(h,q_0,q_1\right) = h L\left( \frac{q_0+q_1}{2}, \frac{q_1 -
167:       q_0}{h} \right).
168: \end{equation}
169: The integrator equations \eqref{p0Eqn} and \eqref{p1Eqn} can be solved
170: explicitly for $q_1$ and $p_1$.  The result is
171: \begin{eqnarray}
172:   q_1 & = & \frac{4 - h^2}{4 + h^2} q_0 + \frac{4 h}{4+h^2} p_0 \\
173:   p_1 & = & -\frac{4 h}{4+h^2} q_0 + \frac{4-h^2}{4+h^2} p_0.
174: \end{eqnarray}
175: Comparing with the actual solution 
176: \begin{eqnarray}
177:   q(t) & = & q_0 \cos(t) + p_0 \sin(t) \\
178:   p(t) & = & - q_0 \sin(t) + p_0 \cos(t),
179: \end{eqnarray}
180: we see that the integrator follows the exact trajectory but with phase
181: error---that is, $q_1 = q(h + \delta t)$ and $p_1 = p(h + \delta t)$
182: for some phase error $\delta t$.
183: 
184: One way to understand variational integrators is to recall that the
185: action is an $F_1$-type generating function for the canonical
186: transformation that implements time-evolution (see, e.g.,
187: \citet[pp.~415--416]{Sussman2001}).  The action defines the $F_1$-type
188: map, $(q,p) \mapsto (Q,P)$, via
189: \begin{eqnarray}
190:   \partial_1 S\left(h,q,Q\right) & = & -p \\
191:   \partial_2 S\left(h,q,Q\right) & = & P;
192: \end{eqnarray}
193: these are just equations \eqref{p0Eqn} and \eqref{p1Eqn}, with the
194: discrete Lagrangian---an approximate action---replaced by the true
195: action.
196: 
197: Alternately, consider our approximation to the action over a longer
198: interval:
199: \begin{multline}
200:   S_{\textnormal{tot}}\left(q_0, q_1, q_2, \ldots \right) = S\left(h,
201:     q_0,q_1\right) + S\left(h, q_1, q_2 \right) + \ldots \\ \approx
202:   L_D\left(h, q_0, q_1 \right) + L_D\left(h, q_1, q_2 \right) +
203:   \ldots.
204: \end{multline}
205: Then equations \eqref{p0Eqn} and \eqref{p1Eqn} express the stationarity
206: of our approximation to the action with respect to the intermediate
207: positions $q_1$, $q_2$, ....
208: \begin{equation}
209:   \partial_1 S_{\textnormal{tot}}\left(q_0, q_1, q_2, \ldots \right)
210:   \approx \partial_2 L_D\left(h,q_0,q_1\right) + \partial_1
211:   L_D\left(h, q_1, q_2 \right) = p_1 - p_1 = 0.
212: \end{equation}
213: 
214: Because the mapping in equations \eqref{p0Eqn} and \eqref{p1Eqn} is
215: the extremization of an approximation to the action, it shares many of
216: the desirable properties of the exact trajectory which extremizes the
217: true action.  For example, if $L_D$ has symmetries, a discrete
218: N\"{o}ther's theorem implies that the corresponding momenta are
219: conserved.  Also, the mapping is symplectic: denote the mapping by $F$.
220: Then the symplectic form on phase space $dq \wedge dp$ is invariant
221: under pushforward by $F$:
222: \begin{equation}
223: F^* \left( dq \wedge dp \right) = dq \wedge dp.
224: \end{equation}
225: Finally, it is possible to show via backward error analysis
226: \citep{Lew2004} that the mapping implements the \emph{exact} evolution
227: for some Lagrangian $\bar{L}$ which is close to $L$.  Therefore, the
228: evolution under $L_D$ remains on a constant-energy surface in phase
229: space for $\bar{L}$.  Because $\bar{L}$ is close to $L$, the evolution
230: under $L_D$ always remains close to the constant-energy surface of
231: $L$, so the \emph{long-term} energy error of the mapping under $L_D$
232: is bounded.
233: 
234: The order of error in the mapping of equations \eqref{p0Eqn} and
235: \eqref{p1Eqn} is the same as the order of error in the action
236: approximation $L_D$ \citep[Theorem 2.3.1]{Marsden2001}.  That is, if
237: \begin{equation}
238:   L_D(h,q(0),q(h)) = S(h,q(0),q(h)) + \order{h^{n+1}},
239: \end{equation}
240: where $q(t)$ is a stationary-action trajectory, then the mapping
241: defined by equations \eqref{p0Eqn} and \eqref{p1Eqn} approximates the
242: physical trajectory to $\order{h^{n+1}}$, and therefore defines an
243: $n$-th order integrator for $L$.  We shall exploit this result in the
244: error analysis of the integrators presented in this paper.  
245: 
246: \subsection{Multi-Point Variational Integrators}
247: 
248: It is often advantageous to allow the discrete trajectory to pass
249: through intermediate points between $q_0$ and $q_1$.  For example, we
250: may imagine that the discrete trajectory is a polynomial in time which
251: interpolates between the positions $q_0$, $q_0'$, $q_0''$, ...,
252: $q^{(n)}_0$, $q_1$.  With intermediate positions, the discrete
253: Euler-Lagrange equations become
254: \begin{eqnarray}
255:   \partial_1 L_D\left(h,q_0, q'_0, q''_0, \ldots, q^{(n)}_0, q_1 \right) & = & -
256:   p_0 \\
257:   \partial_{i+1} L_D\left(h,q_0, q'_0, q''_0, \ldots, q^{(n)}_0, q_1 \right) & =
258:   & 0, \qquad i = 1,2,\ldots,n \\
259:   \partial_{n+2} L_D\left(h,q_0, q'_0, q''_0, \ldots, q^{(n)}_0, q_1
260:   \right) & = & p_1.
261: \end{eqnarray}
262: The intermediate equations express that the action is stationary with
263: respect to the intermediate positions, while the other equations give
264: the time-evolution canonical transformation.
265: 
266: We can always (in principle) re-express any multi-point discrete
267: Lagrangian as an equivalent two-point discrete Lagrangian by solving
268: the intermediate equations for the intermediate positions in terms of
269: the start and end positions:
270: \begin{equation}
271:   \tilde{L}_D\left(h, q_0, q_1 \right) = L_D\left(h, q_0,
272:     q'_0\left(h,q_0,q_1\right), \ldots,
273:     q^{(n)}_0\left(h,q_0,q_1\right), q_1 \right),
274: \end{equation}
275: where the functions $q'_0\left(h,q_0,q_1\right)$, ...,
276: $q^{(n)}_0\left(h, q_0,q_1\right)$ solve
277: \begin{equation}
278:   \partial_{i+1} L_D\left(h,q_0, q'_0, q''_0, \ldots, q^{(n)}_0, q_1
279:   \right) = 0, \qquad i = 1,\ldots,n.
280: \end{equation}
281: Applying equations \eqref{p0Eqn} and \eqref{p1Eqn} to $\tilde{L}_D$
282: gives the same trajectory as the discrete Euler-Lagrange equations for
283: $L_D$.
284: 
285: One way to form multi-point discrete Lagrangians is to chain together
286: two separate discrete Lagrangians:
287: \begin{equation}
288:   L_D\left(h,q_0,q_0',q_1\right) = L_D^{(1)}\left(h,q_0,q_0'\right) + L_D^{(2)}\left(h,q_0',q_1\right).
289: \end{equation}
290: A quick calculation shows that the evolution under $L_D$ is a
291: composition of evolution under $L_D^{(2)}$ with that under
292: $L_D^{(1)}$.  
293: 
294: A common way to construct variational integrators of various orders is
295: to assume that the trajectory of the system is a polynomial in time
296: which passes through some discretization points: $q = q\left(t; q_0,
297:   q_0', \ldots, q_0^{(n)}, q_1 \right)$.  One then forms a discrete
298: Lagrangian using a quadrature rule on the action integral evaluated on
299: the discrete trajectory:
300: \begin{multline}
301:   L_D\left(h, q_0, q_0', \ldots, q_0^{(n)}, q_1\right) \\ = h \sum_i
302:   w_i L\left(q\left(t_i; q_0, q_0', \ldots, q_0^{(n)}, q_1
303:     \right), \partial_0 q\left(t_i; q_0, q_0', \ldots, q_0^{(n)}, q_1
304:     \right) \right),
305: \end{multline}
306: where $\left\{w_i, t_i\right\}$ are the weights and times of a
307: quadrature rule.  The order of the resulting map is determined by the
308: orders of the polynomial interpolation and quadrature rule.  
309: 
310: \section{Almost-Integrable Systems}
311: \label{IntegratorSection}
312: An \emph{almost-integrable system} has a Lagrangian of the form
313: \begin{equation}
314:   L = L^{(A)} + \epsilon L^{(B)},
315: \end{equation}
316: where $\epsilon \ll 1$, and the trajectories of $L^{(A)}$ are
317: calculable analytically (or at least efficiently).  In contrast to the
318: general Lagrangian, where little can be said about trajectories, we
319: expect that the trajectories of $L$ are going to be, in some sense,
320: close to those of $L^{(A)}$.  We should take advantage of this fact
321: when designing variational maps to approximate the trajectories of $L$
322: instead of blindly assuming polynomial-in-time motion as discussed at
323: the end of the last section.
324: 
325: The integrators we are about to describe all use as a component a
326: particular discrete Lagrangian:
327: \begin{equation}
328:   L_D^{(A)}\left(h,q_A(0),q_A(h)\right) \equiv \int_0^h dt\, L^{(A)}\left(q_A(t),Dq_A(t)\right),
329: \end{equation}
330: where $q_A(t)$ is the trajectory corresponding to the Lagrangian
331: $L^{(A)}$.  $L_D^{(A)}$ is the exact action for the $A$-subsystem on
332: its trajectories; applying equations \eqref{p0Eqn} and \eqref{p1Eqn}
333: to $L_D^{(A)}$ gives the $q_A$ trajectory:
334: \begin{eqnarray}
335:   \partial_1 L_D^{(A)}\left(h,q_A(0),q_A(h)\right) & = & -p_A(0) \label{AIntegratorp0Eqn}\\
336:   \partial_2 L_D^{(A)}\left(h,q_A(0),q_A(h)\right) & = & p_A(h) \label{AIntegratorp1Eqn}.
337: \end{eqnarray}
338: In general, it is not necessary to compute $L_D^{(A)}$; all that is
339: necessary is to be able to efficiently compute the mapping defined by
340: equations \eqref{AIntegratorp0Eqn} and \eqref{AIntegratorp1Eqn}.
341: 
342: \subsection{Composition Maps Using Quadrature Rules}
343: 
344: In this subsection we will show how some well-known symplectic maps
345: are equivalent to variational integrators and we will analyze their
346: errors in the variational framework.  Both the derivation and error
347: analysis are considerably simpler in the variational framework.  We
348: will assume that
349: \begin{equation}
350:   L^{(B)}(q,v) = -V^{(B)}(q);
351: \end{equation}
352: this common case is required for the integrators we discuss to be
353: compositional.  
354: 
355: We will see that the well-known symplectic integrators in
356: \citet{McLachlan1995}, \citet{Chambers2000}, and \citet{Laskar2001}
357: result from using Gauss-Lobatto quadrature to approximate
358: \begin{equation}
359:   -\int_0^h dt\, V^{(B)}(q(t))
360: \end{equation}
361: in the discrete Lagrangian, assuming $q_A$ trajectories between the
362: quadrature points.  In \citet{McLachlan1995}, \citet{Chambers2000},
363: and \citet{Laskar2001} the coefficients for these mapping integrators
364: come from the solution to algebraic equations involving iterated
365: commutators of the Hamiltonians $H^{(A)}$ and $H^{(B)}$, and turn out
366: to be Gauss-Lobatto quadrature weights and times.  In the framework of this
367: paper, the Gauss-Lobatto quadrature coefficients arise naturally from the
368: attempt to approximate the time-integral of $V^{(B)}$ to a given
369: order.
370: 
371: \subsubsection{Kick-Drift-Kick Leapfrog}
372: 
373: Suppose we choose
374: \begin{eqnarray}
375:   L_D\left(h, q_0, q_1\right) & = & L_D^{(A)}\left(h, q_0, q_1 \right) +
376:   \epsilon L_D^{(B)}\left(h,q_0,q_1\right) \nonumber \\ 
377:   & = & L_D^{(A)}\left(h, q_0,
378:     q_1 \right) - \epsilon \frac{h}{2} \left[ V^{(B)}\left( q_0 \right) + V^{(B)}\left( q_1
379:     \right) \right].
380: \end{eqnarray}
381: Here we have simply used the trapezoidal rule (a two-point Gauss-Lobatto
382: quadrature)
383: \begin{equation}
384:   \int_a^b dx\, f(x) \approx \frac{b-a}{2} \left[ f(a) + f(b)\right]
385: \end{equation}
386: to approximate the contribution to the action from $L_B$.  Applying
387: equations \eqref{p0Eqn} and \eqref{p1Eqn} to this discrete Lagrangian,
388: we have
389: \begin{eqnarray}
390:   -p_0 & = & \partial_1 L_D^{(A)}\left(h, q_0, q_1 \right) - \epsilon
391:   \frac{h}{2} DV^{(B)}\left(q_0\right) \\
392:   p_1 & = & \partial_2 L_D^{(A)}\left(h, q_0, q_1 \right) - \epsilon
393:   \frac{h}{2} DV^{(B)}\left(q_1\right).
394: \end{eqnarray}
395: These can be re-written in a suggestive way:
396: \begin{eqnarray}
397:   -\left(p_0 - \epsilon \frac{h}{2} DV^{(B)}\left(q_0\right) \right) &
398:   = & \partial_1 L_D^{(A)}\left(h, q_0, q_1 \right) \\
399:   p_1 & = & \partial_2 L_D^{(A)}\left(h, q_0, q_1 \right) - \epsilon
400:   \frac{h}{2} DV^{(B)}\left(q_1\right).
401: \end{eqnarray}
402: The solution to the first equation is the $q_1$ that results from
403: evolving $\left(q_0, p_0 - \epsilon h/2
404:   DV^{(B)}\left(q_0\right)\right)$ forward by $L^{(A)}$.  The final
405: momentum is then $p_A - \epsilon \frac{h}{2}
406: DV^{(B)}\left(q_1\right)$.  In other words, we kick by $-\epsilon
407: \frac{h}{2} DV^{(B)}\left(q_0\right)$, drift by $L^{(A)}$, and then
408: kick by $-\epsilon \frac{h}{2} DV^{(B)}\left(q_1\right)$.  The
409: algorithm is kick-drift-kick leapfrog---see, e.g.\ \citet{Wisdom1991}.
410: 
411: Using the variational framework to analyze the error of
412: kick-drift-kick leapfrog, we consider 
413: \begin{equation}
414:   \Delta \equiv L_D\left(h, q(0), q(h)\right) - S(h, q(0), q(h)).
415: \end{equation}
416: The trajectory error of kick-drift-kick leapfrog will be of the same
417: order as $\Delta$.  Expanding, we have
418: \begin{multline}
419:   \label{KDKLDError}
420:   \Delta = \Delta_A + \epsilon \Delta_B \\ = \int_0^h dt\, \left[
421:     L_A\left( q_A(t; q(0), q(h)), Dq_A(t; q(0), q(h))\right) -
422:     L_A\left( q(t), Dq(t) \right) \right] \\ - \epsilon \left[
423:     \frac{h}{2} \left( V^{(B)}(q(0)) + V^{(B)}(q(h))\right) - \int_0^h
424:     dt\, V^{(B)}(q(t)) \right].
425: \end{multline}
426: 
427: For the first term, we have 
428: \begin{multline}
429:   \Delta_A = \frac{\delta}{\delta q_A} \left[ \int_0^h dt\, L_A\left(
430:       q_A(t; q(0), q(h)), Dq_A(t; q(0), q(h))\right) \right] \delta
431:   q_A \\ + \frac{\delta^2}{\delta q_A^2} \left[ \int_0^h dt\,
432:     L_A\left( q_A(t; q(0), q(h)), Dq_A(t; q(0), q(h))\right) \right]
433:   \delta q_A^2 + \order{\delta q_A^3},
434: \end{multline}
435: where $\delta q_A$ is the trajectory difference between $q_A$ and $q$.
436: $\delta q_A$ is $\order{\epsilon h}$ because the Lagrangian depends on
437: the velocity, and the two trajectories must differ at first order in
438: $h$ in their velocities (since they feel different forces at order
439: $\epsilon$).  But, the trajectory $q_A$ is the solution to the
440: Euler-Lagrange equations for $L_A$, so the first order variation of
441: $L_A$ vanishes on $q_A$, and only the second-order term contributes.
442: Therefore, we have
443: \begin{equation}
444:   \Delta_A = \order{\epsilon^2 h^3}.
445: \end{equation}
446: 
447: For the second term of equation \eqref{KDKLDError}, we have
448: \begin{equation}
449:   \epsilon \Delta_B = \epsilon \left[ \order{h^3} \right] =
450:   \order{\epsilon h^3},
451: \end{equation}
452: arising from the truncation error in the quadrature rule.  Putting the
453: two terms together, we see that 
454: \begin{equation}
455:   \Delta = \Delta_A + \epsilon \Delta_B = \order{\epsilon h^3} +
456:   \order{\epsilon^2 h^3},
457: \end{equation}
458: with the term at $\order{\epsilon}$ arising from the quadrature rule
459: error, and the term at $\order{\epsilon^2}$ arising from the error in
460: $L_D^{(A)}$.  This will be a general feature of the integrators in
461: this section: the quadrature error determines the $\order{\epsilon}$
462: integrator error, while the $\order{\epsilon^2}$ error is determined
463: by the error in the $L_D^{(A)}$ term.
464: 
465: \subsubsection{S4B}
466: 
467: Consider choosing a higher-order quadrature rule for the $\epsilon
468: L^{(B)}$ term.  For example, a three-point Gauss-Lobatto quadrature rule,
469: with $q_A$ trajectories between the quadrature points:
470: \begin{multline}
471:   L_D\left(h, q_0, q_0', q_1\right) = \\ L_D^{(A)}\left(\frac{h}{2},
472:     q_0, q_0'\right) + L_D^{(A)}\left(\frac{h}{2}, q_0', q_1 \right) -
473:   \epsilon \frac{h}{6} \left[ V^{(B)}\left(q_0\right) + 4
474:     V^{(B)}\left(q_0'\right) + V^{(B)}\left(q_1\right) \right]
475: \end{multline}
476: As above, this integrator can be written as a sequence of kicks and
477: drifts: a kick by $-\epsilon \frac{h}{6} DV\left(q_0\right)$, a drift
478: by $h/2$ with respect to $L^{(A)}$ to $q_0'$, a kick by $-\epsilon
479: \frac{2h}{3} DV\left(q_0'\right)$, a drift by $h/2$ with respect to
480: $L^{(A)}$ to $q_1$, and a final kick by $-\epsilon \frac{h}{6}
481: DV\left(q_1\right)$.
482: 
483: As before the error introduced by the $L_D^{(A)}$ part is second order
484: in $\delta q_A$, or $\order{\epsilon^2 h^3}$, while the quadrature
485: rule introduces an error in the $V^{(B)}$ part of $\order{\epsilon
486:   h^5}$.  (There is an additional error in the quadrature arising from
487: the trajectory error $\delta q_A$, which contributes at
488: $\order{\epsilon^2 h^3}$ because the potential is independent of the
489: velocity difference between $q$ and $q_A$.)
490: 
491: Thus, the error in this method scales as 
492: \begin{equation}
493:   \Delta = \order{\epsilon h^5} + \order{\epsilon^2 h^3}.
494: \end{equation}
495: It belongs to a class of integrators known as ``pseudo-high-order'',
496: first discovered by \citet{McLachlan1995}, and introduced to the
497: astronomical community in \citet{Chambers2000} and \citet{Laskar2001}.
498: These integrators are useful because, for small enough $\epsilon$,
499: they behave as high-order integrators, even though they are formally
500: second order.  The name of this section (and the integrator) is S4B,
501: from \citet{Chambers2000}.
502: 
503: \citet{McLachlan1995} originally derived the coefficients of the
504: drifts and kicks for this integrator by attempting to eliminate
505: commutator terms in the Lie series for Hamiltonian evolution; he noted
506: that the coefficients which eliminate the desired
507: first-order-in-$\epsilon$ terms are identical to the Gauss-Lobatto
508: quadrature coefficients.  In this work, we can understand this as a
509: consequence of attempting high-order quadrature of the contribution of
510: $L^{(B)}$ to the action.
511: 
512: \subsubsection{S6B}
513: 
514: Consider now the sixth-order Gauss-Lobatto quadrature for the
515: $L^{(B)}$ terms, interspersed with $q_A$ evolution:
516: \begin{multline}
517:   L_D\left(h, q_0, q_0', q_0'', q_1 \right) = \\
518:   L_D^{(A)}\left(\frac{h\left(5-\sqrt{5}\right)}{10}, q_0,q_0'\right)
519:   + L_D^{(A)}\left(\frac{h}{\sqrt{5}}, q_0', q_0'' \right) +
520:   L_D^{(A)}\left(\frac{h \left(5 - \sqrt{5}\right)}{10}, q_0'',
521:     q_1\right) \\ - \epsilon \frac{h}{12} \left[
522:     V^{(B)}\left(q_0\right) + 5 V^{(B)}\left(q_0'\right) + 5
523:     V^{(B)}\left(q_0''\right) + V^{(B)}\left(q_1\right) \right]
524: \end{multline}
525: This is exactly the sequence of drifts and kicks for the S6B
526: integrator \citep{Chambers2000}.  Once again, the error is a
527: combination of errors from the quadrature at $\order{\epsilon}$, and
528: errors from $L_D^{(A)}$ at $\order{\epsilon^2}$:
529: \begin{equation}
530:   \Delta = \order{\epsilon h^7} + \order{\epsilon^2 h^3}
531: \end{equation}
532: 
533: \subsection{An $\order{\epsilon^2}$ Method}
534: \label{OrderEpsilon2Method}
535: 
536: We can eliminate all errors at $\order{\epsilon}$ by using for
537: $L_D^{(B)}$ the exact integral of $V^{(B)}$ along the $q_A$
538: trajectory.  Define
539: \begin{multline}
540:   L_D\left(h, q_0, q_1 \right) = L_D^{(A)}\left(h, q_0, q_1\right) +
541:   \epsilon L_D^{(B)}\left(h, q_0, q_1\right) \\ = L_D^{(A)}\left(h,
542:     q_0, q_1\right) - \epsilon \int_0^h dt\, V^{(B)}\left(q_A\left(t;
543:       q_0, q_1\right)\right).
544: \end{multline}
545: Applying equation \eqref{p0Eqn} to $L_D$, and moving the $L_D^{(B)}$
546: term to the left-hand-side, we obtain
547: \begin{equation}
548:   -\left( p_0 + \epsilon \partial_1 L_D^{(B)}\left(h, q_0, q_1\right)
549:   \right) = L_D^{(A)}\left(h, q_0, q_1 \right),
550: \end{equation}
551: which we must solve for $q_1$.  The momentum kick,
552: \begin{equation}
553:   \epsilon \partial_1 L_D^{(B)}\left(h, q_0, q_1\right) = -\epsilon
554:   \int_0^h dt\, DV^{(B)}\left( q_A\left(t; q_0, q_1 \right)
555:   \right) \partial_1 q_A\left(t; q_0, q_1 \right),
556: \end{equation}
557: is the time-averaged force along an $L^{(A)}$ trajectory weighted by
558: $\partial_1 q_A\left(t; q_0, q_1 \right)$---in general, this weight
559: favors the initial periods of the trajectory, since $q_A\left(h; q_0,
560:   q_1\right) = q_1$ independent of $q_0$.  Once the point $q_1$ is
561: determined, the new momentum is
562: \begin{equation}
563:   p_1 = \partial_2 L_D\left(h, q_0, q_1 \right) = p_1^{(A)} +
564:   \epsilon \partial_2 L_D^{(B)}\left(h, q_0, q_1 \right).
565: \end{equation}
566: Here, the kick 
567: \begin{equation}
568:   \epsilon \partial_2 L_D^{(B)}\left(h, q_0, q_1 \right) = - \epsilon
569:   \int_0^h dt\, DV^{(B)}\left( q_A\left(t; q_0, q_1 \right)
570:   \right) \partial_2 q_A\left(t; q_0, q_1 \right),
571: \end{equation}
572: is the time-averaged force along an $L^{(A)}$ trajectory weighted by
573: $\partial_2 q_A\left(t; q_0, q_1 \right)$---which tends to favor later
574: points in the trajectory, since $q_A\left(0; q_0, q_1\right) = q_0$
575: independent of $q_1$.  Because the momentum kicks are related to the
576: time-averaged force along the integrator trajectory, the integrator
577: has a flavor of averaging.  Timesteps with this integrator can be as
578: large as the time it takes the trajectory to deviate \emph{on average}
579: from $q_A$, in contrast to the integrators from the previous
580: subsection.  In those integrators timesteps must be small enough that
581: both $q_A$ adequately approximates the trajectory \emph{and} that the
582: sequence of kicks adequately approximates the averaged force.
583: Evaluating the averaged force in the way that the $\order{\epsilon^2}$
584: variational method does removes this second restriction.  This could
585: be important in the simulation of highly eccentric systems.
586: 
587: \subsubsection{Error Analysis}
588: 
589: The error from the $V^{(B)}$ integral is 
590: \begin{equation}
591:   \label{secondOrderBError}
592:   \epsilon \Delta_B = \epsilon \frac{\delta}{\delta q_A} \left[
593:     \int_0^h dt\, V^{(B)}\left(q_A\left(t; q_0, q_1\right)\right)
594:   \right] \delta q_A + \order{\delta q_A^2} = \order{\epsilon^2 h^3}.
595: \end{equation}
596: Because $V^{(B)}$ depends only on $q$ and not on $\dot{q}$, $\delta
597: q_A$ scales as $\order{\epsilon h^2}$ (the true trajectory $q$ and
598: $q_A$ must differ at order $\epsilon h^2$ because they feel different
599: forces of size $\epsilon$).
600: 
601: Combining the error in equation \eqref{secondOrderBError} with
602: $\Delta_A$, we obtain 
603: \begin{equation}
604:   \Delta = \order{\epsilon^2 h^3},
605: \end{equation}
606: resulting in a method which is formally second-order, but has no
607: errors at $\order{\epsilon}$.  
608: 
609: The method is implicit; one must solve equation \eqref{p0Eqn},
610: \begin{equation}
611:   -p_0 = \partial_1 L_D\left(h, q_0, q_1\right),
612: \end{equation}
613: for $q_1$.  This can be accomplished through Newton iteration, or
614: through the iterative method which follows.  (In practice, for small
615: $\epsilon < 10^{-3}$ and systems of modest dimension, we find
616: that the iterative method is more efficient than Newton iteration.)
617: Define the sequence $\left\{ q_1^{(i)} \right\}$ by 
618: \begin{equation}
619:   -\left( p_0 - \epsilon \partial_1 L_D^{(B)}\left(h, q_0, q_1^{(i-1)}
620:     \right) \right) = \partial_1 L_D^{(A)}\left(h, q_0, q_1^{(i)}\right).
621: \end{equation}
622: If $q_1^{(i-1)}$ is known, then $q_1^{(i)}$ is just the evolution of
623: the state $\left(q_0, p_0 - \epsilon \partial_1 L_D^{(B)}\left(h, q_0,
624:     q_1^{(i-1)} \right)\right)$ by $L_A$.  For small $\epsilon$, this
625: sequence $\left\{q_1^{(i)}\right\}$ converges linearly to the desired
626: $q_1$.
627: 
628: The efficiency of this method will depend on how tractable it is to
629: evaluate 
630: \begin{equation}
631:   \int_0^h dt\, V^{(B)}\left(q_A\left(t; q_0, q_1\right)\right)
632: \end{equation}
633: as a function of the endpoints $q_0$ and $q_1$.  In the next section,
634: we will examine the performance of the methods introduced in this
635: section on some example problems.
636: 
637: \section{Example Calculations}
638: \label{ExampleCalculationsSection}
639: 
640: In this section, we apply the integrators from the previous section to
641: some example problems.  
642: 
643: \subsection{The Perturbed SHO}
644: 
645: Consider the Lagrangian 
646: \begin{equation}
647:   L(q, v) = \frac{1}{2} \left( v^2 - q^2 \right) - \frac{\epsilon}{3} q^3.
648: \end{equation}
649: This represents a simple harmonic oscillator (with natural period
650: $2\pi$) with an additional force $F(q) = - \epsilon q^2$.  For
651: $\epsilon \ll 1$, the system is amenable to solution using the methods
652: from the previous section.  In particular, because the perturbation
653: term is a polynomial in $q$, we can easily compute the
654: $\order{\epsilon^2}$ discrete Lagrangian:
655: \begin{multline}
656:   L_D\left(h, q_0, q_1\right) = \int_0^h dt\, L\left(q_A\left(t; q_0,
657:       q_1 \right), D q_A\left(t; q_0, q_1 \right)\right) = \\
658:   \frac{1}{2}\left( q_0^2 + q_1^2\right) \cot(h) - q_0 q_1 \csc(h) \\
659:   - \epsilon \left[ \left(q_0 + q_1\right) \left(2 q_0^2 + q_0 q_1 + 2
660:       q_1^2\right) + \left( q_0^3 + q_1^3 \right) \cos(h) \right]
661:   \sec^2\left(\frac{h}{2}\right) \tan\left(\frac{h}{2}\right)
662: \end{multline}
663: 
664: Figure \ref{PerturbedSHOFigure} displays the maximum energy error over
665: a simulation of the oscillator with a total time $T = 1000$ as a
666: function of the timestep $h$ for the various methods in Section
667: \ref{IntegratorSection}.  We can see in Figure
668: \ref{PerturbedSHOFigure} that the $\order{\epsilon^2}$ variational
669: method significantly outperforms the other methods at large timesteps.
670: 
671: \begin{figure}
672:   \begin{center}
673:     \includegraphics[width=0.75\textwidth]{sho-dE-vs-dt}
674:   \end{center}
675:   \caption{\label{PerturbedSHOFigure} Maximum relative energy error in
676:     a simulation of the perturbed SHO over a total time $T = 1000$ as
677:     a function of timestep, $h$ by the methods of Section
678:     \ref{IntegratorSection}.  The data are for KDK (plus), S4B
679:     (circle), S6B (star), and $\order{\epsilon^2}$ variational (dot).
680:     We set $\epsilon = 10^{-5}$.  Though it is an implicit method, and
681:     takes more work per step, the $\order{\epsilon^2}$ variational
682:     integrator has such dramatically better error behavior at large
683:     stepsize that it is more efficient for integrating this system.}
684: \end{figure}
685: 
686: \subsection{Jupiter, Saturn, and the Sun}
687: \label{JupiterSaturnSunSection}
688: 
689: This subsection reports on simulations of the Jupiter-Saturn-Sun
690: system with realistic initial conditions.  The Lagrangian for this
691: system is 
692: \begin{equation}
693:   L = \frac{1}{2} \left(m_\odot v_\odot^2 + m_J v_J^2 + m_S v_S^2 
694:   \right) + \frac{G m_\odot m_J}{r_{\odot J}} + \frac{G m_\odot
695:     m_S}{r_{\odot S}} + \frac{G m_J m_S}{r_{JS}}.
696: \end{equation}
697: The well-known Jacobi transformation (see, e.g.\ \citet{Wisdom1991})
698: can transform this Lagrangian into a sum of center-of-mass motion, two
699: Kepler Lagrangians, and perturbing terms with magnitude $\epsilon \sim
700: m_J/m_\odot \sim 10^{-3}$.  
701: 
702: In this paper, we evaluate the time-average of the perturbing
703: terms---which are essentially the disturbing function for the
704: three-body problem---for the $\order{\epsilon^2}$ variational
705: integrator on the $q_A$ (Kepler) trajectory using numerical
706: quadrature.  Numerical quadrature is adaptive; each quadrature point
707: corresponds to a (weighted) kick at that time, and quadrature points
708: are allocated non-uniformly on the interval $[0,h]$ to best
709: approximate the integral.  With this technique, we can use the
710: $\order{\epsilon^2}$ variational method on highly elliptical orbits
711: with a large timestep without loss of accuracy, since the quadrature
712: routine will allocate points densely near pericenter.  The other
713: integration methods, which allocate quadrature points at fixed
714: fractions of the stepsize, must be run with a small enough stepsize to
715: resolve rapidly changing forces near pericenter passage throughout the
716: entire orbit.
717: 
718: Figure \ref{SolarSystemFigure} displays the energy error in a
719: simulation of the Jupiter-Saturn-Sun system for approximately 20
720: Jupiter orbits (which corresponds to approximately 240 years) versus
721: timestep.  For a maximum tolerable error of $\epsilon^2 \sim 10^{-6}$,
722: the $\order{\epsilon^2}$ variational integrator can take stepsizes of
723: order 10 orbits, while the other methods do not perform well until
724: there are several kicks per orbit.  However, for high-accuracy
725: integrations the errors in the methods (excepting KDK) are comparable,
726: and the extra cost of the averaging in the $\order{\epsilon^2}$
727: variational integrator when compared to the other methods makes it
728: sub-optimal.
729: 
730: \begin{figure}
731:   \begin{center}
732:     \includegraphics[width=0.75\textwidth]{kep-dE-vs-dt}
733:   \end{center}
734:   \caption{\label{SolarSystemFigure} Maximum relative energy error
735:     versus stepsize in a simulation of Jupiter, Saturn and the Sun's
736:     mutual gravitational interaction over a period of 250 years
737:     (Jupiter's period is about 12 years).  The curves are for the
738:     following algorithms: KDK (plus), S4B (circles), S6B (stars), and
739:     $\order{\epsilon^2}$ variational (dots).  Because in this system
740:     $\epsilon \sim \frac{m_J}{m_{\odot}} \sim 10^{-3}$ is relatively
741:     large, the $\order{\epsilon^2}$ variational integrator is only
742:     advantageous at energy errors of order $\epsilon^2 \sim 10^{-6}$.
743:     However, for such large energy errors, the $\order{\epsilon^2}$
744:     variational integrator can take stepsizes which are on the order
745:     of 10 orbital periods, significantly larger than traditional
746:     algorithms; these large stepsizes more than offset the increased
747:     computational cost of the method.}
748: \end{figure}
749: 
750: \subsection{Small-mass Jupiter, Saturn, and the Sun}
751: \label{BHSection}
752: 
753: This subsection reports on a simulation with the same initial
754: conditions as Section \ref{JupiterSaturnSunSection}, but with the
755: masses of Jupiter and Saturn reduced by a factor of $10^{-3}$.  This
756: brings $\epsilon \sim 10^{-6}$, roughly in line with the size of the
757: perturbing interaction one might find in a cluster of stars around a
758: super-massive black hole in the center of a galaxy.
759: 
760: Figure \ref{BlackHoleFigure} presents the relative energy error versus
761: timestep for a simulation of this smaller-$\epsilon$ system over
762: approximately 100 Jupiter orbits.  In this circumstance, the
763: $\order{\epsilon^2}$ variational integrator significantly outperforms
764: the other integrators, even for the (relatively severe) error budget
765: of $10^{-12}$.  It can take steps which are approximately $10^3$
766: longer than those of the other integrators at the same energy error
767: budget, more than compensating for the expensive time-averaging and
768: implicit nature of the algorithm.
769: 
770: \begin{figure}
771:   \begin{center}
772:     \includegraphics[width=0.75\textwidth]{bh-dE-vs-dt}
773:   \end{center}
774:   \caption{\label{BlackHoleFigure} Maximum relative energy error in a
775:     simulation analogous to the one in Section
776:     \ref{JupiterSaturnSunSection}, except with Jupiter and Saturn's
777:     masses reduced by a factor of $10^{-3}$ (note that Jupiter still
778:     has a 12-year period).  The curves are for the following
779:     algorithms: KDK (plus), S4B (circles), S6B (stars), and
780:     $\order{\epsilon^2}$ variational (dots).  In this system $\epsilon
781:     \sim 10^{-6}$, and we see that the $\order{\epsilon^2}$
782:     variational integrator can take stepsizes which are $\sim 10^3$
783:     larger than other algorithms for an error budget of $10^{-12}$.}
784: \end{figure}
785: 
786: In Figure \ref{BlackHoleTrajectoryErrorFigure} we plot the trajectory
787: error of the various methods at the end of the the simulation period
788: (100 Jupiter orbits).  The $\order{\epsilon^2}$ variational method
789: outperforms the other methods by approximately a factor of $10^3$ in
790: stepsize at a relative trajectory error of $10^{-10}$.    
791: 
792: \begin{figure}
793:   \begin{center}
794:     \includegraphics[width=0.75\textwidth]{bh-traj-err}
795:   \end{center}
796:   \caption{\label{BlackHoleTrajectoryErrorFigure} Relative phase-space
797:     (trajectory) error at the end of a simulation analogous to the one
798:     in Section \ref{JupiterSaturnSunSection}, except with Jupiter and
799:     Saturn's masses reduced by a factor of $10^{-3}$ (note that
800:     Jupiter still has a 12-year period).  The curves are for the
801:     following algorithms: KDK (plus), S4B (circles), S6B (stars), and
802:     $\order{\epsilon^2}$ variational (dots).  In this system $\epsilon
803:     \sim 10^{-6}$, and we see that the $\order{\epsilon^2}$
804:     variational integrator can take stepsizes which are $\sim 10^3$
805:     larger than other algorithms for a phase-space error budget of
806:     $10^{-10}$.}
807: \end{figure}
808: 
809: \section{Conclusion}
810: 
811: The variational framework subsumes standard symplectic methods.  In
812: this work, we have presented the pseudo-high-order integrators of
813: \citet{McLachlan1995}, \citet{Chambers2000}, and \citet{Laskar2001}
814: from the variational viewpoint for systems with Lagrangian $L =
815: L^{(A)} + \epsilon L^{(B)}$.  In addition, we have used the
816: variational framework to derive a novel implicit integrator which uses
817: the average perturbing Lagrangian over trajectories of the dominant
818: Lagrangian to remove all errors from the integration at
819: $\order{\epsilon}$.  We have presented numerical evidence that, for
820: small $\epsilon$, this latter integrator is more efficient than
821: standard pseudo-high-order symplectic integrators for perturbed
822: systems.  It would be interesting to investigate the performance of
823: this latter integrator with various analytical approximations to the
824: average of the perturbing Lagrangian.
825: 
826: \begin{acknowledgements}
827:   I wish to thank Edmund Bertschinger and Jack Wisdom for helpful
828:   comments on this work, and Scott Tremaine and Piet Hut for their
829:   comments and the kind invitation to visit the Institute for Advanced
830:   Study, where I began this work.  This work was supported by NSF
831:   grant AST-0407050 and NASA grant NNG06-GG99G.
832: \end{acknowledgements}
833: 
834: \bibliography{kv}
835: 
836: \end{document}