Hamel's Formalism and Variational Integrators on a Sphere
Total Page:16
File Type:pdf, Size:1020Kb
51st IEEE Conference on Decision and Control December 10-13, 2012. Maui, Hawaii, USA Hamel’s Formalism and Variational Integrators on a Sphere Dmitry V. Zenkov, Melvin Leok, and Anthony M. Bloch Abstract— This paper discusses Hamel’s formalism and its The paper is organized as follows. Hamel’s formalism applications to structure-preserving integration of mechanical and its discretization are briefly discussed in Sections II systems. It utilizes redundant coordinates in order to elim- and III. The dynamics of a spherical pendulum is reviewed inate multiple charts on the configuration space as well as nonphysical artificial singularities induced by local coordinates, in Section IV. The discrete model for the pendulum based on while keeping the minimal possible degree of redundancy and Hamel’s formalism, its comparison to some other discretiza- avoiding integration of differential-algebraic equations. tion techniques, and simulations are given in Sections V, VI, and VII. I. INTRODUCTION This paper introduces a new variational integrator for a II. LAGRANGIAN MECHANICS spherical pendulum. The configuration space for this pendu- A. The Euler–Lagrange Equations lum is a two-dimensional sphere. Calculations in spherical A Lagrangian mechanical system is specified by a smooth coordinates are not a good option because of unavoidable manifold Q called the configuration space and a function artificial singularities introduced by these coordinates at the L : TQ ! R called the Lagrangian. In many cases, poles. In addition, the topology of a sphere makes it impos- the Lagrangian is the kinetic minus potential energy of the sible to use global singularity-free intrinsic coordinates. system, with the kinetic energy defined by a Riemannian In order to avoid the issues mentioned above, an integrator metric and the potential energy being a smooth function on that utilizes the interpretation of a sphere as a homogeneous the configuration manifold Q. If necessary, non-conservative space was introduced in [15]. This integrator performs very forces can be introduced (e.g., gyroscopic forces that are well, but has a somewhat large degree of redundancy. This represented by terms in L that are linear in the velocity), but paper targets the development of an integrator whose perfor- this is not discussed in detail in this paper. mance is similar to that of the integrator in [15] and whose In local coordinates q = (q1; : : : ; qn) on the configuration redundancy is the minimum possible. space Q we write L = L(q; q_). The dynamics is given by Both the present paper and [15] interpret the pendulum the Euler–Lagrange equations as a rotating rigid body. The algorithm introduced in [15] is d @L @L based on the evaluation of the rotation matrix that represents = ; i = 1; : : : ; n: (1) the attitude for this body. The key feature of the dynamics dt @q_i @qi utilized in the present paper is that, in order to capture the These equations were originally derived by Lagrange [14] orientation of a rigid body, it is sufficient to evaluate just in 1788 by requiring that simple force balance F = ma one column of that rotation matrix. The resulting equations be covariant, i.e. expressible in arbitrary generalized coordi- of motion are interpreted as Hamel’s equations written in nates. A variational derivation of the Euler–Lagrange equa- redundant coordinates. tions, namely Hamilton’s principle (also called the principle The general exposition of discrete Hamel’s formalism will of critical action), came later in the work of Hamilton [12] be a subject of a future publication. Here we demonstrate and [13] in 1834/35. For more details, see [4], [18], and the usefulness of some of this formalism by constructing Theorem 2.1 below. an integrator for a spherical pendulum that is energy- and momentum-preserving. The calculations are carried out in B. The Hamel Equations the Cartesian coordinates of the three-dimensional Euclidean In this paragraph we briefly discuss the Hamel equations. space. This allows one to avoid singularities and/or multiple The exposition follows paper [5]. coordinate charts that are inevitable for calculations on a In many cases the Lagrangian and the equations of motion sphere. Hamel’s approach allows one, among other things, have a simpler structure when written using velocity compo- to represent the dynamics in such a way that the length nents measured against a frame that is unrelated to system’s constraint becomes unnecessary. Thus, one avoids the well- local configuration coordinates. An example of such a system known difficulty of numerically solving differential-algebraic is the rigid body. equations. Let q = (q1; : : : ; qn) be local coordinates on the config- uration space Q and ui 2 TQ, i = 1; : : : ; n, be smooth D. V. Zenkov is with the Department of Mathematics, North Carolina independent local vector fields defined in the same coordi- [email protected] State University, Raleigh, NC 27695, USA, 1 M. Leok is with the Department of Mathematics, University of California nate neighborhood. The components of ui relative to the San Diego, La Jolla, CA 92093, USA, [email protected] 1 A. M. Bloch is with the Department of Mathematics, University of In certain cases, some or all of ui can be chosen to be global vector Michigan, Ann Arbor, MI 48109, USA, [email protected] fields on Q. 978-1-4673-2064-1/12/$31.00 ©2012 IEEE 7504 j j basis @=@q will be denoted i ; that is, on the space of curves in Q connecting qa to qb on the @ interval [a; b], where we choose variations of the curve u (q) = j(q) ; q(t) that satisfy δq(a) = δq(b) = 0. i i @qj (ii) The curve q(t) satisfies the Euler–Lagrange equa- where i; j = 1; : : : ; n and where summation on j is under- tions (1). stood. (iii) The curve (q(t); ξ(t)) is a critical point of the functional Let ξ = (ξ1; : : : ; ξn) 2 n be the components of the R Z b velocity vector q_ 2 TQ relative to the basis u1; : : : ; un, i.e., l(q; ξ) dt (7) a q_ = ξiu (q); (2) i with respect to variations δξ, induced by the variations i then δq = η ui(q), and given by i l(q; ξ) := L(q; ξ ui(q)) (3) k k k i j δξ =η _ + cij(q)ξ η : (8) is the Lagrangian of the system written in the local coor- The curve (q(t); ξ(t)) satisfies the Hamel equations dinates (q; ξ) on the tangent bundle TQ. The coordinates (iv) (5) coupled with the equations q_ = ξiu (q): (q; ξ) are Lagrangian analogues of non-canonical variables i in Hamiltonian dynamics. For the proof of Theorem 2.1 and the early development Define the quantities cm(q) by the equations and history of these equations, as well as other variational ij structures associated with Hamel’s equations see [22], [10], m [ui(q); uj(q)] = cij (q)um(q); (4) [5], and [2]. i; j; m = 1; : : : ; n. These quantities vanish if and only if III. THE DISCRETE HAMEL EQUATIONS the vector fields ui(q), i = 1; : : : ; n, commute. Here and A. Discrete Hamilton’s Principle elsewhere, [ · ; · ] is the Jacobi–Lie bracket of vector fields A discrete analogue of Lagrangian mechanics can be on Q. obtained by discretizing Hamilton’s principle; this approach Viewing u as vector fields on TQ whose fiber components i underlies the construction of variational integrators. See equal 0 (that is, taking the vertical lift of these vector fields), Marsden and West [19], and references therein, for a more one defines the directional derivatives u [l] for a function i detailed discussion of discrete mechanics. l : TQ ! by the formula R A key notion is that of the discrete Lagrangian, which is j @l a map Ld : Q×Q ! that approximates the action integral ui[l] = : R i @qj along an exact solution of the Euler–Lagrange equations The evolution of the variables (q; ξ) is governed by the joining the configurations qk; qk+1 2 Q, Hamel equations Z h d L (qk; qk+1) ≈ ext L(q; q_) dt; (9) d @l m @l i q2C([0;h];Q) 0 j = cij m ξ + uj[l]: (5) dt @ξ @ξ where C([0; h];Q) is the space of curves q : [0; h] ! Q with i coupled with equations (2). If ui = @=@q , equations (5) q(0) = qk, q(h) = qk+1, and ext denotes extremum. become the Euler–Lagrange equations (1). In the discrete setting, the action integral of Lagrangian Equations (5) were introduced in [10] (see also [21] for mechanics is replaced by an action sum details and some history). N−1 d X d C. Hamilton’s Principle for Hamel’s Equations S (q0; q1; : : : ; qN ) = L (qk; qk+1); k=0 Let γ :[a; b] ! Q be a smooth curve in the configuration where q 2 Q, k = 0; 1;:::;N, is a finite sequence space. A variation of the curve γ(t) is a smooth map β : k in the configuration space. The equations are obtained by [a; b] × [−"; "] ! Q that satisfies the condition β(t; 0) = the discrete Hamilton’s principle, which extremizes the γ(t). This variation defines the vector field discrete action given fixed endpoints q and q . Taking 0 N @β(t; s) the extremum over q ; : : : ; q gives the discrete Euler– δγ(t) = 1 N−1 @s s=0 Lagrange equations d d along the curve γ(t). D1L (qk; qk+1) + D2L (qk−1; qk) = 0; Theorem 2.1: Let L : TQ ! R be a Lagrangian and for k = 1;:::;N −1. This implicitly defines the update map l : TQ ! R be its representation in local coordinates (q; ξ).