The variational discretizaton of the constrained higher-order Lagrange-Poincar\'e equations

In this paper we investigate a variational discretization for the class of mechanical systems in presence of symmetries described by the action of a Lie group which reduces the phase space to a (non-trivial) principal bundle. By introducing a discrete connection we are able to obtain the discrete constrained higher-order Lagrange-Poincar\'e equations. These equations describe the dynamics of a constrained Lagrangian system when the Lagrangian function and the constraints depend on higher-order derivatives such as the acceleration, jerk or jounces. The equations, under some mild regularity conditions, determine a well defined (local) flow which can be used to define a numerical scheme to integrate the constrained higher-order Lagrange-Poincar\'e equations. Optimal control problems for underactuated mechanical systems can be viewed as higher-order constrained variational problems. We study how a variational discretization can be used in the construction of variational integrators for optimal control of underactuated mechanical systems where control inputs act soley on the base manifold of a principal bundle (the shape space). Examples include the energy minimum control of an electron in a magnetic field and two coupled rigid bodies attached at a common center of mass.


Introduction
Reduction theory is one of the fundamental tools in the study of mechanical systems with symmetries and it essentially concerns the removal of certain variables by using the symmetries of the system and the associated conservation laws. Such symmetries arise when one has a Lagrangian which is invariant under a Lie group action G, i.e. if the Lagrangian function is invariant under the tangent lift of the action of the Lie group on the configuration manifold Q. If we denote by Φg : Q → Q this (left-) action, for g ∈ G then the invariance condition under the tangent lift action is expressed by L • T Φg = L. For a symmetric mechanical system, reduction by symmetries eliminates the directions along the group variables and thus provides a system with fewer degrees of freedom.
If the (finite-dimensional) differentiable manifold Q has local coordinates (q i ), 1 ≤ i ≤ dim Q and we denote by T Q its tangent bundle with induced local coordinates (q i ,q i ), given a Lagrangian function L : T Q → R, its Euler-Lagrange equations are d dt As is well-known, when Q is the configuration manifold of a mechanical system, equations (1) determine its dynamics. A paradigmatic example of reduction is the derivation of the Euler-Poincaré equations from the Euler-Lagrange equations (1) when the configuration manifold is a Lie group, i.e. Q = G. Assuming that the Lagrangian L : T G → R is left invariant under the action of G it is possible to reduce the system by introducing the body fixed velocity ξ ∈ g and the reduced Lagrangian ℓ : T G/G ≃ g → R, provided by the invariance condition ℓ(ξ) = L(g −1 g, g −1ġ ) = L(e, ξ). The dynamics of the reduced Lagrangian is governed by the Euler-Poincaré equations (see [2] and [8] for instance) and given by the system of first order ordinary differential equations d dt This system, together with the reconstruction equation ξ(t) = g −1 (t)ġ(t), is equivalent to the Euler-Lagrange equations on G, which are given by d dt Reduction theory for mechanical systems with symmetries can be also developed by using a variational principle formulated on a principal bundle π : Q → Q/G, where the principal connection A is introduced on Q [17] (see Definition 2.1). The connection yields the bundle isomorphism α  (6)) where the bracket is the standard Lie bracket on the Lie algebra g and g := AdQ is the adjoint bundle AdQ := (Q × g)/G. A curve q(t) ∈ Q induces the two curves p(t) := π(q(t)) ∈ Q/G and σ(t) = [q(t), A(q(t))]g ∈ g.
Variational Lagrangian reduction [17] states that the Euler-Lagrange equations on Q with a G-invariant Lagrangian L are equivalent to the Lagrange-Poincaré equations on T Q/G ∼ = T (Q/G) ⊕ Q/G g with reduced Lagrangian L : where B is the reduced curvature form associated to the principal connection A and D/Dt denotes the covariant derivative in the associated bundle (see Definition 2.2). The derivation of variational integrators for (1) and (2) from the discretization of variational principles has received a lot attention from the Dynamical Systems Geometric Mechanics community in the recent years [37], [38], [40], [42], [43], [44] (and in particular for optimal control of mechanical systems [1], [6], [7], [11], [15], [16], [18], [23], [35], [34], [45]). The preservation of the symplectic form and momentum map are important properties which guarantee the competitive qualitative and quantitative behavior of the proposed methods and mimic the corresponding properties of the continuous problem. That is, these methods allow substantially more accurate simulations at lower cost for higher-order problems with constraints. Moreover, if the system is subject to constraints, then, under a regularity condition, it can be shown that the system also preserves a symplectic form or a Poisson structure in the reduced case ( [22] and [23] for instance).
The construction of variational integrators for mechanical systems where the configuration space is a principal bundle has been studied in the geometric framework of Lie groupoids [37] and as a motivation for the construction of a discrete time connection form [33], [24]. This line of research has been further developed in the last decade by T. Lee, M. Leok and H. McClamroch [32]. We focus on systems whose phase space is of higher-order, i.e. T (k) Q [3], [26], [27], and moreover is invariant under the action of symmetries. The Euler-Lagrange and Lagrange-Poincaré equations for these systems were introduced by F. Gay-Balmaz, D. Holm and T. Ratiu in [25]. In this work, we aim to develop their discrete analogue for non-trivial principal bundles and its extension to constrained systems (where the constraints will be as well of the higher-order type). With this in mind we employ the discrete Hamilton's principle by introducing a discrete connection and using Lagrange multipliers in order to obtain discrete paths that approximately satisfy the dynamics and the constraints. As examples, we will illustrate our theory by applying the obtained discrete equations to the problem of energy minimum control of an electron in a magnetic field and two coupled rigid bodies attached at a common center of mass.
The structure of the work is as follows: Section 2 introduces preliminaries on geometric mechanics, Lagrange-Poincaré equations, higher-order tangent bundles and the derivation of the constrained higher-order Lagrange-Poincaré equations (Theorem 2.4). Section 3 starts by introducing discrete mechanics and the notion of discrete connection. Next, we study the variational discretization of the constrained higher-order Lagrange-Poincaré equations to obtain a discrete time flow that integrates the continuous time constrained higher-order Lagrange-Poincaré equations. Moreover we provide sufficient regularity conditions for the discrete flow to exist. We proceed by treating the second-order case (the discrete constrained Lagrange-Poincaré equations are given in Theorem 3.4 and the regularity conditions in Proposition 3.1) as an illustration of our approach. Then we carry out the full higher-order case (the equations are given in Theorem 3.6, while the regularity conditions are in Proposition 3.2). Finally, in Section 4, we apply the discrete equations to underactuated mechanical systems in two examples of optimal control, showing that they give rise to a meaningful discretization of the continuous systems.

