Spectral-collocation variational integrators Yiqun Li*, Boying Wu Department of Matematics, Harbin Institute of Tecnology, Harbin 5, PR Cina Melvin Leok Department of Matematics, University of California at San Diego, La Jolla, CA 993, USA Abstract Spectral metods are a popular coice for constructing numerical approximations for smoot problems, as tey can acieve geometric rates of convergence and ave a relatively small memory footprint. In tis paper, we recall te metod for constructing Galerkin spectral variational integrators and introduce a general framework to convert a spectral-collocation metod into a sooting-based variational integrator for Hamiltonian systems. We also present a systematic comparison of ow spectral-collocation metods, Galerkin spectral variational integrators, and sooting-based variational integrators derived from spectral-collocation metods perform in terms of teir ability to reproduce accurate trajectories in configuration and pase space, teir ability to conserve momentum and energy, as well as te relative computational efficiency of tese metods wen applied to some classical Hamiltonian systems. In particular, we note tat spectrally-accurate variational integrators, suc as te Galerkin spectral variational integrator and te spectral-collocation variational integrator, combine te computational efficiency of spectral metods togeter wit te geometric structure-preserving and long-time structural stability properties of symplectic integrators. Keywords: Geometric numerical integration; Variational integrators; Spectral-collocation metod; Lagrangian mecanics.. Introduction Symplectic integrators ave long played an important role in te long-time simulation of mecanical systems [, 8, 9], and te caracterization of symplectic integrators in terms of variational integrators [4] as proven to be very fruitful. Additionally, variational integrators can be applied to te discretization of optimal control problems in robotics and aeronautics [3, 6, 8, 3]. Te basic idea of a variational integrator is to construct te numerical sceme by discretizing te appropriate variational principle, e.g., Hamilton s principle for conservative systems, Lagrange d Alembert principle for dissipative or forced systems. Te resulting integrators exibit clear advantages wen compared wit conventional numerical integration algoritms. Tey are symplectic and momentum-preserving, and exibit near energy conservation for exponentially long times. Moreover, tey can be easily extended to a large class of problems, suc as PDEs [], Lie Poisson dynamical systems [5], stocastic systems [], and Email addresses: liyiqun_it@63.com Yiqun Li, matwby@it.edu.cn Boying Wu, mleok@mat.ucsd.edu Melvin Leok Preprint submitted to Elsevier July 9, 5
optimal control [6, 3]. A comparison of spectral-collocation metods and symplectic metods wen applied to Hamiltonian systems was conducted in [4], and in tis paper, we will discuss metods for constructing spectrally-accurate variational integrators tat combine te benefits of spectral and symplectic integrators. Tere are two general metods for constructing iger-order variational integrators, te first is te Galerkin construction [, 6], and te oter is te sooting-based construction [, 7]. Te construction of Galerkin variational integrators relies on a variational caracterization of te exact discrete Lagrangian, wic is ten approximated troug te coice of a finite-dimensional function space and a sufficiently accurate quadrature formula. Te sooting-based approac relies on te caracterization of te exact discrete Lagrangian in terms of Jacobi s solution of te Hamilton Jacobi equation, wic involves evaluating te action integral on te solution of te Euler Lagrange boundary-value problem. Tis is approximated by constructing a numerical approximation of te solution of te Euler Lagrange boundary-value problem by using te sooting metod and approximating te action integral wit a numerical quadrature formula. In tis paper, we first present a brief overview of Lagrangian and Hamiltonian mecanics and variational integrators in Section. In Section, we recall te construction of spectral-collocation metods. We ten recall te construction of Galerkin spectral variational integrators in Section 3 and introduce sooting-based variational integrators derived from spectral-collocation metods in Section 4. In bot of tese sections, we will also provide extensive numerical comparisons wit oter metods. In Section 5, we make some concluding remarks and comment on possible future directions... Lagrangian and Hamiltonian mecanics Lagrangian Mecanics. Consider a mecanical system on an n-dimensional configuration manifold Q wit generalized coordinates q i, i =,..., n, wic is described by a Lagrangian L : T Q R tat is given by te kinetic energy minus te potential energy. Te action S : C [a, b], Q R is given by Sq = b a Lq, qdt. Ten, Hamilton s principle states tat te action is stationary for curves qt C [a, b], Q wit fixed endpoints, i.e., δsq = δ b a Lq, qdt =, were δqa = δqb =. By te fundamental teorem of te calculus of variations, we ave wic are referred to as te Euler Lagrange equations. d L dt q L =, i qi Hamiltonian Mecanics. Alternatively, te mecanical system can be described by a Hamiltonian H : T Q R given by Hq, p = p i q i Lq, q,
were te velocities on te rigt-and side are implicitly defined in terms of te momenta by te Legendre transformation p i = L. Tis leads to Hamilton s principle in pase space, q i δ [p i q i Hq, p]dt =, were we again assume tat te variations in q vanis at te endpoints, i.e., δqa = δqb =. By te fundamental teorem of te calculus of variations, q i = H p i, ṗ i = H, i =,..., n, 3 qi wic are Hamilton s canonical equations... Discrete mecanics and variational integrators Discrete Lagrangian mecanics [4] is based on a discrete analogue of Hamilton s principle. We first consider a discrete Lagrangian, L d : Q Q R, and construct te discrete action sum, S d : Q n+ R, wic is given by n S d q, q,..., q n = L d q i, q i+. Ten, te discrete Hamilton s principle states tat i= δs d =, for variations tat vanis at te endpoints, i.e., δq = δq n =. Tis yields te discrete Euler LagrangeDEL equation, D L d q k, q k + D L d q k, q k+ =, 4 wic implicitly defines te discrete Lagrangian map F Ld : q k, q k q k, q k+. Tis is equivalent to te implicit discrete Euler Lagrange IDEL equations, p k = D L d q k, q k+, p k+ = D L d q k, q k+, 5 wic implicitly defines te discrete Hamiltonian map F Ld : q k, p k q k+, p k+ were te discrete Lagrangian can be viewed as te Type I generating function of a symplectic transformation. Te discrete Lagrangian and Hamiltonian maps describe numerical integration scemes tat are referred to as variational integrators, and tey are automatically symplectic and exibit excellent long-time energy beavior. If te discrete Lagrangian is invariant under te diagonal action of a symmetry group, ten tere is a discrete momentum map tat is preserved, via a discrete version of Noeter s teorem. As we observed, te discrete Lagrangian, L d : Q Q R, is a generating function of a symplectic flow. Furtermore, tere exists a generating function tat generates te exact time- flow map of Hamilton s equations, wic we refer to as te exact discrete Lagrangian, L E d q k, q k+ = tk+ t k Lq k,k+ t, q k,k+ tdt, 6 3
were q k,k+ t k = q k, q k,k+ t k+ = q k+ and q k,k+ satisfies te Euler Lagrange equation in te time interval [t k, t k+ ]. Te exact discrete Lagrangian is related to Jacobi s solution of te Hamilton Jacobi equation. Alternatively, one can caracterize te exact discrete Lagrangian variationally as follows, L E d q k, q k+ ; = ext q C [k,k+],q qk=q k,qk+=q k+ k+ k Lqt, qtdt. 7 In Section.3 of [4], te concept of variational error analysis is introduced. Essentially, it states tat if one can construct a computable approximation of te exact discrete Lagrangian to a given order of accuracy, ten it generates a numerical one-step metod, via te discrete Hamiltonian map, wit te same order of accuracy. An alternative way of describing te discrete Lagrangian and Hamiltonian maps is in terms of te discrete Legendre transforms, F ± L d : Q Q T Q, tat were introduced in [4], F + L d : q k, q k+ q k+, p k+ = q k+, D L d q k, q k+, F L d : q k, q k+ q k, p k = q k, D L d q k, q k+. Given tese definitions, we can introduce te following commutative diagram, wic sows te relationsip between te discrete Lagrangian map, discrete Hamiltonian map, and discrete Legendre transformations, q k, p k F Ld qk+, p k+ F + L d F L d F + L d F L d q k, q k F Ld q k, q k+ F Ld q k+, q k+ It is clear tat te discrete Hamiltonian map can be described as F Ld = F + L d F L d, and te discrete Lagrangian map F Ld = F L d F + L d.. Spectral-collocation metods Spectral metods are popular due to teir ig accuracy and exponential rates of convergence, and te practicality of suc metods were greatly enanced by te development of fast transform metods [3]. Te implementation of spectral metods are mainly accomplised wit collocation, Galerkin and Tau approaces. Most mecanical systems can be described as a system of second-order nonlinear ordinary differential equations. In tis section, we will introduce te spectral-collocation i.e. pseudospectral metods for te following class of second-order initial value problems, { q t = ft, qt, qt, a < t b, 8 qt = q, qt = v. and we will introduce two different metods for implementing spectral-collocation metods. 4
.. Constructions of spectral-collocation metods Trougout our discussion, two kinds of points will be of particular interest: Cebysev points and Legendre points. Te motivation for considering suc points is tat wen compared wit equispaced points, polynomial interpolation and quadrature based on tese points exibit faster rates of convergence and iger-order accuracy [3]. Legendre collocation points 4 collocation points 7 collocation points Cebysev... Differentiation matrix approac In tis part, we introduce te differentiation matrix approac to spectral-collocation metods based on te Cebysev Gauss Lobatto points. First, we recall some definitions and lemmas about te Kronecker product and te vectorization operator wic will be used in te construction of numerical scemes for 8 later. Definition. [9]. Let A = a ij m n and B be arbitrary matrices. Ten te matrix a B a B... a n B a B a B... a n B A B =......, a m B a m B... a mn B is called te Kronecker product of A and B. Definition. [9]. Let A = a ij m n. Ten veca is defined to be a column vector of size m n composed of te rows of A, ordered from left to rigt, stacked atop one anoter, veca = a, a,..., a n, a, a,..., a m,..., a mn T. Lemma. [9]. Let A = a ij m n, B = b ij n p, C = c ij p q. Ten vecabc = A C T vecb. Lemma. [9]. Let A = a ij m, B = b ij n. Ten vecab T = A B. Now we consider te following first-order initial value problem, { q = ft, qt, a < t b, qt = q. 9 were qt = [q t, q t,, q m t], ft, q = [f t, q, f t, q,, f m t, q], 5
as iger-order problems can be transformed into a systems of first-order initial value problems by introducing auxiliary variables. Let N Z +, and let x j = cos jπ, j =,,..., N be te Cebysev N Gauss Lobatto points in te interval [, ]. By translation and rescaling, t j = a b ax j are te Cebysev Gauss Lobatto points in te interval [a, b]. Equation 9 can be discretized by introducing te Cebysev differentiation matrix à to obtain, à Q = F Q, were à is te first-order Cebysev differentiation matrix in te interval [a, b], and It is not ard to sow tat[3] Q = [q, Q] T, Q = [qt, q t,..., qt n ] T, F Q = [ft, qt, ft, qt,..., ft N, qt N ] T. à = b a D : N +, : N +, were D is te first-order Cebysev differential matrix in te interval [, ] given in [3] by N +, i = j =, 6 x j D i,j = x j, i = j =,..., N, c i i+j c j x i x j, i j, i, j =,..., N, N +, i = j = N, 6 c k = {, k = or N,, oterwise As te initial value q is given, we can partition te matrices into à = [a, A] and Q = [q, Q] T, wic allows us to rewrite in te following way, were AQ + a q = F Q. q = [qt, qt,..., qt N ] T, qt j = [q t j, q t j,, q m t j ], F Q = [ft, qt, ft, qt,..., ft N, qt N ] T, ft j, qt j = [f t j, qt j, f t j, qt j,, f m t j, qt j ]. Now we consider te second-order initial value problem, { q t = ft, qt, qt, a < t b, qt = q, qt = v, 3 6
were qt = [q t, q t,, q m t], ft, q, q = [f t, q, q, f t, q, q,, f m t, q, q]. By introducing te auxiliary variable v = q, 3 can be transformed into te following form { q = v, v t = ft, qt, vt, 4 wit initial conditions qt = q, vt = q. Ten, we ave AQ + a q = V, 5 AV + a v = F Q, V. 6 by using te numerical sceme given by wic we obtained above for first-order systems. Substituting 5 into 6, we obtain Using Lemma. and Lemma., we ave tat AAQ + a q + a q = F Q, AQ + a q. 7 A I m vecq = vecf Q, AQ + a q a q T Aa q T, 8 were I m is te m m identity matrix. Ten, vecq can be solved from 8 by using a nonlinear root finder. Te expression given by 8 can be used to construct te numerical solution of te Euler Lagrange equations, but we can also directly apply to Hamilton s equations, wic are a system of first-order equations, q = H = fq, p, p 9a ṗ = H = gq, p, q 9b wit initial position and momentum q, p, were q = [q t, q t,..., q m t], p = [p t, p t,..., p m t], f = [f q, p, f q, p,..., f m q, p] T, g = [g q, p, g q, p,..., g m q, p] T. We construct te numerical algoritm on an arbitrary single interval [a, b], wit te initial value qa = q, pa = p. For a multi-interval situation, tis algoritm can be iterated by treating te solution of te former interval as te initial value of te next interval. Let N Z + and let x j = cos jπ, j =,,..., N be te Cebysev Gauss Lobatto points in te N 7
interval [, ], ten t j = a b a x j are te Cebysev Gauss Lobatto points in te interval [a, b]. Discretizing 9 wit te Cebysev differentiation matrix, we obtain were [ à à ] [ Q P ] = [ F Q, P G Q, P Q = [qt, qt,..., qt N ] T, P = [pt, pt,..., pt N ] T, F = [ft, ft,..., ft N ] T, G = [gt, gt,..., gt N ] T, and à is te first-order Cebysev matrix in te interval [a, b] given by à = b a D : N +, : N +. ], As te initial values qt = q, pt = p are given, we can use te partitions à = [a, A], Q = [q, Q] T, and P = [p, P ] T, to expand as follows, [ ] [ ] [ ] [ ] A Im vecq d q + vecf Q, P =, A I m vecp d p vecgq, P were I m is te m m identity matrix. Ten, can be solved using a nonlinear root finder.... Collocation-based Implicit Runge Kutta approac Tere is an extensive literature devoted to te construction of implicit Runge Kutta IRK metods [6,, 7]. Here, we briefly review te construction of collocation-based IRK metods. Using tis framework, we can construct collocation metods suc as Gauss Legendre, Gauss Cebysev and teir Radau and Lobatto variants. Witout lose of generality, we use te definition given in [], were a collocation-based, s-stage IRK metod consist of coosing s collocation points c, c,..., c s in te interval [,]. Definition.3 []. Let c, c,..., c s be distinct real numbers usually c < < c s. Te collocation polynomial ut is te unique polynomial of degree s satisfying ut = q ut + c i = f t + c i, u t + c i, i =,..., s, and te numerical solution of collocation metod is defined by q = ut +. Teorem. []. Te collocation metod of Definition.3 is equivalent to te s-stage Runge Kutta metod wit coefficients a ij = ci l j τdτ, b i = were l i τ is te Lagrange polynomial l i τ = Π l i τ c l /c i c l. 8 l j τdτ, 3
Consider te Gauss metod as an example. If we coose c,..., c s to be te zeros of te s-t sifted Legendre polynomial d s x s x s, dx s te interpolatory quadrature formula as order p = s, and it can be sow tat tis class of collocation metods are A-stable [7], B-stable [5], and symplectic [8]. Te Runge Kutta coefficients for te cases s =, s = 3 and s = 4 are given below Table : Gauss metod of order 4 3 6 + 3 6 4 + 3 4 6 3 4 6 4 5 + 5 Table : Gauss metod of order 6 5 36 5 + 5 36 4 5 + 5 36 3 5 8 5 9 5 9 + 5 9 5 4 9 5 5 36 3 5 5 36 4 5 36 5 8 Table 3: Gauss metod of order 8 w + w w 3 w 5 w w w 3 + w 4 w w 3 w 4 w w 5 w + w w 3 w 5 w w 3 + w4 w w w 5 w w 3 w4 w + w + w 3 + w 5 w + w 3 + w4 w + w 5 w w w 3 w4 w + w + w 3 + w 5 w + w 5 w + w 3 + w 4 w + w 3 w 4 w w w w w were w = 3 8 44, w = 3 8 + 44, / / 5 + 3 5 3, w, w = 35 w 3 = w 6 + 3 4 w 4 = w + 5 3 68 =, w 3 = w, w 4 = w 35 3 6, 4 5 3 68 w 5 = w w 3, w 5 = w w 3. Te coefficients of te iger-order Gauss Legendre metod can be found in [4]. Oter kinds of collocation metods exibit different properties see Table 4 tat make tem more or less useful tan te Gauss Legendre metods, depending on te specific coice of application. It sould be noted tat many of tese oter classes of collocation metods are not symplectic, so it is of substantial significance and interest to construct variational integrators tat are symplectic, but wic are derived from spectral-collocation metods tat use oter coices of collocation points, suc as te Cebysev, Radau and Lobatto points... Numerical comparisons Now, we test te numerical scemes constructed above and make a comparison of te orbits generated by te different numerical scemes Explicit Euler, Störmer Verlet, 6t-order Symplectic Runge Kutta 9,
Table 4: Properties of different collocation metods Gauss metods Cebysev metods Radau metods LobattoIIIA A stable a symmetric b symplectic c superconvergent d a stable wen solving stiff equations b preserve time-reversibility of a dynamical system c preserve Hamiltonian of a dynamical system d s-stage metod acieves order s and Cebysev collocation wen applied to te Kepler two-body problem, wic describes te motion of two bodies under mutual gravitational attraction. If one body is placed at te origin, te corresponding Lagrangian and angular momentum of te Kepler two-body system are Lq, p = T V = p + p, q + q and Mq, p = q p q p, were q = q, q represent te position of te second body and p = p, p represent te velocity. Using we can easily obtain te Euler Lagrange equations of te system, q = p, q = p, q 4a 4b ṗ =, 4c q + q 3/ q ṗ =. 4d q + q 3/ Given te coice of an eccentricity e, suc tat e <, and te associated initial conditions, + e q = e, q =, p =, p = e, te analytic solution is π-periodic and is given by q = cost e, q = e sint. Figure sows some numerical solutions for te eccentricity e =.6 compared to te analytic solution. Neiter te explicit Euler metod nor te Cebysev collocation metod are symplectic, and te pase volume is not preserved, as evidenced by te fact tat te associated orbits spiral outwards. However, te Cebysev collocation metod is of iger order tan te explicit Euler metod, and one observes tat te numerical orbit is muc more accurate even toug te explicit Euler metod is advanced using time-steps tat are a factor of smaller. Te Störmer Verlet metod and symplectic Runge Kutta metod are bot symplectic, and tey bot preserve te area of te elliptical orbit.
.5 a Explicit Euler.5 b Stormer Verlet q.5.5 q.5.5.5 5 4 3 q.5.5.5 q c Symplectic Runge Kutta d Cebysev collocation.5.5 q q.5.5.5.5.5 q.5.5.5 q Figure : Two-body Kepler problem. Total time T =. a Explicit Euler, time-step =.5; b Störmer Verlet, time-step =.; c 6t-order symplectic Runge Kutta, time-step =.5; d Cebysev collocation, 5 collocation points, time-step =.5. 3. Galerkin spectral variational integrators In tis section, we first recall te implementation of spectral variational integrators wic falls witin te framework of generalized Galerkin variational integrators tat were discussed in [, 9, 4]. One may refer to [] for a more in dept description and analysis of spectral variational integrators. As spectral variational integrators and spectral-collocation metods are bot determined by te coice of a finite-dimensional interpolation space, it is nature for us to be curious about te relative performance of tese two metods wen tey bot utilize te same interpolation points. So, we provide numerical comparisons of spectral variational integrators and spectral-collocation metods wic bot based on Cebysev Gauss Lobatto interpolation in te end of tis section. 3.. Approximation of te exact discrete Lagrangian To approximate te trajectory q : [, T ] Q, we divide te total time interval [, T ] into N subintervals of equal lengt, a discrete curve in Q is defined in terms of piecewise polynomial curves q : [k, k + ] Q, k =,..., N, tat are subordinate to te partitioning of te time interval, [, T ] = [k, k + ], N k= N = T/.
Q q s k q k q k q k q s k q s k kc d c d c c s dm c s dm k + c s Figure : Te red dots represent te quadrature points, wic may or may not be te same as te interpolation points wic represented by black dots. t We now discuss ow one can systematically approximate te generally non-computable exact discrete Lagrangian L E d q k, q k+ wit a igly-accurate computable discrete Lagrangian, L d q k, q k+. Specifically, given a Lagrangian L : T Q R, we approximate te infinite-dimensional function space, C[k, k + ], Q = {q C [k, k + ], Q qk = q k, qk + = q k+ }, tat appears in te variational caracterization of te exact discrete Lagrangian 7 wit a finitedimensional function subspace, C s [k, k + ], Q = {q C[k, k + ], Q q is a polynomial of degree s}. As is sow in Figure, we can consider a discretization of te configuration space on a s-dimensional function space generated by Lagrange interpolating polynomials based on te Cebysev points c j = k+ + cos jπ, were c s j are te Cebysev points x j = cos jπ, j s rescaled from [, ] to s [k, k + ]. So, for any cosen numerical quadrature formula w i, τ i m i=, were w i are te quadrature weigts and τ i [, ] are te quadrature points, we obtain, qd i ; q v k, = s qkl v v,s τd i, qd i ; qk, v = v= s v= q v k l v,s τd i dτ dt = s qk v l v,s τd i, v= were τt = t t k [, ], d i are te quadrature points in te interval [t k, t k+ ], and l v,s τ are te Lagrange basis polynomials of degree s, l v,s τ : [, ] R, tat are given by l v,s τ = j s,j v Ten, we can approximation te discrete Lagrangian as τ x j x v x j. L d q k = qk, qk,..., qk s = q k+ ; = ext q C s [k,k+],q qk =q k,qk s=q k+ m = ext qk,q k,...,qs k qk =q k,qk s=q i= k+ m w i Lqd i ; qk, v, qd i ; qk, v i= s w i L qkl v v,s τ i, v= s qk v l v,s τ i. v= 5
3.. Implementation of multi-interval spectral variational integrators In 5, requiring tat qk v, v =,..., s be stationary points gives te following stationarity conditions, D i L d q k, q k,..., q s k; =, i =,..., s, 6a D s+ L d q k = q k, q k,..., q s k = q k+ ; + D L d q k+ = q k+, q k+,..., q s k+ = q k+ ; =, 6b wic can be viewed as a combination of internal stage conditions tat can be used to determine qk,..., qs k and te usual te discrete Euler Lagrange equations. Expanding 6 yields te following set of s + nonlinear equations, p k = = p k+ = m n= m n= m i=n w n [ l,sτ n L q w n [ l r,sτ n L q w n [ l s,sτ n L q s v= s v= s v= q v kl v,s τn, q v kl v,s τn, q v kl v,s τn, s v= s v= s v= q v k l v,s τn + l,s τ n L q q v k l v,s τn + l r,s τ n L q q v k l v,s τn + l s,s τ n L q were r =,..., s. Ten, 7a and 7b can be written in te following matrix form, were Ãk is a s s + matrix and te entries are given by s v= s v= s v= q v kl v,s τn, q v kl v,s τn, q v kl v,s τn, s qk v l ] v,s τn, v= 7a s qk v l ] v,s τn, v= 7b s qk v l ] v,s τn, v= 7c à k Qk = G k, 8 à i,j k = m w n li,s τ n l j,s τ n, 9 n= Q k is a s + -dimensional column vector, G k is a s-dimensional column vector, G k = [g k, g k,..., g s k ] T = [ m n= Q k = [q k, q k,..., q s k] T, w i l,s τ n L q, m n= w i l,s τ n L q,..., m n= ] w i l s,s τ n L T. q As te initial value q k can be obtained from te previous step, by considering te partitions Ãk = [A k, A k] and Q k = [q k, Q k] T were A k is te first column of te matrix Ãk, we can rewrite 8 to obtain A k I m vecq k + A k q k T + vecg k = [ p k, s ] T. 3 3
Ten, 3 can be solved using a nonlinear root finder. Tis gives us te solution Q k. Substituting tis into 7c, we can get p k+. Te multi-interval algoritm can be obtained by cycling troug te following diagram, q k, p k 7a7b Q = q k, q k,..., qs k 7c q k+, p k+ k k+ and te iterative algoritm can be summarized as follows: Table 5: Te iterative algoritm of SVI STEP. coose te number of collocation points s + and quadrature formula w i, τ i m i=. STEP. compute matrix A k, k =,..., N. STEP3. coose an initial guess for te solution at te collocation points Q k = qk, q k,..., qs k. STEP4. compute G k Q and its Jacobian. STEP5. update Q k = qk, q k,..., qs k by performing a nonlinear rootfinding iteration for 3, until max Q i+ Q i L, P i+ P i L < T OL. STEP6. let qk+ = qs k and compute p k+ by 7c. STEP7. k k +, repeat STEP3 to STEP6. 3.3. Numerical comparisons In tis section, we simulate some classical Hamiltonian systems to explore te relative performance caracteristics of te numerical scemes described above. In particular, we compare te spectral variational integrator SVI to te spectral-collocation SC metod and some iger-order symplectic Runge Kutta SRK metods tat are derived from te Gauss collocation metods. Te properties tat we consider in te numerical experiments include te trajectory in pase space, te trajectory in configuration space, momentum, energy beavior and computational time. In te nonlinear solves tat are used wen implementing te SVI, SC and SRK, we also compare te maximum pointwise errors, max Q i+ Q i L, P i+ P i L and set te tolerance to 4 and te maximum iteration count is set to. 3.3.. Simple armonic oscillator Te simplest example of an oscillating system is a mass connected to a rigid foundation by a linear spring. Tis is described by te Lagrangian, or equivalently wit te Hamiltonian, L = T V = m q kq, H = T + V = p m + kq, were m and k are mass and spring constant, respectively. Te Euler Lagrange equations are given by, m q + kq =, 4
and Hamilton s equations are given by q = p m, ṗ = kq. 3a 3b Let m = k =, and coose te initial value q =, p =. We simulate te simple armonic oscillator wit bot te spectral variational integrator SVI and te Cebysev spectral-collocation SC metod. Figure 3 compares te trajectory in pase space generated by SVI and SC. To more clearly demonstrate te differences in tese two pase trajectories, we plot te pase trajectory every 5 timesteps. Figure 4 sows te position error of tese two metods. Wen we use te same time-step and te same number of Cebysev points, te position error of SC is several orders of magnitude bigger and grows muc faster tan SVI. In comparison, te position error of te SVI appears to be bounded and remains small. From Figure 5, we can also see tat te energy error of SC is also muc bigger and grows muc faster tan SVI. In Figures 6, 7, 8, we compare te configuration error and energy error under bot N-refinement and -refinement, were N represents te number of collocation points and represents te time-step. It is clear tat te SVI is more accurate tan SC bot in configuration and energy errors, wen using te same number of collocation points and te same time-step..8 SVI EXACT.8 SC EXACT.6.6.4.4.. p p...4.4.6.6.8.8.5.5 q.5.5 q Figure 3: Simple armonic oscillator, comparison of pase trajectory wit time-step =, and total time T = for SVI and SC, bot wit 9 Cebysev points..8.6.4...4.6.8 x 3 4 5 6 7 8 9.8.6.4...4.6.8 x 8 3 4 5 6 7 8 9 Figure 4: Simple armonic oscillator, comparison of position error wit time-step =, and total time T = for SVI, SC bot wit 9 Cebysev points. 5
6 8 SC SVI energy error 4 6 5 5 5 3 35 4 45 5 time Figure 5: Simple armonic oscillator, comparison of energy error wit time-step =, and total time T = 5 for SVI, SC bot wit 9 Cebysev points. 4 e=. N e= 4.9 N error of SVI error of SC 4 e=. N e= 4.9 N error of SVI error of SC 6 6 L error 8 L error 8 4 4 6 5 5 3 35 4 45 Cebysev Points per step 6 5 5 3 35 4 45 Cebysev Points per step Figure 6: Simple armonic oscillator, left L error of q over a single time-step = wit N-refinement. rigt L error of energy over a single time-step = wit N-refinement L error 4 6 8.5 3 5 5 7 5 9 3 SVI, N= SC, N= SVI, N=4 SC, N=4 SVI, N=6 SC, N=6 4 6 8 step size 3 Figure 7: Simple armonic oscillator, L error of q wit -refinement. Here, we use N in te legend to denote te number of Cebysev points used to construct te metod. 6
L error 5 4 5 6 5 8 9 SVI, N= SC, N= SVI, N=4 SC, N=4 SVI, N=6 SC, N=6 5 step size 3 Figure 8: Simple armonic oscillator, L error of energy wit -refinement. Here, we use N in te legend to denote te number of Cebysev points used to construct te metod. 3.3.. Planar pendulum Te pendulum consists of a mass m attaced on a rod of lengt l. Considering te planar motion in te x-z plane, were te generalized coordinate q S denotes te angle tat te rod makes wit te direction of gravity. Ten, te Lagrangian is given by, and te Hamiltonian is given by, Lq, q = ml q + mgl cosq, Hq, p = Te corresponding Euler Lagrange equations are, p mgl cosq. ml ml q + mgl sin q =, and Hamilton s equations are given by q = p ml, ṗ = mgl sinq. 3a 3b For simplicity, we assume tat m = l = g =, and consider te initial conditions q =.5, p =. We compare te simulations obtained by SVI, SC, and te 4t-order symplectic Runge Kutta SRK metod. Figures 9 and provides a comparison of te trajectories in pase space and te energy error, respectively. We can see tat te SVI and SRK, wic are bot symplectic, preserve te pase area and energy of planar pendulum very well, but a drift is observed in bot te pase trajectory and te energy error wen using SC, wic is consistent wit te fact tat te metod is not symplectic. Table 6 provides a comparison of te computational cost of eac metod. In particular, we observe tat te SVI acieves iger accuracy at a lower computational cost compared to te 4t-order SRK metod, and wile it costs more tan te SC metod, it acieves muc better long-time accuracy of te pase trajectory and te energy error. 7
.5.5.5 p p p SVI EXACT.5.5.5 q SC EXACT.5.5.5 q SRK4 EXACT.5.5.5 q Figure 9: Planar pendulum, pase wit time-step =.5, and total time T = for SVI, SC bot wit 4 Cebysev points and 4t-order symplectic Runge Kutta metod. energy error 5 SC SVI SRK4 5 3 4 5 6 7 8 9 time Figure : Planar pendulum, energy beavior wit time-step =.5, and total time T = for SVI and SC bot wit 4 Cebysev points and 4t-order symplectic Runge Kutta metod. Table 6: Computational cost of SRK, SVI and SC SCHEME CPU-TIME STEP-SIZE TOTAL TIME TOL SRK4 3.73s.5 4 SVI 4.94s.5 4 SC.85s.5 4 3.3.3. Duffing oscillator Te Duffing equation is a nonlinear second-order differential equation, wic is given by q + δ q + αq + βq 3 = γ cosωt were te numbers δ, α, β, γ, and ω are prescribed constants. It describes a nonlinear oscillator wit damping tat is periodically forced, and δ controls te damping, α controls te stiffness, β controls te nonlinearity in te restoring force, γ controls te amplitude of te periodic driving force, and ω controls te frequency of te periodic driving force. Since we are concerned wit te case were te Duffing equation is Hamiltonian, we consider te undamped and unforced case, were γ = δ =. It is easy to ceck tat te Lagrangian is given by Lq, q = q αq 4 βq4, and te Hamiltonian is given by Hq, p = p + αq + 4 βq4. We compare te spectral variational integrator, Cebysev collocation metod and 6t-order symplectic Runge Kutta metod, wit parameters α =, β = 8/3 and initial condition q =, q =. 8
.5..5..5..5.5.5.95.9.95.9.95.9.85.85.85.8.8.8.5.75.7.5.75.7.5.75.7.65.65.65.6.6.7.8.9..6.6.7.8.9..6.6.7.8.9. p p p.5.5.5 SVI.5.5.5.5.5 q.5.5.5.5.5 q SC SRK6.5.5.5.5.5 q Figure : Duffing oscillator, comparison of pase wit time-step =.6, and total time T = 5 for SVI, SC bot wit 6 Cebysev points and 6t-order symplectic Runge Kutta metod. Figure provides a comparison of te pase trajectory obtained using SVI, SC, and SRK. Under magnification, we see tat te pase trajectory of SVI and SRK is very regular, wereas te pase trajectory of SC is muc less regular. Te energy error is compared in Figure, and te computational cost comparison is given in Table 7. We can see tat SVI acieves significantly iger-order energy accuracy tan SRK wile costing less computationally. 4 energy error 6 8 SC SVI SRK6 4 4 6 8 4 6 8 time Figure : Duffing oscillator, comparison of energy beavior wit time-step =.6, and total time T = for SVI, SC bot wit 6 Cebysev points and 6t-order symplectic Runge Kutta metod. Table 7: Computational cost of SRK, SVI and SC SCHEME CPU-TIME STEP-SIZE TOTAL TIME TOL SRK6 86.98s.6 4 SVI 39.8s.6 4 SC 4.35s.6 4 3.3.4. Kepler two-body problem Now, we compare te spectral variational integrator and Cebysev collocation metod wen applied to te Kepler two-body problem. Figures 3, 4, 5 provide a comparison of te orbital trajectory, and te evolution of te energy and momentum. We can see tat SVI preserves bot energy and momentum very well, wile te energy and momentum drift wit SC. Figures 6, 7, 8, 9, give a comparison of te error in te configuration, energy, and momentum for Kepler two-body problem under N-refinement and -refinement. From te error plots, it is not ard to see tat SVI is overwelmingly superior to SC in te accuracy of te trajectory in configuration space, energy and momentum, wen using te same number of Cebysev points and te same time-step. We also find tat spectral variational integrators 9
7 converge faster and are more stable tan spectral-collocation, especially wit large time-step See Table 8, Table 9..8 SVI EXACT.8 SC EXACT.6.6.4.4.. q q...4.4.6.6.8.8.5.5.5 q.5.5.5 q Figure 3: Kepler two body, comparison of orbit, wit eccentricity e =.5, time-step =., and total time T = for SVI and SC bot wit 6 Cebysev points..498.499 SC energy.5.5.5 4 6 8 4 6 8 time.5.5 SVI energy.5.5.5 4 6 8 4 6 8 time Figure 4: Kepler two body, comparison of energy, wit eccentricity e =.5, time-step =., and total time T = for SVI and SC bot wit 6 Cebysev points. momentum.8664.866.866.8658 SC.8656 4 6 8 4 6 8 time momentum.866.866.866.866 SVI.866 4 6 8 4 6 8 time Figure 5: Kepler two body, comparison of momentum, wit eccentricity e =.5, time-step =., and total time T = for SVI and SC bot wit 6 Cebysev points.
4 7. N.3 N SVI SC 4 7. N.3 N SVI SC L error of q 6 8 L error of q 6 8 4 4 6 5 Cebysev Points per step N 6 5 Cebysev Points per step N Figure 6: Kepler two body, L error of q and q over single step = 5 wit N-refinement 4 6. N SVI SC 4 6. N 3.4 N SVI SC L error of momentum 6 8 L error of energy 6 8 4 4 6 5 Cebysev Points per step N 6 5 Cebysev Points per step N Figure 7: Kepler two body, L error of momentum and energy over single step = 5 wit N-refinement 4.5 4 5 6 4 8 8 SVI,N= SC,N= SVI,N=4 SC,N=4 SVI,N=6 SC,N=6 4 6.5 3 5 5 7 7 SVI,N= SC,N= SVI,N=4 SC,N=4 SVI,N=6 SC,N=6 6 L error of q 8 L error of q 8 4 4 6 6 step size 3 4 8 step size 3 4 Figure 8: Kepler two body, L error of q and q wit -refinement. Here, we use N in te legend to denote te number of Cebysev points used to construct te metod.
L error of momentum 4 6 8 SVI, N= SC, N= SVI, N=4 SC, N=4 SVI, N=6 SC, N=6 4 6 step size 3 4 Figure 9: Kepler two body, L error of momentum wit -refinement. Here, we use N in te legend to denote te number of Cebysev points used to construct te metod. 4 SVI, N= SC, N= SVI, N=4 SC, N=4 SVI, N=6 SC, N=6 L error of energy 6 8 4 6 step size 3 4 Figure : Kepler two body, L error of energy wit -refinement. Here, we use N in te legend to denote te number of Cebysev points used to construct te metod. N 5 5 SCHEME SC SVI SC SVI SC SVI SC SVI SC SVI ITERATION max total max total max total max total max total max total max total max total max total max total.5 - - 5 8 7 7 68 7 76 7 76 7 8 7 8 7 86 7 85 - - - - 87 9 735 9 79 8 695 8 696 8 695 8 697 8 697 - - - - 37 739 485 476 46 45 44 45 47 5 - - - - - - - - - - 5 79 8 3 4 4 4 6 7 39 8 - - - - - - - - - - - - - - 3 5 35 536 9 5 Table 8: Kepler problem, number of iterations wit eccentricity e=.. 4. Sooting-based variational integrators from spectral-collocation metods Spectral-collocation metods are well-known for teir iger accuracy and exponential rates of convergence. Variational integrators are noted for teir structure-preserving properties. Our aim in tis section is to construct a spectral-collocation variational integrator SCVI tat combines te benefits of tese two numerical metods. To be specific, we discuss ow one can construct a variational integrator
N 5 5 SCHEME SC SVI SC SVI SC SVI SC SVI SC SVI ITERATION max total max total max total max total max total max total max total max total max total max total.5 - - - - 3 5 33 9 77 9 7 9 7 9 7 9 74 9 74 - - - - - - 4 834 3 85 764 77 76 765 76 - - - - - - 9 674 - - 4 54 7 535 3 48 4 54 8 49 5 - - - - - - - - - - 5 79 - - 65 433 - - 4 67 Table 9: Kepler problem, number of iterations wit eccentricity e=.5. tat is based on a spectral-collocation metod, tat will acieve geometric rates of convergence under N refinement. It sould be noted tat in tis paper we will restrict our attention to configuration spaces Q tat are vector spaces. A generalization of spectral-collocation variational integrators for mecanical system on Lie groups will be described in our later work. 4.. Outline of approac Te proposed approac is based on constructing an approximation of te exact discrete Lagrangian given in 6, were it is expressed in terms of te action integral evaluated on te solution of te Euler Lagrange boundary-value problem. Tis was te approaced taken in te sooting-based variational integrator tat was introduced in [], but in order to get ig order of accuracy, one needed to ave numerous quadrature points, and since tis approac did not assume tat te one-step metod used to construct te variational integrator provided access to a piecewise continuous approximation of te solution in te interior of te timestep, te approximations at te quadrature points were obtained by repeatedly applying te underlying one-step metod. In tis section, we use te fact tat a spectral-collocation metod also provides a continuous approximation of te solution in te interior of te timestep, so we can use tat to construct our computable discrete Lagrangian, and tereby reduce te computational burden of constructing iger-order variational integrators. 4.. Construction of spectral-collocation variational integrators 4... Spectral-collocation discrete Lagrangian Given spectral-collocation metod Ψ s : T Q T Q and a numerical quadrature formula w i, τ i m i=, were w i are te quadrature weigts and τ i [, ] are te quadrature nodes, we can construct te spectral-collocation discrete Lagrangian as follows L d q k, q k+ ; = m s w i L q v kl v,s τ i, s qk v l v,s τ i. 33 i= v= were qk v, v =,..., s are obtained from te given spectral-collocation solution of te Euler Lagrange boundary-value problem. Te spectral-collocation solution of te Euler Lagrange boundary-value problem is defined in two stages, we first solve for te ṽ k tat satisfies π Q Φ s q k, ṽ k = q k+, ten te qk v, v =,..., s are cosen so s v= qv k l v,st is consistent wit te initial condition q k, ṽ k and satisfies te Euler Lagrange second-order differential equation at te collocation points. 4... Order of accuracy of te spectral-collocation discrete Lagrangian For mecanical systems, te Euler Lagrange equation is generally a second-order nonlinear differential equation, and it is a standard result in te numerical analysis of te sooting metod for nonlinear problems [5] tat te approximation error in te solution of a boundary-value problem is bounded by te sum of two terms: 3 v=
i te global error of te spectral-collocation metod applied to te initial-value problem; ii te error associated wit te rate of convergence of te nonlinear solver. Te order analysis of te sooting-based discrete Lagrangian depends mainly on te global approximation properties of te sooting solution of two-point boundary-value problems and te accuracy of te quadrature formula. Te analysis of refinement for sooting-based variational integrators was developed in Teorem of [], wic we state ere. Teorem 4.. Teorem of [] Given a p-t order accurate one-step metod Ψ, a q-t order accurate quadrature formula, and a Lagrangian L tat is Lipscitz continuous in bot variables, te associated sooting-based discrete Lagrangian as order of accuracy minp, q. Tis, togeter wit Teorem.3. of [4], wic is te basis of variational error analysis, establises tat te order of accuracy of te variational integrator generated by a sooting-based discrete Lagrangian is minp, q. 4..3. Geometric convergence of te spectral-collocation discrete Lagrangian We now prove tat te sooting-based variational integrator based on spectral-collocation is geometrically convergent. We first cite Teorem 3. of [] wic extends variational error analysis to te case of geometric convergence of variational integrators. Teorem 4.. Teorem 3. of [] Given a regular Lagrangian L and corresponding Hamiltonian H, te following are equivalent for a discrete Lagrangian L N d q, q : tere exist a positive constant K, were K <, suc tat te discrete Hamiltonian map for L N d q, q as error OK s, tere exists a positive constant K, were K <, suc tat te discrete Legendre transforms of L N d q, q ave error OK s, 3 tere exists a positive constant K, were K <, suc tat L N d q, q approximates te exact discrete Lagrangian L E d q, q, wit error OK s. Wit tis result in mind, we state a teorem about te extent to wic a spectral-collocation discrete Lagrangian approximates te exact discrete Lagrangian. Teorem 4.3. Given a sequence of spectral-collocation metods Ψ N wit error bounded by C A K N A, for some constants C A, K A < tat are independent of N, a sequence of quadrature rules G N f = mn j= b j N fc jn ftdt, suc tat te quadrature error is bounded by C gk N g, for some constants C g, K g < tat are independent of N, and a Lagrangian L tat is Lipscitz continuous in bot variables, te associated spectral-collocation discrete Lagrangian L N d as an error bounded by CK N for some constants C, K < tat are independent of N. Proof. A converged sooting solution q k,k+, ṽ k,k+, associated wit a geometrically convergent spectralcollocation metod Ψ N, approximates te exact solution q k,k+, v k,k+ of te Euler Lagrange boundaryvalue problem wit te following global error: q k,k+ d i q k,k+ d i C A K N A, v k,k+ d i ṽ k,k+ d i C A K N A 4
If te numerical quadrature formula is geometrically convergent, ten L E d q k, q k+ L N d q k, q k+ k+ = Lq k,k+ t, v k,k+ tdt m w i Lq k,k+ d i, v k,k+ d i k i= + m w i Lq k,k+ d i, v k,k+ d i m w i L q k,k+ d i, ṽ k,k+ d i i= i= k+ Lq k,k+ t, v k,k+ tdt m w i Lq k,k+ d i, v k,k+ d i k i= m + w i Lq k,k+ d i, v k,k+ d i m w i L q k,k+ d i, ṽ k,k+ d i i= i= C g Kg N + m Lqk,k+ w i d i, v k,k+ d i L q k,k+ d i, ṽ k,k+ d i C g K N g + i= m w i K L C A KA N i= = C g K N g + K L C A K N A C g + K L C A K N were K = maxk g, K A, and we used te quadrature error, consistency of te quadrature rule, te error estimates on te sooting solution, and te assumption tat L is Lipscitz continuous wit Lipscitz constant K L. Wile we ave primarily discussed numerical quadrature formulas tat only depend on te integrand, one could consider more general quadrature formulas tat depend on derivatives of te integrand, suc as Gauss Hermite quadrature. As to te finite-dimensional function space, we can also consider trigonometric polynomials, wavelets, etc. Different combinations of quadrature formulas and finitedimensional function spaces may led to effective integrators for specific classes of problems. 4..4. Implementation issues of multi-interval scemes In tis section, we describe te numerical implementation of a spectral-collocation variational integrator for mecanical systems wit Lagrangian L. In practice, we combine te implicit discrete Euler Lagrange equations p k = D L d q k, q k+ ;, p k+ = D L d q k, q k+ ; 5
togeter wit te spectral-collocation metod 8 to yield a set of nonlinear equations, A I m vecq = vecf Q, AQ + a q k a v k T Aa q k T, q k = q k, qk s = qk+ = q k+, m [ p k = w i l,sτ i L s q v q kl v,s τi, p k+ = i= m i= w i [ l s,sτ i L q v= s v= q v kl v,s τi, s v= s v= q v k l v,s τi + l,s τ i L q q v k l v,s τi + l s,s τ i L q s v= s v= q v kl v,s τi, q v kl v,s τi, 34a 34b 34c s qk v l ] v,s τi, v= 34d s qk v l ] v,s τi, were Q = qk, q k,..., qs k. Given an initial condition q k, p k, we can obtain Q = qk, q k,..., qs k by solving equations 34a 34b 34d wit a nonlinear root finder, suc as te Newton metod, ten q k+, p k+ can be obtained from 34c 34e. Tis procedure is summarized in te diagram below, v= 34e q k, p k 34a34b34d Q = q k, q k,..., qs k 34c34e k k+ q k+, p k+ and te iterative algoritm can be described as follows, Table : Te iterative algoritm of SCVI STEP. coose te number of collocation points s + and quadrature formula w i, τ i m i=. STEP. compute matrix A. STEP3. coose initial guess of te collocation points Q = qk, q k,..., qs k and v k, a good initial guess for vk can be obtained by inverting te continuous Legendre transformation p = L/ v. STEP4. compute te rigt and side of 34a,34d and teir Jacobians. STEP5. update Q = qk, q k,..., qs k and v k by performing a nonlinear rootfinding iteration for 34a,34d, until max Q i+ Q i L, P i+ P i L < T OL. STEP6. compute q k+, p k+ by 34c and 34e. STEP7. k k +, repeat STEP3 to STEP6. Using te Legendre transformation, te above system of nonlinear equations can also be expressed 6
in terms of te generalized coordinates and momenta q, p on te cotangent bundle T Q, A I m vecq = vecf Q, AQ + a q k a v k T Aa q k T, q k = q k, qk+ = q k+, m [ p k = w i p k+ = L p i= m [ b i i= l,sτ i L q l s,sτ i L q s qkl v v,s τi, pj v= 4.3. Numerical examples 35a 35b 35c s ] qkl v v,s τi, pi + p i l,s τ i, 35d v= s ] qkl v v,s τi, pi + p i ls,s τ i, 35e v= s qk v l v,s τ i =, j =,..., m. 35f v= In tis part, we explicitly derive te numerical metod for te proposed spectral-collocation variational integrator SCVI in te case of interpolation points and quadrature points. To verify te effectiveness of te SCVI numerical sceme, we compute te solution of planar pendulum and Kepler two-body problem. In te nonlinear solves used to implement te SCVI, we compare te maximum pointwise errors, max Q i+ Q i L, P i+ P i L and set te tolerance to and te maximum iteration count is set to. 4.3.. Planar pendulum Consider te ideal model of a planar pendulum 3. For simplicity, we let te mass m =, massless rod lengt l = and gravitational acceleration g =. Ten, te Lagrangian is given by, Lq, q = ml q Te corresponding Euler-Lagrange equation is, + mgl cosq = q + cosq, q + sin q =. Here, we coose two Cebysev points x =, x = and te two-point Gauss quadrature formula w i, τ i i= were w = ±; τ = ±. 3 Ten, te approximation of q at te corresponding rescaled quadrature points in te interval [k, k + ] is given by, qd = l, 3 q k + l, 3 q k+ = qd = l, 3 q k + l, 3 q k+ = 7 3 3 3 + 3 q k + 6 3 + 3 q k + 6 6 3 3 6 q k+. q k+.
From, we can obtain te first-order Cebysev differential matrix in te interval [, ] based on Cebysev points x =, x =, [ ] D = Ten, te first-order Cebysev differential matrix in te interval [k, k + ] can be given by, à = [ D :, : =, ]. We can partition te matrix à into à = [a, A]. Combined wit 34b, 34a as te form, q k+ = sinq k+ v k q k, 36 and 34d can be calculated by using 3, were [ à k = [A k, A k ] = w n l, τ n l, τ n, n= n= G k = w n l, τ n sin l, τ n q k + l, τ n q k+ n= = 3 + 3 3 + 3 3 3 sin q k + q k+ 6 6 From tis, 34d can be rewritten as, ] [ w n l, τ n l, τ n = 3 3, sin ], 3 3 6 q k + 3 + 3 q k+. 6 A k q k+ + A kq k + G k + p k =. 37 So, we can solve for v k and q k+ using 36 and 37. Ten, we can calculate p k+ from 34e. Coosing te initial value q =.5, p =, Figure sows te pase trajectories of te pendulum system, wic are computed using te two-point spectral-collocation variational integrator SCVI constructed above, and te Cebysev collocation SC metod, also wit collocation points. Figure sows te corresponding energy errors of tese two metods. From te numerical results, we can see tat SCVI preserves te pase space area and energy very well, as one would expect from a symplectic integrator, wereas te Cebysev collocation metod performs muc more poorly in terms of preserving te pase area and energy. In particular, te Cebysev collocation metod exibits a decay of te trajectory in pase space. 8
.5.4 SCVI EXACT.5.4 SC EXACT.3.3.... p p.....3.3.4.4.5.5.5 q.5.5.5 q Figure : Planar pendulum. Comparison of pase trajectories. Left figure: time-step =.5, collocation points, quadrature points, and total time T = 6π; Rigt figure: time-step =.5, collocation points, and total time T = 6π. energy 4 6 8 4 6 8 4 6 8 time Figure : Comparison of energy of planar pendulum problem computed using SCVI wit collocation points, quadrature points and SC wit collocation points. Time-step =.5. SC SCVI 4.3.. Kepler two-body problem We test te SCVI numerical metod 34 on te Kepler problem wic as already been described in Section 3.. Te system as not only te total energy Hq, p as a first integral, but also te angular momentum Mq, q, p, p = q p q p. For te system 4 we coose, wit e =.5, te initial value q =.5, q =, v =, v = 3. Tis implies tat H =.5, and M = 3/4. Figure 3 sows te orbit of Kepler problem wen using SCVI wit collocation points. We run te numerical program for periods. In order to maintain te visibility of te trajectory in te figure, we plot trajectory segments from te beginning, middle, and end of te full trajectory. 9
.5 step to 5.5 step 9895 to 75.5 step 39785 to 4.5.5.5 q q q.5.5.5.5.5.5.5.5 q.5.5.5.5.5 q.5.5.5.5.5 q Figure 3: Orbit of Kepler problem computed using SCVI wit collocation points. Time-step = π/, and total time T = π. In Figure 4, 5, 6, we compare te orbit, momentum and energy of te Kepler problem, wen simulated using SCVI wit collocation points and Cebysev collocation metod wit 3 collocation points te two-point Cebysev collocation metod is not stable wen we set te time-step =.. In te left column of Figure 4, we sow te comparison of te orbit over 3 periods and in te rigt column of Figure 4, te orbit of te last period are given. Te column of subfigures on te rigt sow te last part of te trajectory, over one orbital period of te exact solution. It is clear tat te period of te system does not cange wen using te SCVI metod, but te orbital period srinks by a factor of almost tree wen using te Cebysev collocation metod..5 SCVI EXACT.5 SCVI EXACT q q.5.5.5.5.5.5 q.5.5.5.5 q.5 SC EXACT.5 SC EXACT q q.5.5.5.5.5 q.5.5.5 q Figure 4: Kepler problem. Comparison of orbit computed using SCVI wit collocation points and SC wit 3 collocation points. Time-step =., and total time T = 6π. Te second column of figures sow te last part of te trajectory for te duration of one orbital period. 3
.9 Comparison of momentum SC SCVI.85.8 momentum.75.7.65 5 5 5 3 t Figure 5: Kepler problem. Comparison of momentum computed using SCVI wit collocation points and SC wit 3 collocation points. Time-step =., and total time T = 6π..5 Comparison of energy SC total energy SC kinematic SC potential SCVI total energy SCVI kinematic SCVI potential.5 energy.5.5.5 5 5 5 3 t Figure 6: Kepler problem. Comparison of energy computed using SCVI wit collocation points and SC wit 3 collocation points. Time-step =., and total time T = 6π. Figure 7 sows te pase trajectories of te Kepler problem computed using different numerical metods including a symplectic Runge Kutta metod, a spectral-collocation variational integrator, Störmer Verlet and a Cebysev collocation metod. Here, we set te time-step =.3 for te symplectic Runge-Kutta metod, spectral-collocation variational integrator, and Cebysev collocation metod. Te time-step for Störmer Verlet is =.5. As is sow, all te metods we used preserve te area of pase space well, except for te Cebysev collocation metod, wic is te only non-symplectic integrator considered ere. 3
p a SRK4 b SCVI wit 4 collocation points.5.5.5.5.5.5 p.5.5.5.5.5 q.5.5.5.5.5 q p c Stormer Verlet d SC wit 4 collocation points.5.5.5.5.5.5 p.5.5.5.5.5 q.5.5.5.5.5 q Figure 7: Pase trajectories for te Kepler two-body problem. Figure 8 presents a comparison of te orbits computed using SCVI wit 9 Cebysev points and 5, 6, 7 Gauss quadrature points, from left to rigt. Figures 9 and 3 present te corresponding momentum and energy beaviors. From te numerical results, we see tat SCVI preserves te pase area and momentum, and te energy error remains bounded. It sould be noted tat te leftmost subfigure corresponding to 5 collocation points is exibiting precession, wic is wy te total trajectory sweeps out an annulus. Te accuracy of SCVI is determined by bot te coice of collocation points and quadrature points. If we fix te number of Cebysev points, te SCVI acieves iger-order accuracy as we increase te number of quadrature points, at least until te quadrature rule is sufficiently accurate to resolve te action integral sufficiently..5.8.6.8.6.5.4..4. q q q.5..4..4 SCVI_C9G5 EXACT.5.5.5.5.5 q.6.8 SCVI_C9G6 EXACT.5.5.5 q.6.8 SCVI_C9G7 EXACT.5.5.5 q Figure 8: Two-body Kepler problem. Time-step =.3, and total time T = 4π. Comparison of orbit of spectralcollocation variational integrator SCVI wit 9 collocation points, 5, 6, 7 quadrature points from left to rigt. 3
4 momentum momentum 5 momentum 6 8 SCVI_C9G5 3 5 5 period SCVI_C9G6 5 5 5 period SCVI_C9G7 5 5 period Figure 9: Two-body Kepler problem.time-step =.3, and total time T = 4π. Comparison of momentum of spectral-collocation variational integrator SCVI wit 9 collocation points, 5, 6, 7 quadrature points from left to rigt..5 3 4 4 5 energy.7 energy 5 energy 6.9 SCVI_C9G5 5 5 period 6 SCVI_C9G6 7 5 5 period 7 SCVI_C9G7 8 5 5 period Figure 3: Two-body Kepler problem. Time-step =.3, and total time T = 4π. Comparison of energy error of spectral-collocation variational integrator SCVI wit 9 collocation points, 5, 6, 7 quadrature points from left to rigt. 5. Conclusions and future directions In tis paper, we present two general tecniques for constructing variational integrators tat are spectrally accurate. One is based on a Galerkin construction and te oter is based on using te spectral-collocation metod to solve te Euler Lagrange boundary-value problem. Metods based on tese two approaces are tested on several classical Hamiltonian systems, and teir performance relative to oter metods is studied troug a series of numerical experiments. From te comparison of Galerkin spectral variational integrators and spectral-collocation metods, we observe te following: i Galerkin spectral variational integrators partially inerit te computational efficiency of spectral metods and sow better stability property tan Cebysev collocation metods wen using large time-steps, and compare very favorably to symplectic Runge Kutta metods in terms of computational efficiency. ii Galerkin spectral variational integrator is more accurate in pase, momentum and energy tan Cebysev collocation metod wen coosing te same number of collocation points and te same time-step. iii Bot Galerkin spectral variational integrators and symplectic Runge Kutta metods are pase and momentum preserving and exibit good long-term energy stability. In contrast, drifts in te pase and momentum are observed wen using te Cebysev collocation metod. Additionally, we provide a general metod to convert any spectral-collocation metod to its corresponding sooting-based variational integrator, were te existing tecniques from approximation teory, numerical quadrature, and te spectral metod are combined systematically. Anoter important aspect is te manner in wic vectorization of te numerical metod allows one to efficiently implement te spectral-collocation variational integrator. Numerical experiments demonstrate tat te sootingbased variational integrators from spectral-collocation metods are symplectic, momentum-preserving 33
and exibit excellent energy beavior. Like its Galerkin spectral variational integrator counterpart, tis new numerical metod also partially inerits te computational efficiency of te underlying Cebysev collocation metod. Bot classes of spectrally-accurate variational integrators provide compelling options tat combine computational efficiency wit geometric structure-preservation. Our future work will focus on extending te syntesis of variational integrators and spectral-collocation metods to Hamiltonian PDEs and systems tat evolve on Lie groups and omogeneous spaces. Acknowledgements Te researc of YQL was conducted in te matematics department at University of California, San Diego. YQL was supported by te graduate scool of Harbin Institute of tecnology. ML was supported in part by NSF Grants CMMI-9445, DMS-6597, CMMI-334759, DMS-3453, DMS-479, and NSF CAREER Award DMS-687. References [] N. Bou-Rabee and H. Owadi. Stocastic variational integrators. IMA J. Numer. Anal., 9: 4 443, 9. [] N. Bou-Rabee and H. Owadi. Long-run accuracy of variational integrators in te stocastic context. SIAM J. Numer. Anal., 48:78 97,. [3] W. L. Briggs and V. E. Henson. Te DFT: An Owner s Manual for te Discrete Fourier Transform. Society for Industrial and Applied Matematics SIAM, Piladelpia, PA, 995. [4] J. C. Butcer. Implicit Runge-Kutta processes. Mat. Comp., 8:5 64, 964. [5] J. C. Butcer. A stability property of implicit Runge Kutta metods. BIT Numerical Matematics, 54:58 36, 975. [6] J. C. Butcer. Numerical metods for ordinary differential equations. Jon Wiley & Sons, Ltd., Cicester, second edition, 8. [7] B. L. Ele. Hig order A-stable metods for te numerical solution of systems of D.E. s. BIT Numerical Matematics, 8:76 78, 968. [8] A. Farrés, J. Laskar, S. Blanes, F. Casas, J. Makazaga, and A. Murua. Hig precision symplectic integrators for te Solar System. Celestial Mec. Dynam. Astronom., 6:4 74, 3. [9] B. Gladman, M. Duncan, and J. Candy. Symplectic integrators for long-term integrations in celestial mecanics. Celestial Mec. Dynam. Astronom., 53: 4, 99. [] E. Hairer and G. Wanner. Solving ordinary differential equations. II, volume 4 of Springer Series in Computational Matematics. Springer-Verlag, Berlin, second edition, 996. Stiff and differentialalgebraic problems. 34
[] E. Hairer, C. Lubic, and G. Wanner. Geometric numerical integration, volume 3 of Springer Series in Computational Matematics. Springer-Verlag, Berlin, second edition, 6. Structurepreserving algoritms for ordinary differential equations. [] J. Hall and M. Leok. Spectral variational integrators. Numerisce Matematik, 34:68 74, 5. [3] E. R. Jonson and T. D. Murpey. Scalable variational integrators for constrained mecanical systems in generalized coordinates. IEEE Transaction on Robotics, 56:49 6, 9. [4] N. Kanyamee and Z. Zang. Comparison of a spectral collocation metod and symplectic metods for Hamiltonian systems. International Journal of Numerical Analysis and Modeling, 8:86 4,. [5] H. B. Keller. Numerical metods for two-point boundary value problems. Dover Publications, Inc., New York, 99. Corrected reprint of te 968 edition. [6] M. Kobilarov and J. E. Marsden. Discrete geometric optimal control on Lie groups. IEEE Transaction on Robotics, 74:64 655,. [7] J. D. Lambert. Numerical metods for ordinary differential systems: Te initial value problem. Jon Wiley & Sons, Ltd., Cicester, 99. [8] T. Lee, N. H. McClamroc, and M. Leok. Optimal attitude control for a rigid body wit symmetry. Proc. American Control Conf., pages 73 78, 7. [9] M. Leok. Generalized Galerkin variational integrators: Lie group, multiscale, and pseudospectral metods. preprint, arxiv:mat.na/5836, 4. [] M. Leok and T. Singel. General tecniques for constructing variational integrators. Frontiers of Matematics in Cina, 7:73 33,. [] M. Leok and T. Singel. Prolongation-collocation variational integrators. IMA J. Numer. Anal., 33:94 6,. [] A. Lew, J. E. Marsden, M. Ortiz, and M. West. Asyncronous variational integrators. Arc. Ration. Mec. Anal., 67:85 46, 3. [3] W. J. Liu, B. Y. Wu, and J. B. Sun. Some numerical algoritms for solving te igly oscillatory second-order initial value problems. Journal of Computation Pysics, 76:35 5, 4. [4] J. E. Marsden and M. West. Discrete mecanics and variational integrators. Acta Numer., : 357 54,. [5] J. E. Marsden, S. Pekarsky, and S. Skoller. Discrete Euler-Poincaré and Lie-Poisson equations. Nonlinearity, 6:647 66, 999. [6] S. Ober-Blöbaum and N. Saake. Construction and analysis of iger order Galerkin variational integrators. Advances in Computational Matematics, 4. 35
[7] G. W. Patrick, R. J. Spiteri, W. Zang, and C. Cuell. On converting any one-step metod to a variational integrator of te same order. 7t International Conference on Multibody systems, Nonlinear Dynamics, and Control, 4:34 349, 9. [8] J. M. Sanz-Serna. Runge Kutta scemes for Hamiltonian systems. BIT Numerical Matematics, 84:877 883, 988. [9] W.-H. Steeb. Problems and solutions in introductory and advanced matrix calculus. World Scientific Publising Co. Pte. Ltd., Hackensack, NJ, 6. [3] J. Timmermann, S. Kattab, S. Ober-Blöbaum, and A. Träctler. Discrete mecanics and optimal control and its application to a double pendulum on a cart. Proc. of te 8t IFAC World Congress, 8:99 6,. [3] L. N. Trefeten. Spectral metods in MATLAB, volume of Software, Environments, and Tools. Society for Industrial and Applied Matematics SIAM, Piladelpia, PA,. [3] L. N. Trefeten. Approximation teory and approximation practice. Society for Industrial and Applied Matematics SIAM, Piladelpia, PA, 3. 36