An Introduction to Symplectic Integrators
Total Page:16
File Type:pdf, Size:1020Kb
An Introduction to Symplectic Integrators Keirn Munro [email protected] Abstract We aim to outline some of the basic techniques of numerical integration as it pertains to computing flows of Hamiltonian systems. The method of Symplectic Integrators has gained popularity in recent years as a relatively stable approach to long time simulations of Hamiltonian mechanics, namely pendulum and celestial body problems. The approach makes use of the symplectic structure to move beyond naive analytic techniques and refine existing approaches. Background and Notation Letting (M; !) be a smooth symplectic manifold along with it's 2-form, respectively. Given a Hamiltonian H and a starting point z0, the task at hand is to numerically solve for the flow of XH starting at z0, z(t). The numerical algorithms, or integrators, we will use to do this are those smooth families of diffeomorphisms on M,Ψ: M × R ! M, such that Ψ∆t(z0) = Ψ(z0; ∆t) ≈ z(∆t). To simulate flow, the user iteratively applies Ψ∆t to z0. When we hold ∆t fixed, we may also require that Ψ∆t is a symplectomorphism and shall herein refer to maps of this form as symplectic integrators. We begin first with a result paraphrased from Proposition 5.4.3 in [5]: Proposition (Conservation of Energy): Given a Hamiltonian function H : M ! R and an associated vector field XH with flow 't : M ! M, H ◦ 't is constant in t. Proof. Proceeding by direct computation and letting x 2 M, d H('t(x)) = XH (H)('t0 (x)) dt t0 = dH (XH ('t0 (x))) (1) = − (ιXH ! (XH )) 't0 (x) = −! (XH ;XH ) 't0 (x) = 0 by anti-symmetry establishing the result. ∗ Lemma (Symplectomorphism Flow) Preserving definitions from the previous result, 't (!) = ! Proof. This is an application of Cartan's Magic formula while noting that '0 = Id. d '∗! = L (!) dt t XH = ιXH d! + dιXH ! (2) = dιXH ! since ! is closed = −ddH = 0 1 Since we aim to import everything into computers while keeping things brief, we will be working in 0 Id M = 2n for the duration of this paper. Take our 2-form ! to be represented by the matrix J = R − Id 0 and notice that symplectomorphisms are smooth functions f : M ! M such that (Df)>JDf = J With this language, we rewrite Hamilton's equation as d > (q(t); p(t)) = J rH dt (q(t);p(t)) Let us also define the Poisson bracket for our context: {·; ·} : C1(M) × C1(M) ! R via > ff; gg = !(Xf ;Xg) = (rf)J (rg) Letting DH f = ff; Hg, we once more restate Hamilton's equations: d (q(t); p(t)) = DH dt (q(t);p(t)) Noting that DH = XH is just a change of notation. Before proceeding, we formulate language to gauge accuracy of an integrator, paraphrased from [1]: Definition: An integrator Ψ∆t(z0) is said to be of n-th order approximation of the desired flow z(t) (with n+1 z(0) = z0) if jΨ∆t(z0) − z(∆t)j 2 O(∆t ) as ∆t ! 0. Hamiltonian Splitting As a preliminary strategy for constructing an integrator given a Hamiltonian function H(q; p) and an initial point z0, it is desirable to break H apart into a sum of simpler pieces. Indeed, our strategy will be as follows: Decompose H into a sum of Hamiltonians k X H = Hi i=1 Explicitly compute Ψ∆t;Hi as exact flows, noting that Ψ∆t;Hi = exp (∆tDHi ), and assemble via k Y Ψ∆t := Ψ∆t;Hi i=1 where the product indicates iterated composition. The keen reader will note two things: First, that Ψ∆t is an iterated composition of symplectomorphisms and so is itself a symplectomorphism. Second, Ψ∆t(z0) 6= z(t) in general, for the exp (∆tDHi ) do not commute unless the Lie brackets of the pairs DHi are all 0. We shall table this discussion for later and proceed instead by making things more concrete. Example: A somewhat canonical class of examples occur when H can be expressed as a sum of poten- tial energy V (q) and kinetic energy T (p) (note that each function depends only on one of p; q): H(q; p) = V (q) + T (p) Consider the Hamiltonian H : R2 ! R describing the mathematical pendulum: p2 H(q; p) = − cos(q) 2 2 This function is used in [8] to illustrate a different concept (large time step chaos) than that exhibitted here. p2 Letting H1(q; p) = − cos(q) and H2(q; p) = 2 , we may then compute: 0 1 D = (rH (q; p))> H1 −1 0 1 0 1 sin(q) = −1 0 0 0 = − sin(q) 0 1 D = (rH (q; p))> H2 −1 0 2 0 1 0 = −1 0 p p = 0 So our Ψ∆t;Hi are q q + ∆tp Ψ (q; p) = ; Ψ (q; p) = ∆t;H1 p − ∆t sin(q) ∆t;H2 p and our candidate (symplectic) integrator is q + ∆tp Ψ = Ψ ◦ Ψ = ∆t ∆t;H1 ∆t;H2 p − ∆t sin(q + ∆tp) Given this, and after picking small ∆t, we predict that our integrator will be a good candidate for running a computer simulation on in hopes to illustrate our work so far. While Ψ∆t does not conserve H exactly, it turns out that Ψ∆t is a flow for some associated Hamiltonian and that this other Hamiltonian is close to H. This is by no means a fluke and will be discussed in greater detail shortly. For amusement, we implemented the computed simulation algorithm in Python with a choice of initial point (0; 1:9999) and ∆t = 0:005 (see Appendix for code as well as an illustration). The code prints as well the maximum difference jH(q; p) − H(q0; p0)j at each step. Empirically, running this simulation for over 36; 000 steps resulted in a maximum error of approximately 3:8589 × 10−3 and as well traced out a closed curve of qualitatively similar form to z(t). @T q q + ∆t @p For general V (q);T (p), notice that Ψ∆t;H1 = @V and Ψ∆t;H2 = . The integrator p − ∆t @q p given by their composition as above is known in some literature as the Symplectic Euler method. We can see too that the order observation is true in general by applying Taylor's theorem 3 times: Lemma: The symplectic Euler method is an order 1 integrator. As promised, the following theorem is stated by Yoshida in [8] in reference to the symplectic Euler method: Theorem: The symplectic mapping Ψ∆t exactly describes the time-∆t evolution of an associated Hamil- tonian H~ , which is close to the original Hamiltonian and has the expression of a formal power series in ∆t, 2 3 H~ = H + ∆tG1 + ∆t G2 + ∆t G3 + ::: where H is the original Hamiltonian, and ! 1 @H @H 1 @2H @H 2 @2H @H 2 1 @2H @2H @H @2H @H G = ;G = + ;G = ;::: 1 2 @p @q 2 12 @p2 @q @q2 @p 3 12 @p2 @q2 @q @q2 @p In particular, Ψ∆t conserves H~ above exactly. 3 Moreover, in terms of closeness, Yoshida remarks that if the Symplectic Euler method happens to be of nth order, the associated Hamiltonian has the following form: n n+1 H~ = H + ∆t Gn + O ∆t We remark here that it is due to the theorem above that our example simulation earlier traced out a well behaved and closed curve. Analogous results exist for more general schemes [2]. To push our analysis of Hamiltonians of the form H(q; p) = T (p) + V (q) even further, we attempt to algorithmically construct n-th order approximations. Fixing n, a fruitful strategy is to search for k 2 Z along with constants ci; di for i = 1; : : : ; k such that k ! Y n+1 exp (∆t(DT + DV )) = exp (ci∆tDT ) exp (di∆tDV ) + O(∆t ) i=1 Remember here that we are composing in a setting where order matters: exp (c1∆tDT ) exp (d1∆tDV ) exp (c2∆tDT ) exp (d2∆tDV ) ::: Indeed, for Hamiltonians of this form, k and a collection of (ci; di) have been determined for n ≤ 4. We have seen n = 1 above (k = 1; c1 = d1 = 1) and we list the others here for posterity: n = 2 Stated in Yoshida [8] 1 k = 2; c = c = ; d = 1; d = 0 1 2 2 1 2 n = 3 R. Ruth [7] 7 3 −1 2 −2 k = 3; c = ; c = ; c = ; d = ; d = ; d = 1 1 24 2 4 3 24 1 3 2 3 3 n = 4 H. Yoshida [8] 1 1 1 1 − 2 3 1 −2 3 k = 4; c = c = ; c = c = ; d = d = ; d = 1 4 1 2 3 1 1 3 1 2 1 2 2 − 2 3 2 2 − 2 3 2 − 2 3 2 − 2 3 We would be remiss not to remark from [4] on the slight tweak of the n = 2 method where we shift coefficients and take 1 1 exp ∆tD exp (∆tD ) exp ∆tD 2 V T 2 V This is still of order 2 and is the well enjoyed St¨ormer-Verlet method. Adjoints and Symmetry We remark on a definition found in both [3] and [4]: ∗ −1 Definition: Given an integrator Ψ∆t, we define its adjoint method Ψ∆t to be (Ψ−∆t) . An integrator is ∗ said to be symmetric if Ψ∆t = Ψ∆t Without delay, we remark on the order consistency of this definition as stated in [3] and paraphrased here: Theorem: Given an integrator Ψ∆t approximating a flow z(t), the order of Ψ∆t is equal to the order of ∗ Ψ∆t.