Constrained higher-order Lagrange-Poincaré equations
In this section we introduce some preliminaries about geometric mechanics on Lie groups, Lagrange-Poincaré reduction, higher order tangent bundles and we study the constrained variational principle for higher-order mechanical systems on principal bundles.
2.1. Geometry of principal bundles. In this subsection we recall the basic tools for analysis of the geometry of principal bundles that are useful in this paper (for more details see [17] and references therein).
Definition 2.1. Let G be a Lie group and g its Lie algebra. Given a free and proper left Lie group action Φ : G × Q → Q, one can consider the principal bundle π : Q → Q/G. A connection A on the principal bundle π is a one-form on Q taking values on g, such that A(ξQ(q)) = ξ, for all ξ ∈ g, q ∈ Q and Φ * g A = AdgA where ξQ is the infinitesimal generator associated with ξ defined as ξQ(q) := d dt t=0 q · exp(tξ).
The associated bundle N with standard fiber M (a smooth manifold), is defined as where the action of G on (Q × M ) is diagonal, i.e. given by g(q, m) = (gq, gm) for q ∈ Q and m ∈ M . The orbit of (q, m) is denoted [q, m]G or simply [q, m]. The projection πN : N → Q/G is given by πN ([q, m]G) = π(q) and it is a surjective submersion. The adjoint bundle is the associated vector bundle with M = g under the adjoint action by the inverse element g −1 ∈ G, ξ → Ad g −1 ξ, and is denoted We will usually employ the short-hand notation g :=AdQ. The orbits in this case are denoted [q, η]g for q ∈ Q and η ∈ g . AdQ is a Lie algebra bundle, that is, each fibre is a Lie algebra with the Lie bracket defined by Reduction theory for mechanical systems with symmetries can be performed by a variational principle formulated on a principal bundle π : Q → Q/G, with fixed principal connection A on Q (see [17]). In other words, the reduced Lagrangian will be defined on the reduced space T Q/G, say L : T Q/G → R. The bundle isomorphism α (1) A : T Q/G → T (Q/G) × Q/G g, provided by the connection, will facilitate the study of the suitable variations. It is defined by where the bracket is the standard Lie bracket on the Lie algebra g, vq ∈ TqQ and [vq] ∈ (T [q] G Q)/G with [q]G ∈ Q/G. A curve q(t) ⊂ Q induces the two curves p(t) := π(q(t)) ⊂ Q/G and σ(t) := [q(t), A((q(t),q(t)))]g ⊂ g, where we denote by (q(t),q(t)) the local coordinates of v q(t) ∈ T q(t) Q at each t.
Definition 2.2. The connection A also allows to define the curvature form B, a 2-form on Q taking values on g, determined by where uq, vq are arbitrary vectors in TqQ such that Tqπ(uq) = up and Tqπ(vq) = vp, with p = π(q). The curvature form B induces a g-valued two-form B on Q/G defined by where uq, vq and up, vp are related as above. The two-form B is called the reduced curvature form (for more details see [17] and references therein).
2.1.1. The covariant derivative. It is well know that the covariant derivative on a vector bundle induces an associated covariant derivative on its dual bundle. In this work, as in [17] and [25], we use this fact to define the covariant derivative in the dual of the adjoint bundle. Ifσ(t) is a curve ong * the covariant derivative ofσ(t) is defined in such a way that for some curve σ(t) ong, both,σ(t) and σ(t) project onto the same curve p(t) on Q/G. Then In the same way one can define the covariant derivative on T * (Q/G) and therefore a covariant derivative on T * (Q/G) × Q/Gg * (see [17] Section 3 for more details).

2.2.
Lagrange-Poincaré reduction. Lagrangian reduction by stages ( [17], Theorem 3.4.1) states that the Euler-Lagrange equations (1) with a G-invariant Lagrangian L : (6)) with reduced Lagrangian L : where B is the reduced curvature form defined in (7) and D/Dt denotes the covariant derivative in the associated bundle. Note that we are employing coordinates (p,ṗ, σ) for T (Q/G) × Q/G g. Moreover, iṗ B denotes the g-valued 1-form on Q/G defined by iṗ B(·) = B(ṗ, ·). Consider a local trivialization of the principal bundle π : Q → Q/G, i.e. a trivial principal bundle πU : U ×G → U where U is an open subset of Q/G with structure group G acting on the second factor by left multiplication. Denote by (p s ), s = 1, . . . , r = dim(Q)− dim(G) local coordinates on U and define maps e b : U → g satisfying that for each p ∈ U , {e b } is a basis of g, b = 1, . . . , dim(G). We choose the standard connection on U , that is, at a tangent vector (p, g,ṗ,ġ) ∈ T (p,g) (U ×G) we have A(p, g,ṗ,ġ) =Adg(Ae(p)ṗ+ξ) where ξ = g −1ġ , e is the identity of G, and Ae : U → g is a 1-form given by Ae(p)ṗ = A(p, e,ṗ, 0).
With this notation the Lagrange-Poincaré equations (8) read (see [39] and [17] Section 4.2 for details) where C a bd are the structure constants of the Lie algebra of g, B a l s are the coefficients of the curvature in the local trivialization and A a s (p) are the coefficients of Ae for given local coordinates p s in U determined by (Ae(p)ṗ) a ea = A a s (p)ṗ s ea, Ae(p)ṗ = A(p, e,ṗ, 0).

2.3.
Higher-order tangent bundles. It is possible to introduce an equivalence relation on the set C k (R, Q) of k-differentiable curves from R to Q (see [30] for more details): By definition, two given curves in Q, γ1(t) and γ2(t), where t ∈ I ⊂ R (0 ∈ I), have a contact of order k at q0 = γ1(0) = γ2(0), if there is a local chart (U, ϕ) of Q such that q0 ∈ U and , for all s = 0, ..., k. This is a well defined equivalence relation on C k (R, Q) and the equivalence class of a curve γ will be denoted by [γ] (k) q 0 . The set of equivalence classes will be denoted by T (k) Q and it is not hard to show that it has the natural structure of a differentiable manifold. Moreover, τ k Q : , is a fiber bundle called the tangent bundle of order k (or higher-order tangent bundle) of Q. In the sequel we will employ HO as short for higher-order.
Given a differentiable function f : Q −→ R and l ∈ {0, ..., k}, its l-lift f (l,k) to T (k) Q, 0 ≤ l ≤ k, is the differentiable function defined as Of course, these definitions can be applied to functions defined on open sets of Q.
From a local chart (q i ) on a neighborhood U of Q, it is possible to induce local coor- 2.3.1. HO quotient space: The action of a Lie group Φg is lifted to an action Φ If Φg is free and proper, we get a principal G-bundle T (k) Q → T (k) Q/G, which is a fiber bundle over Q/G. The class of an element [γ] (k) q 0 ]G. From [17] (see Lemma 2.3.4) we know that the covariant derivative of a curve σ(t) = [q(t), ξ(t)]g ⊂ g relative to a principal connection A is given by In the particular case when σ(t) = [q(t), A(q(t),q(t))]g we have , operating recursively one obtains [25] for example).

Constrained
Hamilton's principle. We derive the constrained HO Lagrange-Poincaré equations using the variational principles studied in [17] and [25] for first order systems and unconstrained HO systems respectively.
Let L : T (k) Q → R, and φ α : T (k) Q → R be a G-invariant HO Lagrangian and Ginvariant HO (independent) constraints, respectively, α = 1, . . . , m. The G-invariance allows to induce the reduced Lagrangian L : T (k) Q/G → R and reduced constraints χ α : After fixing a connection A we can employ the isomorphism (10). Then it is possible to write the reduced Lagrangian and the reduced constraints L : M (k) → R and χ α : M (k) → R, and employ the local coordinates s (k,k−1) as in (11).
(12) On the other hand, the covariant variations of σ are given by, In general, (see [25]) for B the reduced curvature (7), it follows that Note that in the expression above, [·, ·] denotes the usual Lie algebra bracket in g.
Consider the augmented Lagrangian L : Constrained HO Lagrange-Poincaré equations are derived by considering the constrained variational principle for the action S : for variations δs (k,k−1) = (δp, δṗ, . . . , δp (k) , δσ, δσ, . . . , δσ (k−1) ) such that where Ξ is an arbitrary curve in g with D j Dt j Ξ vanishing at the endpoints, Consider the principal G-bundle π : Q → Q/G and let A be a principal connection on Q. Let L : M (k) → R and χ α : M (k) → R be the reduced HO Lagrangian and the reduced HO constraints, respectively, associated with A.
Proof. The proof follows in a straightforward way by replacing the Lagrangian in the proof of Theorem 4.1 of [25] by the extended Lagrangian L.
Note that these equations are the second-order constrained version of the local expression of the Lagrange-Poincaré equations derived by Marsden and Scheurle in [39]. ⋄

Discrete constrained higher-order Lagrange-Poincaré equations
3.1. Discrete mechanics and variational integrators. Variational integrators are a class of geometric integrators which are determined by a discretization of a variational principle. As a consequence, some of the main geometric properties of continuous system, such as symplecticity and momentum conservation, are present in these numerical methods (see [28], [40] and [44] and references therein). In the following we will summarize the main features of this type of geometric integrator.
A discrete Lagrangian is a map L d : Q × Q → R, which may be considered as an approximation of the action integral defined by a continuous Lagrangian L : where q(t) is a solution of the Euler-Lagrange equations (1) joining q(t0) = q0 and q(t0 + h) = q1 for small enough h > 0, where h is viewed as the step size of the integrator. Define the action sum S d : Q N+1 → R corresponding to the Lagrangian L d by where qn ∈ Q for 0 ≤ n ≤ N , N is the number of discretization steps. The discrete variational principle states that the solutions of the discrete system determined by L d must extremize the action sum given fixed endpoints q0 and qN . By extremizing S d over qn, 1 ≤ n ≤ N − 1, it is possible to derive the system of difference equations These equations are usually called the discrete Euler-Lagrange equations. If the matrix ). We will refer to the FL d flow, and also (with some abuse of notation) to the equations (18), as a variational integrator.

3.2.
The discrete connection. The discretization of the reduced HO tangent bundle is based on the decomposition of the space (Q × Q)/G by means of the so-called discrete connection [33] (see also [24]): which is defined to account for a reasonable discretization of the properties of the continuous connection A and, moreover, is G-equivariant (see [24,33,37] for more details). Important properties that characterize the discrete connection are [33]: where U ⊂ Q/G. In other words, for any U ⊂ Q/G, π −1 (U ) ∼ = U × G. In such a case, we have: where locally π(q0) = π((p0, g0)) = p0. This defines the local expression of A d , say A d ((p0, e), (p1, e)) = A(p0, p1) ∈ G, which according to (21) leads to In particular, if Q = G, this leads to A d ((e, e), (e, e)) = e and consequently A d (g0, g1) = g1g −1 0 . Remark 3.1. Sometimes (see [37]) the discrete connection is defined as the application A d : Q × Q → G satisfying the properties (1) and (2) listed above. ⋄ In particular, given a discrete connection A d the following isomorphism between bundles is well-defined (see [33] for the proof): [q0, A d (q0, q1)]G ∈ G, where we denote G := (Q ×G)/G in analogy with the adjoint bundlẽ g. We note that (23) is the discrete counterpart of the isomorphism (6).

Remark 3.2.
In the case Q = G, the isomorphism (23) is given by A d (g0, g1) = g −1 0 g1 in view of property (3), which leads to the usual Euler-Poincaré discrete reduction as in [42]. ⋄ We consider the following extension of (23) in the case of HO tangent bundles, which is local for non-trivial bundles (see [24,33] for more details): where Q (k+1) denotes the Cartesian product of (k + 1)-copies of Q, (Q/G) (k+1) denotes the Cartesian product of (k + 1)-copies of (Q/G) and G (k) denotes the sum of k-copies of G. Consequently, we consider H (k+1,k) := (Q/G) (k+1) × Q/G G (k) as the discretization of the space M (k) , which is natural according to [1,33,40].

3.3.
Discrete constrained HO Lagrange-Poincaré equatons. In the following, we aim to derive the variational discrete flow obtained from a discretizacion of L and χ α . Therefore, we shall work in local coordinates, particularly in the local trivialization of the principal bundle (20).
The first task consists of obtaining the variational discretization of equations (14). For this, we must fix the discrete connection (19) and the discrete isomorphism (24). Next, we can induce through A d and α

(k)
A d the discrete reduced HO Lagrangian and the discrete reduced HO constraints, for α = 1, ..., m.
For a clear exposition, first we develop the first-order case, i.e. k = 1, in the next subsection, where the main objects employed in the HO case shall be introduced.
Moreover, we will employ the trivialization (20) to fix a local representation of G, and consequently of [q0, q1]G ∈ (Q × Q)/G. Indeed, employing the discrete connection A d and the isomorphism (23), we can make the following identification Moreover, one can prove that the map is the local representation of the discrete connection as established in (22). Therefore, in this trivialization we can define the local coordinates where n is 0 or a positive integer.
Given the grid {tn = nh | n = 0, . . . , N }, with N h = T , define the discrete path space This discrete path space is isomorphic to the smooth product manifold which consists of N + 1 copies of U × U × G (which is locally isomorphic to N + 1 copies of ((Q/G × Q/G) × Q/G × G)). The discrete trajectory γ d ∈ C d (U × U × G) will be identified with its image, i.e. γ d (tn) = {an} N n=0 where an = (pn, pn+1, g −1 n gn+1A(pn, pn+1)). Let us consider the reduced discrete Lagrangian L d in (26). Define the discrete action sum, S d : where the equality is established at a local level. From now on, we use the notation The discrete constrained variational problem associated with (26), consists of finding a discrete path γ d ∈ C d (U × U × G), given fixed boundary conditions, which extremizes the discrete action sum (32) subject to the discrete constraints χ α d . This constrained optimization problem is equivalent to studying the (unconstrained) optimization problem for the augmented Lagrangian L d : H (2,1) × R m → R given by where λ n α = (λ n 1 , ..., λ n m ) ∈ R m are Lagrange multipliers. The associated action sum is given by where again the equality is given at a local level andγ We establish the result in the following theorem, where the discrete constrained Lagrange-Poincaré equations are obtained. Proof. The poof will be divided into two parts. The first one consists on studying the variations of the action sum (32) associated with L d . After that, our result follows by the incorporation of the constraints and Lagrange multipliers by considering L d instead of L d and (34) instead of (32).
Taking variations on the discrete action sum (32) with q0 = (p0, g0) and qN = (pN , gN ) fixed, which in terms of variations implies δp0 = δpN = 0 and δg0 = δgN = 0, the latter leading to η0 = ηN = 0, and using the Lemma 3.3, we obtain where Di denotes the partial derivative with respect to the i-th variable, Rg, Lg : G → G are the left and right translations by the group variables, while T * h Rg : are their cotangent action. Therefore, δS d = 0 for arbitrary variations implies for n = 1, ..., N − 1, where we define locally the operator T * L (W A i ) by its action on T * G.
Next, we introduce constraints in our picture by considering the augmented Lagrangian (33) instead of L d , which inserted into (35) leads to To obtain the discrete-time equations (39) we used the approach studied in [37]. That is, by using a discrete connection instead of deriving the local description of the curvature terms as in [24]. This approach automatically gives preservation of momentum and symplecticity since we employ a variational approach (see [37] for further details).
Note that the first equation in (39) represents a discrete-time version of the second equation in (8) (or equivalently (9) in a local description) where the curvature terms are included in the terms that come from (37). The second equation represents the (constrained) Euler-Poincaré part (first equation in (39)) in (8), or (9) in the local representation.
is non singular for all an ∈ M d , there exists a neighborhood U k ⊂ M d × R m of (a * n , λ 0 α * ) satisfying equations (39), and an unique (local) application Υ L d : . Proof: It is a direct consequence of the implicit function theorem applied to equations (39).
We see thatãn is a (2k + 1)-tuple with 2k + 1 elements. This discrete path space is isomorphic to the smooth product manifold which consists of N + 1 copies of U (k+1) × G k (which locally is isomorphic to N + 1 copies of (Q/G) (k+1) × Q/G ×G k ).
Let us define the discrete action sum associated with the HO Lagrangian L d as S d : where the second equality is established at a local level.
We establish the result in the following theorem, where the discrete constrained HO Lagrange-Poincaré equations are obtained. As in the case of Theorem 3.4, our proof strategy consists in studying the unconstrained problem (43), and afterwards adding the constraints (44). Proof. In the proof we will employ the index i for the k + 1 first elements, i.e. the p coordinates, and the index z for the last k, i.e. the g coordinates. Taking variations in (43), according to the endpoint conditions detailed above and the variations (41) we obtain: where we have employed (41). Next, we assume that the z-th component, for z = k + 2, ..., 2k + 1, is labeled by n + z − k − 2 and rearranging the sum above after taking into account the endpoint conditions we obtain: where the operator T * L W A i (n) is defined in (37). Equating this variation to zero and considering that δpn and ηn are free for k ≤ n ≤ N − k, we arrive at the discrete equations of motion: The second equation may be rewritten in a more compact way in its dual version by making the following identifications -μ z n := DzL d (ã n−z+k+2 ) ∈ T * WnAn G for k + 2 ≤ z ≤ 2k + 1, which leads to the equation Mn = Ad * W n−1 Mn−1, k ≤ n ≤ N − k. Next, introducing constraints into our picture by considering the augmented Lagrangian (44) we find the discrete constrained HO Lagrange-Poincaré equations As in the first order case, a direct consequence of the implicit function theorem applied to (47) is the existence of the (local) variational flow for the numerical method.
Remark 3.7. In [22] it has been shown that under a regularity condition equivalent to the one given in Proposition 3.2, the discrete constrained system preserves the symplectic 2form (see Remark 3.4 in [22]). Therefore the methods that we are deriving in this work are automatically symplectic methods. Moreover, under a group of symmetries preserving the discrete Lagrangian and the constraints, we additionally obtain momentum preservation. In the case when the principal bundle is a trivial bundle, and therefore the terms associated with the connection and curvature are zero, we obtain the same results as [18]. ⋄

Application to optimal control of underactuated systems
Underactuated mechanical system are controlled mechanical systems where the number of the control inputs is strictly less than the dimension of the configuration space. In this section we consider dynamical optimal control problems for a class of underactuated mechanical systems determined by Lagrangian systems on principal bundles.
We assume that we are only allowed to have control systems that are controllable, that is, for any two points q0 and qT in the configuration space, there exists an admissible control defined on some interval [0, T ] such that the system with initial condition q0 reaches the point qT in time T (see [2] for more details). Let A controlled Lagrange-Poincaré system is a controlled mechanical systems whose dynamics is given by the controlled Lagrange-Poincaré equations (48).
We refer to a controlled decoupled Lagrange-Poincaré system when equations (48a)-(48b) can be written as a system of equations of the form that is, a controlled Lagrange-Poincaré system is written as a control system showing which configurations are actuated and which ones unactuated. The next Lemma shows that a controlled Lagrange-Poincaré system always permits a description for the controlled dynamics as a controlled decoupled Lagrange-Poincaré system.

Remark 4.3.
Observe that (49a) provides an expression of the control inputs as a function on the second-order tangent bundle M (2) locally described by coordinates (p,ṗ,p, σ,σ), Next we consider an optimal control problem. Solving the optimal control problem is equivalent to solving a constrained second-order variational problem [5], with LagrangianL : M (2) → R locally described by L(s (2,1) ) := C s (1,0) , Fa(s (2,1) ) , where C is the cost function and Fa is defined in (50); and subject to the constraints χ α : M (2) → R given by equivalent to equation (49b). Then, given boundary conditions, normal extrema for the optimal control problem are determined by the solutions of the constrained second-order Lagrange-Poincaré equations for the Lagrangian (51) subject to (52). The resulting equations of motion are a set of combined third order and fourth order ordinary differential equations.
Motivated by the examples that we study in the next section, we restrict ourself to a particular class of these control problems where we assume full controls in the base manifold Q/G, that is, using Lemma 4.2, we consider the controlled Lagrange-Poincaré equations, in a local trivialization πU : U × G → U of the principal bundle π : Q → Q/G, i.e. d dt In this context, the optimal control problem consists of finding a solution of the state variables and control inputs for the previous equations (53) given boundary conditions and minimizing the cost functional A normal extremal for the optimal control problem is characterized by the constrained second-order variational problem determined by the second-order Lagrangian subject to the second-order constraints whose solutions satisfy the constrained second-order Lagrange-Poincaré equations for L(s (2,1) , λα) = L(s (2,1) ) + λαχ α (s (2,1) ) with λα ∈ R m the Lagrange multipliers. Those equations are in general given by a set of fourth order nonlinear ordinary differential equations which are very difficult to solve explicitly. Thus, constructing numerical methods is in order, a task for which the results in the previous sections must be implemented.

4.1.1.
Optimal control of an electron in a magnetic field. We study the optimal control problem for the linear momentum and charge of an electron of mass m in a given magnetic field (see [2] Section 3.9). One of the motivations for constructing structure preserving variational integrators for this example is that the charge is a conserved quantity and our method, since it is variational, preserves the momentum map associated with a Lie group of symmetries.
Let M be a 3 dimensional Riemannian manifold and π : Q → M be a circle bundle (that is, S 1 acts on Q on the left and then π : Q → M is a principal bundle where M = Q/S 1 ) with respect to a left SO(2) action. We will use the isomorphism (as Lie group) of SO(2) and S 1 to make our analysis consistent with the theory.
The motivation for including a potential function in our analysis is twofold. Firstly, it is inspired by possible further applications including static obstacles in the workspace.
We use φ as a artificial potential function (for instance a Coloumb potential) to avoid the obstacle. Secondly, it is motivated by use of this example in the theory of controlled Lagrangians and potential shaping for systems with breaking symmetries. Note that here V is not invariant under the symmetry group (see [2] Section 4.7) for more details.
Note also that π(θ · q) = π(q) for all q ∈ Q and θ ∈ S 1 . Thus where Ad θ =Id so (2) because SO(2) is Abelian. That is, L is SO(2)-invariant and we may perform Lagrange-Poincaré reduction by symmetries to get the equations of motion on the principal bundle T Q/SO (2).
Fixing the connection A on Q, we can use the principal connection A to get an isomorphism α A : T Q/SO(2) → T M ⊕ so(2) which permits us to define the reduced Lagrangian . For the reduced Lagrangian ℓ, the dynamics is determined by the Lagrange-Poincaré equations (8), in this particular case where µ = ∂ℓ ∂ξ is the charge of the particle. Here, B : T M ∧ T M → so(2) is the reduced curvature tensor associated with the connection form A, d is the exterior differential and ♭ : g → g * is the associated isomorphisms to the inner product defined by the metric (see [2] and [10] for instance). Note that this equation corresponds with Wong's equations [17].
In the case where Q = R 3 × S 1 the Lagrangian is In this case, we have that T Q/SO(2) ≃ R 3 × R where AdQ = R and the reduced Lagrangian is The above equations reduce to the Lorentz force law describing the motion of a charged particle of mass m in a magnetic field under the influence of a potential function where µ = ∂ℓ ∂ξ = 2e c ξ and − → B = (Bx, By, Bz) ∈ X(R 3 ). Next, we introduce controls in our picture. Let U ⊂ R 3 , where u = (u1, u2, u3) ∈ U are the control inputs. Then, given u(t) ∈ U , the controlled decoupled Lagrange-Poincaré system (49) is given by If Q = R 3 ×S 1 then the above system becomes the controlled decoupled Lagrange-Poincaré system describing the controlled dynamics of a charged particle of mass m in a magnetic field under the influence of a potential function: The optimal control problem consists of finding trajectories of the state variables and controls inputs, satisfying the previous equations subject to given initial and final conditions and minimizing the cost functional, where the norm || · || represents the Euclidean norm on R 3 .
This optimal control problem is equivalent to solving the following constrained secondorder variational problem given by min (x,ẋ,ẍ,ξ,ξ) subject to the constraint χ(x,ẋ,ẍ, ξ,ξ) = 2e cξ . For a simple exposition of the resulting equations describing necessary conditions for the existence of normal extrema in the optimal control problem, we restrict our analysis to the particular case when the magnetic field is aligned with the x3-direction and orthogonal to the x1 − x2 plane, that is, − → B = (0, 0, Bz) with Bz constant, and the potential field is quadratic φ = (x 2 1 + x 2 2 + x 2 3 ). The constrained second-order Lagrange-Poincaré equations are where ω = eBz mc , λ(t) is constant and ξ(t) = 2e c . ξ(t) comes from the integration of the constraint and λ(t) is obtained from 2e cλ = 0, the Lagrange-Poincaré equation arising from ξ(t) (note that we obtain the same result for the multiplier as in [2] Section 7.5.) In terms of the discretization of this system as presented in Section 3.2, we need to define the discrete connection (19), but given that the bundle is trivial, the connection vanishes. Denoting by (xn, ξn) = (x 1 n , x 2 n , x 3 n , ξn, ξn+1), the discrete second order Lagrangian for the reduced optimal control problem corresponding to (59), is given by where − → B (xn) := (B1(x 1 n ), B2(x 2 n ), B3(x 3 n )). By Theorem 3.6 the discrete second-order constrained Lagrange-Poincare equations giving rise to the integrator which approximates the necessary conditions for optimality in the optimal control problem are given by together with 2e hc (ξn+1 − ξn) = 0, 2e hc (ξn − ξn−1) = 0, 2e hc (ξn−1 − ξn−2) = 0 and λn = λn−1 for n = 2, . . . , N − 2. We observe that (61a), (61b) and (61c) are a discretization in finite differences of (60a), (60b) and (60c), respectively. 1 4.1.2. Energy minimum control of two coupled rigid bodies: We consider a discretization of the energy minimum control for the motion planning of an underactuated system composed by two planar rigid bodies attached at their center of mass and moving freely in the plane, also known in the literature as Elroy's beanie (see [36], [46] for details) which is an example of a dynamical system with a non-Abelian Lie group of symmetries.
x and x (iv) , respectively. The shift of the n index present in equations (61) comes from the particular expression of the discrete constrained HO Lagrange-Poincaré equations provided in Theorem 3.6.
As discussed in the previous subsection, the optimal control problem consists of finding trajectories of the state variables and control inputs, satisfying the equations (66a), (66b), (66c) and (67), subject to boundary conditions and minimizing the cost functional T 0 C(ψ,ψ, Ω, u)dt. In particular we are interested in energy-minimum problems, where the cost function is of the form C(ψ,ψ, Ω, u) = 1 2 u 2 .