1 Introduction

1.1 State of the art

Dynamics modeling

Over time, two approaches to the description of dynamical systems have been developed: the well-known Lagrangian and Hamiltonian formalisms both consider descriptive energetic scalars and deploy certain operations on them to generate the system’s equations of motion [26]. However, another formulation, which unifies both frameworks by means of independent position, velocity, and momentum quantities, has been proposed by Livens [41]. Livens’ principle has been recently taken up (cf. [13, 27, 54]) under the name of Hamilton–Pontryagin principle due to its close relation to the Pontryagin principle from the field of optimal control [51]. Livens’ principle allows for an advantageous universal description due to its mixed character. In the previous works [32, 33] Livens’ principle serves as a basis for the design of a new variational principle for constrained dynamics.

Numerical integration

Over the last decades, numerical methods have been developed to solve the equations of motion approximately. The class of structure-preserving integrators seeks to inherit the conservation principles of dynamical systems in a discrete sense (cf. monographs such as Hairer et al. [24]). In the field of mechanics, structure-preserving integration schemes can be mainly divided into two different groups: symplectic methods, of which variational integrators are an important subclass, and energy-momentum (EM) integrators.

EM integrators are implicit methods that inherit the energy and momentum-map conservation of the time-continuous dynamical system in discrete time. These methods are popular due to the enhanced stability [23], allowing for robust long-time simulations. Mostly based on discrete gradients [21, 22, 28, 44], EM schemes typically build up on a Hamiltonian framework. This requires to set up a Hamiltonian function, such that the mass matrix (or inertia matrix) needs to be invertible.

Parametrizations of finite rotations

When simulating multibody system dynamics, the mathematical properties of the formulation heavily depend on the particular choice of coordinates. Especially the parametrization of rotational degrees of freedom offers a multitude of possibilities [1, 4, 15]. The investigation of rotations dates back to the historical work by Euler [16]. Possible ways to parameterize the three rotational degrees of freedom include, but are not limited to:

  • Euler angles: This minimal representation is non-unique, non-global and can induce the gimbal lock.

  • Rotation matrices / direction cosines / directors: They are unique and global, but have a high redundancy of six.

  • Unit quaternions / Euler parameters: They are non-uniqueFootnote 1 but global and only have a redundancy of one.

As an extension of complex numbers, which can be used to describe planar rotations, the concept of unit quaternions offers an appealing and widely-used approach to the description of spatial rotations. Basic textbooks on the fundamentals of quaternions can be found in [1, 36] and the seminal works by Haug [25] and Nikravesh [48]. Until now, unit quaternion parametrizations of spatial rigid body rotations and their numerical integration are an active field of research [29, 49, 52, 55, 60, 62, 63]. The standard approach yields a singular \(4 \times 4\) mass matrix, thus making a direct transition to the Hamiltonian setup impossible. Over time, Hamiltonian approaches have been developed nevertheless [3, 12, 42, 46, 62]. While novel methods using unit quaternions can still induce notable energy errors [55, 63], most EM methods in this context are based on the classical Euler’s equations [35, 39, 53, 57]. Only few works target the EM-consistent integration of rigid body rotations formulated in quaternions: Besides [47], another exception is [7], circumventing the need of an undetermined inertia term for setting up the Hamiltonian framework. This was achieved by starting from a director-based formulation of finite rotations with the nine independent components of the rotation matrix ([9, 34] or [38, Chap. 8]) and a subsequent size-reduction to obtain a regular mass matrix in the quaternion-based framework.

Non-standard mass matrices

In the previous works [32, 33], the usage of Livens’ principle has been restricted to constrained mechanical systems with constant mass matrix. However, in a multitude of frameworks, the mass matrix can even become singular or does depend on the coordinates themselves (cf. [18, 59]). Apart from easy model problems, where the singularity of the mass matrix can be overcome easily by means of modeling approaches, the rigid body dynamics formulated in unit quaternions (see above) is an important case. These cases pose some difficulties for Hamiltonian methods, since the inversion of the mass matrix might not be feasible. The advantageous structure of Livens’ principle with respect to non-standard mass matrices has only been recently explored in [31].

1.2 Present contributions

In the present work we make contributions in the following fields:

  • Multibody systems analysis: This paper introduces a novel approach to multibody systems with singular and/or configuration-dependent mass matrices, utilizing Livens’ principle [13, 27, 32, 33, 41]. Unlike Hamiltonian frameworks, this approach avoids the inversion of the mass matrix, providing a new basis for the development of structure-preserving time integrators.

  • Structure-preserving integrators: We design an energy- and momentum-consistent time integrator by directly discretizing Livens’ equations of motion in conjunction with Gonzalez discrete derivatives [21, 24]. This new EM integrator handles both singular and configuration-dependent mass matrices, ensuring time-discrete energy and momentum preservation and exact satisfaction of holonomic constraints. The design of such a method would not be feasible in this straightforward way in a Hamiltonian or Lagrangian framework.

  • Quaternion-based dynamics: The paper explores the unit quaternion representation for rigid body rotations and tailors a new EM integrator for this problem class. Leveraging Livens’ principle, we can set up in a straightforward manner the kinetic energy in terms of quaternions and quaternion velocities. In contrast to existing approaches [7, 47, 62], here one does not require a sophisticated augmentation of the mass matrix with additional inertia terms.

1.3 Outline

The outline of the present work is as follows: In Sect. 2 the fundamentals of the dynamics of mechanical system are briefly outlined. After recapitulating Lagrangian and Hamiltonian mechanics of holonomically constrained systems, we introduce Livens’ principle in Sect. 2.3. After that, the usage of unit quaternions (or Euler parameters) for the parametrization of the rotational dynamics of rigid bodies are covered by Sect. 3. This includes a revision of necessary fundamentals as well as a demonstration, how Livens’ principle provides a new modelling approach in this context (see Sect. 3.3). In Sect. 4 we discretize the deduced equations of motion pertaining to Livens’ principle using discrete derivatives to obtain a new EM-consistent time-stepping scheme, which is used in Sect. 5 for the simulation of representative example problems. Section 6 concludes this paper by reviewing the main findings and giving a short outlook for future research directions. The Appendix contains useful relations and definitions, which are not crucial to understand the main concepts and ideas of the bulk part of this work. Especially, we include the Hamiltonian reference procedure from [7], see Appendix D.

Notation

Throughout this work we follow the upcoming notation rules. Column vectors \(\mbox{$\boldsymbol {a}$} , \mbox{$\boldsymbol {b}$} ,{\boldsymbol {\mu}} \in \mathbb{R}^{n}\) just use an italic, bold font, and lowercase letters, and their row vector counterpart is obtained from transposition, i.e., \(\mbox{$\boldsymbol {a}$} ^{\mkern -1.5mu\mathsf {T}}, \mbox{$\boldsymbol {b}$} ^{\mkern -1.5mu\mathsf {T}}, {\boldsymbol {\mu}} ^{\mkern -1.5mu\mathsf {T}}\in \mathbb{R}^{1 \times n}\). A matrix \(\mbox{$\mathbf {A}$} \in \mathbb{R}^{n \times m}\) uses bold font as well, but typically assumes uppercase letters. Matrix transposition is denoted by \(\mbox{$\mathbf {A}$} ^{\mkern -1.5mu\mathsf {T}}\). A scalar quantity is written using normal font, e.g., \(V \in \mathbb{R}\). Quaternions are indicated using blackboard-typed font, e.g., a, b. Scalar-multiplication uses the dot product ab or \(\mbox{$\boldsymbol {a}$} \cdot \mbox{$\boldsymbol {b}$} \). The outer (or dyadic) product of two vectors \(\mbox{$\boldsymbol {a}$} \otimes \mbox{$\boldsymbol {b}$} \) yields a matrix with components \(a_{i} b_{j}\). Matrix-vector multiplication is denoted as \(\mbox{$\mathbf {A}$} \mbox{$\boldsymbol {b}$} \) or Cq. The \(d \times d\) identity matrix is denoted by \(\mbox{$\mathbf {I}$} _{d \times d}\). Moreover, we define column concatenation and a row concatenation such that

$$\begin{aligned} \begin{bmatrix} \mbox{$\mathbf {A}$} & & \mbox{$\boldsymbol {b}$} \end{bmatrix} ^{\mkern -1.5mu\mathsf {T}}= \begin{bmatrix} \mbox{$\mathbf {A}$} ^{\mkern -1.5mu\mathsf {T}}\\ \mbox{$\boldsymbol {b}$} ^{\mkern -1.5mu\mathsf {T}}\end{bmatrix} \text{.} \end{aligned}$$
(1)

Partial derivatives are denoted by \(\partial _{x} f(x,y)\) and the gradient operator of functions with multiple arguments is given by \(\nabla f(x,y) = [\partial _{x} f \ \partial _{y} f]^{\mkern -1.5mu\mathsf {T}}\). If not stated otherwise, \(|| \square ||\) denotes the standard Euclidean norm. The widehat-notation (see, e.g., [26]) will be used, such that the cross-product \(\mbox{$\boldsymbol {a}$} \times \mbox{$\boldsymbol {b}$} = \widehat{ \mbox{$\mathbf {a}$} } \mbox{$\boldsymbol {b}$} \) is formulated with the skew-symmetric matrix

$$\begin{aligned} \widehat{ \mbox{$\mathbf {a}$} } = \begin{bmatrix} 0 & & -a_{3} & & a_{2} \\ a_{3} & & 0 & & -a_{1} \\ -a_{2} & & a_{1} & & 0 \end{bmatrix} = - \widehat{ \mbox{$\mathbf {a}$} } ^{\mkern -1.5mu\mathsf {T}} \text{,} \end{aligned}$$
(2)

where \(a_{i}\) denotes the \(i\)th component of vector \(\mbox{$\boldsymbol {a}$} \) in a given coordinate frame. If not mentioned differently, we assume this to be an inertial and Euclidean coordinate frame, denoted by \(\{ \mbox{$\boldsymbol {e}$} _{i} \}\).

2 Dynamics modeling

In this chapter, we review the fundamentals of conservative Lagrangian and Hamiltonian formulations for the dynamics of holonomically constrained systems in Sect. 2.1 and Sect. 2.2, respectively. Subsequently, we present the alternative formulation using Livens’ principle in Sect. 2.3 and demonstrate its conservation principles.

2.1 Lagrangian dynamics

Consider the motion of a conservative dynamical system in a time interval of interest \(\mathcal{T} = [0,t_{\mathrm{end}}]\) with \(n\) coordinates \(\mbox{$\boldsymbol {q}$} : \mathcal{T} \rightarrow \mathcal{Q}\), the configuration space, which is constrained by \(m\) independent scleronomic, holonomic constraint equations \(g_{k} \colon \mathcal{Q} \rightarrow \mathbb{R}\) (\(k=1, \ldots ,m\)) comprised in a column-vector such that

$$\begin{aligned} \mbox{$\boldsymbol {g}$} ( \mbox{$\boldsymbol {q}$} (t)) = \mbox{$\boldsymbol {0}$} \text{.} \end{aligned}$$
(3)

Correspondingly, the configuration space is given by

$$\begin{aligned} \mathcal{Q} = \lbrace \mbox{$\boldsymbol {q}$} (t) \in \mathbb{R}^{n} : \mbox{$\boldsymbol {g}$} ( \mbox{$\boldsymbol {q}$} ) = \mbox{$\boldsymbol {0}$} \rbrace , \end{aligned}$$
(4)

and hidden velocity constraints are imposed due to consistency requiring

$$\begin{aligned} \frac{ \,\mathrm {d} }{ \,\mathrm {d} t} \mbox{$\boldsymbol {g}$} ( \mbox{$\boldsymbol {q}$} (t)) = \nabla \mbox{$\boldsymbol {g}$} ( \mbox{$\boldsymbol {q}$} (t)) \dot{ \mbox{$\boldsymbol {q}$} } = \mbox{$\boldsymbol {0}$} \text{,} \end{aligned}$$
(5)

where the constraint Jacobian has rank \(m\) due to the independence of the constraints. Admissible velocities \(\dot{ \mbox{$\boldsymbol {q}$} }\) belong to the tangent space

$$\begin{aligned} T_{ \mbox{$\boldsymbol {q}$} }\mathcal{Q} = \lbrace \dot{ \mbox{$\boldsymbol {q}$} } \in \mathbb{R}^{n} : \nabla \mbox{$\boldsymbol {g}$} ( \mbox{$\boldsymbol {q}$} ) \dot{ \mbox{$\boldsymbol {q}$} } = \mbox{$\boldsymbol {0}$} \rbrace \text{,} \end{aligned}$$
(6)

henceforth omitting time-dependency for clarity. The motion of such a dynamical system is determined by Hamilton’s principle of least action, which ensures the stationarity of the action integral leading to

$$\begin{aligned} \delta \int _{\mathcal{T}} \left ( L( \mbox{$\boldsymbol {q}$} , \dot{ \mbox{$\boldsymbol {q}$} }) - \mbox{$\boldsymbol {\lambda}$} \cdot \mbox{$\boldsymbol {g}$} ( \mbox{$\boldsymbol {q}$} ) \right ) \,\mathrm {d} t = 0 \text{.} \end{aligned}$$
(7)

In the last relation Lagrange multipliers \(\mbox{$\boldsymbol {\lambda}$} : \mathcal{T} \rightarrow \mathbb{R}^{m}\) have been introduced to enforce constraint equation (3). Moreover, \(L: T\mathcal{Q} \rightarrow \mathbb{R}\) is the Lagrange function. In this work we consider separable forms

$$\begin{aligned} L( \mbox{$\boldsymbol {q}$} ,\dot{ \mbox{$\boldsymbol {q}$} }) = T( \mbox{$\boldsymbol {q}$} ,\dot{ \mbox{$\boldsymbol {q}$} }) - V( \mbox{$\boldsymbol {q}$} ) = \frac{1}{2} \dot{ \mbox{$\boldsymbol {q}$} } ^{\mkern -1.5mu\mathsf {T}} \mbox{$\mathbf {M}$} ( \mbox{$\boldsymbol {q}$} ) \dot{ \mbox{$\boldsymbol {q}$} } - V( \mbox{$\boldsymbol {q}$} ), \end{aligned}$$
(8)

where the kinetic energy function \(T: T\mathcal{Q} \rightarrow \mathbb{R}\) is set up using the symmetric, positive semidefinite mass matrix \(\mbox{$\mathbf {M}$} : \mathcal{Q} \rightarrow \mathbb{R}^{n \times n}\), which is explicitly allowed to have rank deficiency. Moreover, in (8), \(V: \mathcal{Q} \rightarrow \mathbb{R}\) denotes the potential energy function. For the present case, the dynamics are governed by constraints as well, making it reasonable to define an augmented Lagrangian

$$\begin{aligned} L_{\boldsymbol {\lambda}}( \mbox{$\boldsymbol {q}$} ,\dot{ \mbox{$\boldsymbol {q}$} }) = L( \mbox{$\boldsymbol {q}$} ,\dot{ \mbox{$\boldsymbol {q}$} }) - \mbox{$\boldsymbol {\lambda}$} \cdot \mbox{$\boldsymbol {g}$} ( \mbox{$\boldsymbol {q}$} ) \text{.} \end{aligned}$$
(9)

The variational principle (7) leads to the well-known Lagrangian equations of the first kind as corresponding Euler–Lagrange equations, i.e.,

$$ \begin{aligned} \frac{ \,\mathrm {d} }{ \mathrm {d}t} \left ( \partial _{\dot{ \mbox{$\boldsymbol {q}$} }} L( \mbox{$\boldsymbol {q}$} , \dot{ \mbox{$\boldsymbol {q}$} }) \right ) - \partial _{{ \mbox{$\boldsymbol {q}$} }} L( \mbox{$\boldsymbol {q}$} , \dot{ \mbox{$\boldsymbol {q}$} }) + \nabla \mbox{$\boldsymbol {g}$} ( \mbox{$\boldsymbol {q}$} )^{\mkern -1.5mu\mathsf {T}} \mbox{$\boldsymbol {\lambda}$} & = \mbox{$\boldsymbol {0}$} , \\ \mbox{$\boldsymbol {g}$} ( \mbox{$\boldsymbol {q}$} ) & = \mbox{$\boldsymbol {0}$} \text{.} \end{aligned} $$
(10)

The total energy of the system in the Lagrangian setup is given by the sum of kinetic and potential energy, i.e.,

$$\begin{aligned} E_{\mathrm{tot}}( \mbox{$\boldsymbol {q}$} ,\dot{ \mbox{$\boldsymbol {q}$} }) = T( \mbox{$\boldsymbol {q}$} ,\dot{ \mbox{$\boldsymbol {q}$} }) + V( \mbox{$\boldsymbol {q}$} ) \text{.} \end{aligned}$$
(11)

2.2 Hamiltonian dynamics

The Hamiltonian framework for conservative dynamical systems can be derived under some assumptions using a Legendre transformation, yielding a map from the tangent bundle \(T\mathcal{Q}\) to the co-tangent bundle

$$\begin{aligned} T^{*}\mathcal{Q} = \lbrace \mbox{$\boldsymbol {q}$} \in \mathcal{Q}, \mbox{$\boldsymbol {p}$} \in \mathbb{R}^{n} : \nabla \mbox{$\boldsymbol {g}$} ( \mbox{$\boldsymbol {q}$} ) \mbox{$\mathbf {M}$} ( \mbox{$\boldsymbol {q}$} )^{\mathrm{-1}} \mbox{$\boldsymbol {p}$} = \mbox{$\boldsymbol {0}$} \rbrace \text{.} \end{aligned}$$
(12)

Definition 2.1

Given a Lagrangian system, the corresponding Hamiltonian function \(H: T^{*}\mathcal{Q} \rightarrow \mathbb{R} \) can be obtained by employing a Legendre transformation \(F_{L}: ( \mbox{$\boldsymbol {q}$} ,\dot{ \mbox{$\boldsymbol {q}$} }) \mapsto ( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {p}$} )\), where the conjugate momenta are defined a priori using the fiber derivative

$$\begin{aligned} \mbox{$\boldsymbol {p}$} := \partial _{\dot{ \mbox{$\boldsymbol {q}$} }} L( \mbox{$\boldsymbol {q}$} ,\dot{ \mbox{$\boldsymbol {q}$} }) \end{aligned}$$
(13)

such that

$$\begin{aligned} H( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {p}$} ) := \mbox{$\boldsymbol {p}$} \cdot \dot{ \mbox{$\boldsymbol {q}$} }( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {p}$} ) - L( \mbox{$\boldsymbol {q}$} ,\dot{ \mbox{$\boldsymbol {q}$} }( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {p}$} )) . \end{aligned}$$
(14)

This Legendre transformation exists only if relation (13) can be inverted, i.e., if systems with Lagrange function (8) have an invertible mass matrix. If this is the case, the system’s Hamiltonian pertaining to the augmented Lagrangian (9) reads

$$\begin{aligned} H_{\boldsymbol{\lambda}}( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {p}$} ) = T^{*}( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {p}$} ) + V( \mbox{$\boldsymbol {q}$} ) + \mbox{$\boldsymbol {\lambda}$} \cdot \mbox{$\boldsymbol {g}$} ( \mbox{$\boldsymbol {q}$} ) = \frac{1}{2} \mbox{$\boldsymbol {p}$} \cdot \mbox{$\mathbf {M}$} ( \mbox{$\boldsymbol {q}$} )^{-1} \mbox{$\boldsymbol {p}$} + V( \mbox{$\boldsymbol {q}$} ) + \mbox{$\boldsymbol {\lambda}$} \cdot \mbox{$\boldsymbol {g}$} ( \mbox{$\boldsymbol {q}$} ), \end{aligned}$$
(15)

where \(T^{*}: T^{*}\mathcal{Q} \rightarrow \mathbb{R}\) denotes the kinetic co-energy, satisfying \(T^{*}( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {p}$} ) = T( \mbox{$\boldsymbol {q}$} ,\dot{ \mbox{$\boldsymbol {q}$} }( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {p}$} ))\). Relation (15) also demonstrates that the Hamiltonian can be identified with the total energy of the system in the Hamiltonian setup corresponding to (11).

Eventually, for the constrained mechanical systems of our interest, the well-known Hamiltonian equations of motion appear in their canonical form as first order ordinary differential equations

$$\begin{aligned} \dot{ \mbox{$\boldsymbol {q}$} } & = \partial _{ \mbox{$\boldsymbol {p}$} } H_{\boldsymbol{\lambda}}( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {p}$} ) = \mbox{$\mathbf {M}$} ( \mbox{$\boldsymbol {q}$} )^{\mathrm{-1}} \mbox{$\boldsymbol {p}$} \end{aligned}$$
(16a)
$$\begin{aligned} \dot{ \mbox{$\boldsymbol {p}$} } & = -\partial _{ \mbox{$\boldsymbol {q}$} } H_{\boldsymbol{\lambda}}( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {p}$} ) = - \partial _{ \mbox{$\boldsymbol {q}$} } T( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {p}$} ) - \nabla V( \mbox{$\boldsymbol {q}$} ) - \nabla \mbox{$\boldsymbol {g}$} ( \mbox{$\boldsymbol {q}$} )^{\mkern -1.5mu\mathsf {T}} \mbox{$\boldsymbol {\lambda}$} \end{aligned}$$
(16b)
$$\begin{aligned} \mbox{$\boldsymbol {0}$} & = \mbox{$\boldsymbol {g}$} ( \mbox{$\boldsymbol {q}$} ). \end{aligned}$$
(16c)

As the transition to the Hamiltonian framework may not be feasible in general, we now want to introduce a different and more general framework, which circumvents the inversion of the system’s mass matrix.

2.3 Livens’ principle

From Hamilton’s principle of least action (7) one can proceed by allowing the velocities to be independent variables \(\mbox{$\boldsymbol {v}$} \in T_{ \mbox{$\boldsymbol {q}$} } \mathcal{Q}\). The kinematic relation \(\dot{ \mbox{$\boldsymbol {q}$} } = \mbox{$\boldsymbol {v}$} \) can be enforced by means of Lagrange multipliers \(\mbox{$\boldsymbol {p}$} \in T^{*}_{ \mbox{$\boldsymbol {q}$} } \mathcal{Q}\).

Definition 2.2

The augmented action integral for Livens’ principle accounting for holonomic constraints reads

$$\begin{aligned} S( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} , \mbox{$\boldsymbol {p}$} ,{\boldsymbol {\lambda}}) = \int _{\mathcal{T}} \left [ L( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} ) + \mbox{$\boldsymbol {p}$} \cdot (\dot{ \mbox{$\boldsymbol {q}$} } - \mbox{$\boldsymbol {v}$} ) - { \boldsymbol {\lambda}}\cdot \mbox{$\boldsymbol {g}$} ( \mbox{$\boldsymbol {q}$} ) \right ] \, \mathrm {d}t \text{.} \end{aligned}$$
(17)

Initially termed Livens’ principle (cf. Sect. 26.2 in Pars [50]) after G.H. Livens, who proposed this functional for the first time (cf. Livens [41]), Marsden and co-workers (e.g., [13]) coined the name Hamilton–Pontryagin principle for this functional due to its close relation to the classical Pontryagin principle from the field of optimal control. Due to its mixed character with three independent fields (\(\mbox{$\boldsymbol {q}$} \), \(\mbox{$\boldsymbol {v}$} \), \(\mbox{$\boldsymbol {p}$} \)), it resembles the Hu–Washizu principle from the area of elasticity theory. Initially, this principle did not account for constraints. More recently, preliminary works [32, 33] have taken up Livens’ principle to obtain a novel variational principle, the GGL principle, which extends Livens’ principle to holonomically constrained systems and explicitly accounts for velocity constraints in the sense of (5).

By stating the stationary condition

$$\begin{aligned} \delta S( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} , \mbox{$\boldsymbol {p}$} ,{\boldsymbol {\lambda}}) = 0 \end{aligned}$$
(18)

and executing the variations with respect to every independent variable, one obtains the equations of motion

$$\begin{aligned} \dot{ \mbox{$\boldsymbol {q}$} } & = \mbox{$\boldsymbol {v}$} \text{,} \end{aligned}$$
(19a)
$$\begin{aligned} \dot{ \mbox{$\boldsymbol {p}$} } & = \partial _{ \mbox{$\boldsymbol {q}$} } L( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} ) - \nabla \mbox{$\boldsymbol {g}$} ( \mbox{$\boldsymbol {q}$} )^{\mkern -1.5mu\mathsf {T}}{\boldsymbol {\lambda}} \text{,} \end{aligned}$$
(19b)
$$\begin{aligned} \mbox{$\boldsymbol {p}$} & = \partial _{ \mbox{$\boldsymbol {v}$} } L( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} ) \text{,} \end{aligned}$$
(19c)
$$\begin{aligned} \mbox{$\boldsymbol {0}$} & = \mbox{$\boldsymbol {g}$} ( \mbox{$\boldsymbol {q}$} ) , \end{aligned}$$
(19d)

where the arbitrariness of variations and standard endpoint conditions \(\delta \mbox{$\boldsymbol {q}$} (t=0) = \delta \mbox{$\boldsymbol {q}$} (t=T) = \mbox{$\boldsymbol {0}$} \) have been taken into account. With regard to (19c), the Lagrange multiplier \(\mbox{$\boldsymbol {p}$} \) can be identified as the conjugate momentum. Thus, Livens’ principle automatically accounts for the Legendre transformation (see Def. 2.1), whereas within the framework of Hamiltonian dynamics momentum variables have to be defined a priori using the fiber derivative.

It can be shown that the above differential algebraic equations (DAEs) (19a)–(19d) have differentiation index 3 (see, for example, [37]), which can lead to numerical instabilities. An index reduction using the classical Gear–Gupta–Leimkuhler stabilization [19] or an expansion of (17) to account also for the hidden constraints (cf. GGL principle in [32, 33]) can circumvent the arising problems.

In analogy to (14), a generalized energy function can be introduced as follows.

Definition 2.3

Given a Lagrangian (8) the quantity

$$\begin{aligned} E( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} , \mbox{$\boldsymbol {p}$} ) = \mbox{$\boldsymbol {p}$} \cdot \mbox{$\boldsymbol {v}$} - L( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} ) = E_{\mathrm{kin}}( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} , \mbox{$\boldsymbol {p}$} ) + V( \mbox{$\boldsymbol {q}$} ) \end{aligned}$$
(20)

is called a generalized energy function and \(E_{\mathrm{kin}}( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} , \mbox{$\boldsymbol {p}$} ) := \mbox{$\boldsymbol {p}$} \cdot \mbox{$\boldsymbol {v}$} - T( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} ) \) is the corresponding generalized kinetic energy function, both being defined for independent coordinates, velocities and momenta.

Remark 2.4

Alternative form of Livens’ principle

Using the generalized energy function, (17) can be recast as

$$\begin{aligned} S( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} , \mbox{$\boldsymbol {p}$} ) = \int _{\mathcal{T}} \left [ \mbox{$\boldsymbol {p}$} \cdot \dot{ \mbox{$\boldsymbol {q}$} } - E( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} , \mbox{$\boldsymbol {p}$} ) - {\boldsymbol {\lambda}} \cdot \mbox{$\boldsymbol {g}$} ( \mbox{$\boldsymbol {q}$} ) \right ] \mathrm {d}t, \end{aligned}$$
(21)

such that the Euler–Lagrange equations (19a)–(19d) are equivalently given by

$$\begin{aligned} \dot{ \mbox{$\boldsymbol {q}$} } & = \partial _{ \mbox{$\boldsymbol {p}$} } E( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} , \mbox{$\boldsymbol {p}$} ) , \end{aligned}$$
(22a)
$$\begin{aligned} \dot{ \mbox{$\boldsymbol {p}$} } & = - \partial _{ \mbox{$\boldsymbol {q}$} } E( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} , \mbox{$\boldsymbol {p}$} ) - \nabla \mbox{$\boldsymbol {g}$} ( \mbox{$\boldsymbol {q}$} )^{\mkern -1.5mu\mathsf {T}}{\boldsymbol {\lambda}} , \end{aligned}$$
(22b)
$$\begin{aligned} \mbox{$\boldsymbol {0}$} & = \partial _{ \mbox{$\boldsymbol {v}$} } E( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} , \mbox{$\boldsymbol {p}$} ) , \end{aligned}$$
(22c)
$$\begin{aligned} \mbox{$\boldsymbol {0}$} & = \mbox{$\boldsymbol {g}$} ( \mbox{$\boldsymbol {q}$} ) \text{.} \end{aligned}$$
(22d)

Proposition 2.5

The generalized energy (20) is a conserved quantity along solutions of (19a)(19d).

Proof

We compute

$$\begin{aligned} \begin{aligned} \frac{ \,\mathrm {d} }{ \mathrm {d}t}E( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} , \mbox{$\boldsymbol {p}$} ) & = \partial _{ \mbox{$\boldsymbol {q}$} } E( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} , \mbox{$\boldsymbol {p}$} ) \cdot \dot{ \mbox{$\boldsymbol {q}$} } + \partial _{ \mbox{$\boldsymbol {v}$} } E( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} , \mbox{$\boldsymbol {p}$} ) \cdot \dot{ \mbox{$\boldsymbol {v}$} } + \partial _{ \mbox{$\boldsymbol {p}$} } E( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} , \mbox{$\boldsymbol {p}$} ) \cdot \dot{ \mbox{$\boldsymbol {p}$} }\\& = - {\boldsymbol {\lambda}} \cdot \nabla \mbox{$\boldsymbol {g}$} ( \mbox{$\boldsymbol {q}$} ) \mbox{$\boldsymbol {v}$} = 0, \end{aligned} \end{aligned}$$
(23)

where the partial derivatives of \(E\) have been used and (22a)–(22d) has been inserted. Thus, the second term vanishes while the first and third term cancel each other. Having in mind that (5) holds, also this last part is zero, such that \(\,\mathrm {d} E / \mathrm {d}t= 0\). □

Proposition 2.6

Assume that a dynamical system has symmetry, i.e., it satisfies the invariance properties

$$\begin{aligned} L( \textit{$\boldsymbol {q}$} ^{\alpha}, \textit{$\boldsymbol {v}$} ^{\alpha}) = L( \textit{$\boldsymbol {q}$} , \textit{$\boldsymbol {v}$} ), \quad \textit{$\boldsymbol {g}$} ( \textit{$\boldsymbol {q}$} ^{\alpha}) = \textit{$\boldsymbol {g}$} ( \textit{$\boldsymbol {q}$} ) \textit{,} \end{aligned}$$
(24)

where \(( \textit{$\boldsymbol {q}$} ^{\alpha}, \textit{$\boldsymbol {v}$} ^{\alpha})\) are one-parameter curves in the configuration space (4) and tangent space (6), respectively, resulting from the action of a matrix group \(G\) on the configuration space. Then, according to Noether’s theorem, each symmetry induces the conservation of an associated momentum map, defined by

$$\begin{aligned} L_{\boldsymbol {\xi}}( \textit{$\boldsymbol {q}$} , \textit{$\boldsymbol {p}$} ) := \textit{$\boldsymbol {p}$} \cdot \textit{$\boldsymbol {\xi}$} \textit{$\boldsymbol {q}$} , \end{aligned}$$
(25)

where \(\textit{$\boldsymbol {\xi}$} \) is an element of the Lie algebra of \(G\).

Proof

Livens’ principle with constraints is a special case of the GGL principle. The proposition follows from a proof in analogy to Sect. 2.2.1 and 3.2.1 in [32]. The reference is restricted to constant mass matrices. However, this does not alter the deduction of the proof. □

Remark 2.7

Equivalence with Lagrangian dynamics

Note that reinserting (19c) into (19b) yields

$$\begin{aligned} \dot{ \mbox{$\boldsymbol {q}$} } & = \mbox{$\boldsymbol {v}$} \text{,} \end{aligned}$$
(26a)
$$\begin{aligned} \frac{ \,\mathrm {d} }{ \,\mathrm {d} t} \left ( \partial _{ \mbox{$\boldsymbol {v}$} } L( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} ) \right ) & = \partial _{ \mbox{$\boldsymbol {q}$} } L( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} ) - \nabla \mbox{$\boldsymbol {g}$} ( \mbox{$\boldsymbol {q}$} )^{\mkern -1.5mu\mathsf {T}}{\boldsymbol {\lambda}} \text{,} \end{aligned}$$
(26b)
$$\begin{aligned} \mbox{$\boldsymbol {0}$} & = \mbox{$\boldsymbol {g}$} ( \mbox{$\boldsymbol {q}$} ), \end{aligned}$$
(26c)

which traces back to the Lagrangian equations of the first kind (10), after substituting (26a) into (26b).

Remark 2.8

Equivalence with Hamiltonian dynamics

For mechanical systems with Lagrangian (8) where the mass matrix is invertible, relation (19c) yields \(\mbox{$\mathbf {M}$} ( \mbox{$\boldsymbol {q}$} )^{\mathrm{-1}} \mbox{$\boldsymbol {p}$} = \mbox{$\boldsymbol {v}$} \). Then, (19a), (19b), and (19d) directly lead to the canonical Hamiltonian equations of motion (16a)–(16c). Moreover, in this case, the generalized energy function can be identified as the Hamiltonian, such that \(E( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} ( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {p}$} ), \mbox{$\boldsymbol {p}$} ) = H( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {p}$} )\).

3 Unit quaternions for rigid body rotations

In this section, we briefly introduce the notion of unit quaternions (or Euler parameters) and their application for rigid body rotations. Section 3.3 represents the core of the underlying work: We show that the naturally emerging singular mass matrix can be directly used for simulation when using Livens’ principle (see Chap. 2).

3.1 Unit quaternions

A quaternion qH R 4 can be considered as a 4-tuple combining a scalar part \(q_{0} \in \mathbb{R}\) and a vector part \(\mbox{$\boldsymbol {q}$} \in \mathbb{R}^{3}\) with components \(q_{i}\). Correspondingly, we use the notation q=( q 0 ,q), which is equivalent to

q= [ q 0 q ] = [ q 0 q 1 q 2 q 3 ] .
(27)

Moreover, quaternion multiplication for two quaternions q,pH is defined as

qp= [ q 0 p 0 q p q 0 p + p 0 q + q × p ] .
(28)

Multiplication (28) is not commutative due to the presence of the cross-product within the vector-part, but associative, i.e., abc=(ab)c=a(bc). The identity element for multiplication such that qe=eq=q, is given by e=(1, 0 3 × 1 ). Additionally, the conjugate quaternion is given by q =( q 0 ,q), and it can be shown that q p = p q . The Euclidean norm of a quaternion is computed via

q= q q = q 0 2 + q q = q 0 2 + q 1 2 + q 2 2 + q 3 3 .
(29)

Especially helpful is the notion of unit quaternions. Unit quaternions are a subset of all quaternions satisfying the unit length condition q=1qq=1q q = q q=e, which can be recast as

g 1 (q)= 1 2 (qq1)=0,
(30)

with the corresponding group of unity quaternions \(Sp(1)\), the symplectic group, which can be identified with the 4-dimensional unit hypersphere

S 3 ={q R 4 : g 1 (q)=0}.
(31)

For a detailed introduction to quaternions, we refer to [1, 36].

3.2 Linear algebra representation

It is quite handy to define certain matrix operations in order to recast the quaternion multiplication (28). Thus, following [36], we make use of the representation given by

ab= Q l (a)b= Q r (b)a
(32)

with the \(4 \times 4\) matrices

(33a)
(33b)

the inverses of which can be found in (134). In (33a)–(33b), there are moreover the quantities

$$\begin{aligned} \mbox{$\boldsymbol {a}$} ^{+} := \begin{bmatrix} 0 & & - \mbox{$\boldsymbol {a}$} ^{\mkern -1.5mu\mathsf {T}}\\ \mbox{$\boldsymbol {a}$} & & \widehat{ \mbox{$\mathbf {a}$} } \end{bmatrix} \text{,} \quad \mbox{$\boldsymbol {b}$} ^{-} := \begin{bmatrix} 0 & & - \mbox{$\boldsymbol {b}$} ^{\mkern -1.5mu\mathsf {T}}\\ \mbox{$\boldsymbol {b}$} & & -\widehat{ \mbox{$\mathbf {b}$} } \end{bmatrix} \end{aligned}$$
(34)

defined, as well as the \(3 \times 4\) matrices

G(a):= [ a a 0 I 3 × 3 a ˆ ] ,
(35a)
E(b):= [ b b 0 I 3 × 3 + b ˆ ] .
(35b)

Remember the widehat-notation (2). The linear algebra representation (32) can also be written as the exponential map [7, 56] with

Q l (a)= exp O ( 4 ) ( 1 2 a + ) =cos ( 1 2 | | a | | ) I 4 × 4 + sin ( 1 2 | | a | | ) | | a | | a + .
(36)

3.3 Rotational dynamics of rigid bodies

Consider a rigid body undergoing a pure rotation about the origin \(O\) of an orthonormal frame \(\{ \mbox{$\boldsymbol {e}$} _{i}\}\). The reference configuration occupies the regular domain ℬ, and every point is uniquely defined by its material vector \(\mbox{$\boldsymbol {X}$} = X_{i} \mbox{$\boldsymbol {e}$} _{i} \in \mathcal{B}\). For simplicity, we assume \(O\) to be the center of mass and \(\mbox{$\boldsymbol {e}$} _{i}\) coincides with the principal axes of ℬ. During motion the spatial position may be addressed via \(\mbox{$\boldsymbol {x}$} ( \mbox{$\boldsymbol {X}$} ,t) = \mbox{$\mathbf {R}$} (t) \mbox{$\boldsymbol {X}$} \), where the rotation matrix \(\mbox{$\mathbf {R}$} = \mbox{$\mathbf {R}$} ^{\mkern -1.5mu\mathsf {-T}}\in SO(3)\), the special orthogonal group in three dimensions, describes the time-dependency of a local (body-fixed) frame \(\{ \mbox{$\boldsymbol {d}$} _{i}\}\) as \(\mbox{$\boldsymbol {d}$} _{i}(t) = \mbox{$\mathbf {R}$} (t) \mbox{$\boldsymbol {e}$} _{i}\). The body’s kinetic energy is therefore given by

$$\begin{aligned} T(t) = \int _{\mathcal{B}} \rho _{0}( \mbox{$\boldsymbol {X}$} ) \dot{ \mbox{$\boldsymbol {x}$} }( \mbox{$\boldsymbol {X}$} ,t) \cdot \dot{ \mbox{$\boldsymbol {x}$} }( \mbox{$\boldsymbol {X}$} ,t) \,\mathrm {d} V \text{,} \end{aligned}$$
(37)

where \(\rho _{0} : \mathcal{B} \rightarrow \mathbb{R}_{+}\) denotes the material mass density and \(\dot{ \mbox{$\boldsymbol {x}$} }( \mbox{$\boldsymbol {X}$} ,t) = \dot{ \mbox{$\mathbf {R}$} }(t) \mbox{$\boldsymbol {X}$} \) is a material velocity vector. It is common to describe the rotational motion in terms of angular velocity vectors, e.g., using the spatial angular velocity \(\mbox{$\boldsymbol {\omega}$} \) such that \(\dot{ \mbox{$\boldsymbol {x}$} }( \mbox{$\boldsymbol {X}$} ,t) = \mbox{$\boldsymbol {\omega}$} (t) \times \mbox{$\boldsymbol {x}$} ( \mbox{$\boldsymbol {X}$} ,t) = \widehat{ \mbox{$\boldsymbol {\omega}$} } \mbox{$\boldsymbol {x}$} \). Using the relation \(\mbox{$\boldsymbol {\omega}$} = \mbox{$\mathbf {R}$} \mbox{$\boldsymbol {\Omega}$} \), the convective counterpart, the material representation \(\mbox{$\boldsymbol {\Omega}$} \) of the angular velocity is obtained. Note the important relation \(\dot{ \mbox{$\mathbf {R}$} } = \mbox{$\mathbf {R}$} \widehat{ \mbox{$\boldsymbol {\Omega}$} } = \widehat{ \mbox{$\boldsymbol {\omega}$} } \mbox{$\mathbf {R}$} \), which leads to \(\dot{ \mbox{$\boldsymbol {x}$} } = \mbox{$\mathbf {R}$} \widehat{ \mbox{$\boldsymbol {\Omega}$} } \mbox{$\boldsymbol {X}$} = - \mbox{$\mathbf {R}$} \widehat{ \mbox{$\boldsymbol {X}$} } \mbox{$\boldsymbol {\Omega}$} \). Plugging this into (37) eventually leads to another representation of the kinetic energy in terms of the convective angular velocity (see, e.g., [9])

$$\begin{aligned} T(t) = \tilde{T}( \mbox{$\boldsymbol {\Omega}$} (t)) = \frac{1}{2} \mbox{$\boldsymbol {\Omega}$} (t) \cdot \mbox{$\mathbf {J}$} _{0} \mbox{$\boldsymbol {\Omega}$} (t) \text{,} \end{aligned}$$
(38)

with the convected inertia tensor

$$\begin{aligned} \mbox{$\mathbf {J}$} _{0} := -\int _{\mathcal{B}} \widehat{ \mbox{$\boldsymbol {X}$} }^{2} \rho _{0}( \mbox{$\boldsymbol {X}$} ) \,\mathrm {d} V = \int _{\mathcal{B}} \left ( ( \mbox{$\boldsymbol {X}$} \cdot \mbox{$\boldsymbol {X}$} ) \mbox{$\boldsymbol {I}$} - \mbox{$\boldsymbol {X}$} \otimes \mbox{$\boldsymbol {X}$} \right ) \rho _{0}( \mbox{$\boldsymbol {X}$} ) \,\mathrm {d} V = \sum _{i=1}^{3} J_{0}^{i} \mbox{$\boldsymbol {e}$} _{i} \otimes \mbox{$\boldsymbol {e}$} _{i} \text{,} \end{aligned}$$
(39)

which can be diagonalized using its principal values \(J_{0}^{i}\).

An important result from Euler’s theorem of rotations [16] is that any rotation of a rigid body may be specified by a rotation axis and a rotation angle, such that the rotation vector is given by \({\boldsymbol {\vartheta}} = \vartheta \mbox{$\boldsymbol {n}$} \) with the unit vector \(\mbox{$\boldsymbol {n}$} = {\boldsymbol {\vartheta}}/\mathopen{\lVert }{\boldsymbol {\vartheta}}\mathclose{\rVert } \in S^{2}\), the unit sphere in \(\mathbb{R}^{3}\), and the rotation angle \(\vartheta = \mathopen{\lVert }{\boldsymbol {\vartheta}}\mathclose{\rVert } \in \mathbb{R}\). The unit quaternion describing this rotation is obtained by using the appropriate exponential map (see [56]) yielding

q= exp S 3 ( [ 0 1 2 ϑ ] ) = [ cos ( ϑ / 2 ) sin ( ϑ / 2 ) n ] .
(40)

This relation has given unit quaternions an alternative name: Euler parameters. This has led to the development to parameterize rigid body rotations by using unit quaternions q=( q 0 ,q) S 3 , i.e., it satisfies the holonomic unity constraint (30) at all times. Remembering (5), this induces hidden (velocity-level) constraints as

d d t g(q)=g(q) q ˙ =q q ˙ =0,
(41)

such that the tangent space is defined via

T q S 3 ={vH:qv=0}.
(42)

The velocity constraint (41) can alternatively be written as q ˙ q+ q q ˙ =(0,0). Based on this representation, it can be shown that the convective angular velocity \(\mbox{$\boldsymbol {\Omega}$} \) satisfies (0, 1 2 Ω)= q q ˙ , see [8] for the details. Correspondingly, the convective angular velocity \(\mbox{$\boldsymbol {\Omega}$} \) and its spatial counterpart \(\mbox{$\boldsymbol {\omega}$} \) can be written as

Ω ( q , v ) = 2 G ( q ) v = 2 G ( v ) q , ω ( q , v ) = 2 E ( q ) v = 2 E ( v ) q
(43)

and the inverse relations

(44)

which can be verified using (135). As core of this work, we can now rewrite the kinetic energy (38) in terms of unit quaternions and their velocities as

T(q,v)= T ˜ (Ω(q,v))= 1 2 v M ˜ 4 (q)v
(45)

along with the \(4 \times 4\) mass matrix

(46)

which is singular for all (q,v) since G(q) has rank three. Thus also \(\tilde{ \mbox{$\mathbf {M}$} }_{4}\) has only rank three. While many works need to avoid the singularity of the mass matrix for example by augmenting it, this does not bother us when making use of Livens’ principle. For the rotational dynamics, Livens’ equations of motion become

q ˙ =v,
(47a)
p ˙ = q L(q,v)λg(q),
(47b)
p= v L(q,v),
(47c)
0=g(q).
(47d)

The two partial derivatives read

(48a)
v L= M ˜ 4 (q)v,
(48b)

where we additionally allow for potential forces, e.g., due to gravity.

Remark 3.1

We refer to [7] for an insightful discourse on how to perform the transition from a rotation matrix \(\mbox{$\mathbf {R}$} \in SO(3)\) to unit quaternions. In this context the rotation of a vector \({\boldsymbol {\xi}} \in \mathbb{R}^{3}\) can be described by

(0,R(q)ξ)=q(0,ξ) q .
(49)

Consequently, the rotation matrix can be linked to the quaternion representation and its transformation matrices (35a)–(35b) via

(50)

Making use of (136), it can be checked that this automatically ensures the proper orthogonality of the rotation matrix. In terms of the quaternion components the rotation matrix eventually reads

R(q)= [ q 0 2 + q 1 2 q 2 2 q 3 2 2 ( q 1 q 2 q 0 q 3 ) 2 ( q 1 q 3 + q 0 q 2 ) 2 ( q 2 q 1 + q 0 q 3 ) q 0 2 q 1 2 + q 2 2 q 3 2 2 ( q 2 q 3 q 0 q 1 ) 2 ( q 3 q 1 q 0 q 2 ) 2 ( q 3 q 2 + q 0 q 1 ) q 0 2 q 1 2 q 2 2 + q 3 2 ] ,
(51)

see, e.g., [47]. This relation can also be obtained using the Rodrigues formula (see, e.g., [11, 47])

$$\begin{aligned} \mbox{$\mathbf {R}$} (\vartheta \mbox{$\boldsymbol {n}$} ) = \cos (\vartheta ) \mbox{$\boldsymbol {I}$} _{3 \times 3} + (1- \cos (\vartheta )) \mbox{$\boldsymbol {n}$} \otimes \mbox{$\boldsymbol {n}$} + \sin (\vartheta ) \widehat{ \mbox{$\boldsymbol {n}$} } \text{,} \end{aligned}$$
(52)

featuring the angle-axis representation from (40) and making use of double-angle formulas.

3.4 Conservation of angular momentum

Here, we show the invariance of the kinetic energy of a rigid body (45) with respect to superposed rotations. In accordance with Noether’s theorem, this leads to a conserved quantity, the angular momentum (see Proposition 2.6). To this end, consider a one-parameter family of rigid body rotations about the axis defined by \({\boldsymbol {\xi}\in \mathbb{R}^{3}}\) given by x α = exp S 3 (0,αξ), see (40), such that

q α = x α q= Q l ( x α )q,
(53a)
v α = x α v= Q l ( x α )v.
(53b)

Corollary 3.2

The convective angular velocity (43) is invariant under superposed rotations such that

Ω α =Ω( q α , v α )=Ω(q,v)=Ω.
(54)

This induces the symmetry

T ˜ ( Ω α )= T ˜ (Ω)T( q α , v α )=T(q,v)
(55)

for the kinetic energy of the rigid body.

Proof

We demonstrate that

q α v α = x α q ( x α v)= q ( x α x α )v= q v,
(56)

which is identical with

(57)

In view of (33a)–(33b) this implies

G( q α ) v α =G(q)v, q α v α =qv,
(58)

which concludes the proof due to definition (43). □

We now want to highlight that under certain assumptions Corollary 3.2 induces symmetry of the total dynamical system, in correspondence with Proposition 2.6.

Proposition 3.3

Given the rotational invariance of the potential energy, i.e., V( q α )=V(q), the rotational dynamics of a rigid body has symmetry in the sense of

L( q α , v α )=L(q,v),g( q α )=g(q),
(59)

where the constraint is given by the unity constraint of quaternions (30).

Proof

In view of (134), one can define the constraint invariant

η( q α )= q α q α =qq=η(q).
(60)

This proves the second symmetry condition. The first one follows from the assumption as well as Corollary 3.2. □

Corresponding to (59), there are infinitesimal invariance conditions given by

d d α | α = 0 L ( exp O ( 4 ) ( α 2 ξ + ) q , exp O ( 4 ) ( α 2 ξ + ) v ) =0
(61)
d d α | α = 0 g ( exp O ( 4 ) ( α 2 ξ + ) q ) =0,
(62)

which make use of the exponential map (36). Applying the chain rule, taking the sum, and making use of the definition of an augmented Lagrangian (9), this yields

1 2 q L λ ξ + q 1 2 v ξ + p=0.
(63)

Proposition 3.4

The angular momentumFootnote 2 (see [7])

L(q,p)= 1 2 E(q)p
(64)

is preserved about a symmetry axis defined by \(\textit{$\boldsymbol {\xi}$} \). The corresponding momentum map is given by

(65)

and satisfies \(\frac{ \,\mathrm {d} }{ \,\mathrm {d} t}L_{\boldsymbol {\xi}} =0\).

Proof

Executing the time derivative yields

d d t (L(q,p)ξ)= q L ξ q ˙ + p L ξ p ˙ = q L ξ v+ p L ξ q L λ =0
(66)

and can be compared with (63). This leads us to the conditions

1 2 ξ + q= p L ξ , 1 2 ξ + p= q L ξ ,
(67a)

conforming with the angular momentum map (65). □

4 Structure-preserving discretization

In this section, a novel integration method, which conserves first integrals of the equations of motion pertaining to Livens’ principle, e.g., the generalized energy function \(E\), is proposed. This scheme results from a direct discretization of the Euler–Lagrange equations (19a)–(19d) emanating from Livens’ principle with constraints. Particularly, discrete derivatives are used, and we focus on the ones in the sense of Gonzalez [21]. The scheme is specified for rigid body rotations using unit quaternions. In addition to that, we propose a size reduction procedure to enhance computational efficiency.

For the discretization in time, the time interval of interest is divided into \(N \in \mathbb{N}\) subintervals, i.e.,

$$\begin{aligned} \mathcal{T} = [0, t_{\mathrm{end}}] = \bigcup _{n=0}^{N-1} [t^{n}, t ^{n+1}] \end{aligned}$$
(68)

of constant time step size \(h \in \mathbb{R}\), with \(t^{n}= n h\). Correspondingly, approximations at the discrete points in time are addressed via \(\square ^{n}\approx \square (t^{n})\) and \(t^{n+1}\) is referred to as endpoint of the respective time interval.

4.1 Discrete gradients

Discrete gradients are a popular tool for generating geometric integration methods for dynamical systems. A general definition is as follows.

Definition 4.1

Discrete gradients, see [24]

Given a function \(f : \mathbb{R}^{n} \rightarrow \mathbb{R} \), an operator \(\overline {\nabla } : \mathbb{R}^{n} \times \mathbb{R}^{n} \rightarrow \mathbb{R}^{n} \) is called discrete gradient if it is a continuous function satisfying

  1. 1.

    Directionality

    $$\begin{aligned} \overline {\nabla } f( \mbox{$\boldsymbol {x}$} , \mbox{$\boldsymbol {y}$} ) \cdot ( \mbox{$\boldsymbol {y}$} - \mbox{$\boldsymbol {x}$} ) = f( \mbox{$\boldsymbol {y}$} ) -f ( \mbox{$\boldsymbol {x}$} ) \text{,} \end{aligned}$$
    (69)
  2. 2.

    Consistency

    $$\begin{aligned} \overline {\nabla } f\left ( \mbox{$\boldsymbol {x}$} , \mbox{$\boldsymbol {x}$} \right ) = \nabla f\left ( \mbox{$\boldsymbol {x}$} \right ) \text{.} \end{aligned}$$
    (70)

In particular, we restrict ourselves to a specific type of discrete gradients, which can yield symmetric methods of second order accuracy, as they represent second-order approximations to the exact gradients.

Definition 4.2

Gonzalez discrete gradient, see [21]

For a given function \(f : \mathbb{R}^{n} \rightarrow \mathbb{R} \), the Gonzalez (or midpoint) discrete gradient \(\overline {\nabla } : \mathbb{R}^{n} \times \mathbb{R}^{n} \rightarrow \mathbb{R}^{n} \) is defined by

$$\begin{aligned} \overline {\nabla } f( \mbox{$\boldsymbol {x}$} , \mbox{$\boldsymbol {y}$} ) = \nabla f\left (\frac{ \mbox{$\boldsymbol {x}$} + \mbox{$\boldsymbol {y}$} }{2}\right ) + \frac{f( \mbox{$\boldsymbol {y}$} ) - f( \mbox{$\boldsymbol {x}$} ) - \nabla f \left ( \frac{1}{2}( \mbox{$\boldsymbol {x}$} + \mbox{$\boldsymbol {y}$} )\right ) \cdot ( \mbox{$\boldsymbol {y}$} - \mbox{$\boldsymbol {x}$} ) }{ || \mbox{$\boldsymbol {y}$} - \mbox{$\boldsymbol {x}$} ||^{2} } ( \mbox{$\boldsymbol {y}$} - \mbox{$\boldsymbol {x}$} ) \text{.} \end{aligned}$$
(71)

4.2 Livens-based energy-momentum integrator

We are now in a position to discretize the Euler–Lagrange equations from Livens’ principle (19a)–(19d) in time, using Gonzalez discrete derivatives (71). Specifically, partial discrete derivatives are used. Moreover, temporal derivatives are approximated in terms of difference quotients, and the constraint functions are evaluated in the endpoint \(t^{n+1}\).

Thus, we propose the energy-momentum (EM) integrator, governed by

$$\begin{aligned} \mbox{$\boldsymbol {q}$} ^{n+1}- \mbox{$\boldsymbol {q}$} ^{n}& = h \, \mbox{$\boldsymbol {v}$} ^{n+1/2} , \end{aligned}$$
(72a)
$$\begin{aligned} \mbox{$\boldsymbol {p}$} ^{n+1}- \mbox{$\boldsymbol {p}$} ^{n}& = h \overline {\partial } _{ \mbox{$\boldsymbol {q}$} } L( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} ) - h\, \sum _{k=1}^{m} \lambda _{k} \overline {\nabla } g_{k}( \mbox{$\boldsymbol {q}$} ) , \end{aligned}$$
(72b)
$$\begin{aligned} \mbox{$\boldsymbol {p}$} ^{n+1/2}& = \overline {\partial } _{ \mbox{$\boldsymbol {v}$} } L( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} ) , \end{aligned}$$
(72c)
$$\begin{aligned} \mbox{$\boldsymbol {g}$} ( \mbox{$\boldsymbol {q}$} ^{n+1}) & = \mbox{$\boldsymbol {0}$} , \end{aligned}$$
(72d)

where we use midpoint interpolations \(\mbox{$\boldsymbol {v}$} ^{n+1/2}= \frac{1}{2}( \mbox{$\boldsymbol {v}$} ^{n}+ \mbox{$\boldsymbol {v}$} ^{n+1})\) and \(\mbox{$\boldsymbol {p}$} ^{n+1/2}= \frac{1}{2}( \mbox{$\boldsymbol {p}$} ^{n}+ \mbox{$\boldsymbol {p}$} ^{n+1})\). Moreover, \(\overline {\partial } _{ \mbox{$\boldsymbol {q}$} }\) and \(\overline {\partial } _{ \mbox{$\boldsymbol {v}$} }\) denote the partitioned discrete derivatives, which are described for the sake of completeness in Appendix A. Directionality condition (69) extends to partitioned discrete derivatives such that

$$\begin{aligned} \overline {\partial } _{ \mbox{$\boldsymbol {q}$} } L( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} ) \cdot \Delta \mbox{$\boldsymbol {q}$} + \overline {\partial } _{ \mbox{$\boldsymbol {v}$} } L( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} ) \cdot \Delta \mbox{$\boldsymbol {v}$} = L( \mbox{$\boldsymbol {q}$} ^{n+1}, \mbox{$\boldsymbol {v}$} ^{n+1}) - L( \mbox{$\boldsymbol {q}$} ^{n}, \mbox{$\boldsymbol {v}$} ^{n}) , \end{aligned}$$
(73)

where \(\Delta \mbox{$\boldsymbol {q}$} = \mbox{$\boldsymbol {q}$} ^{n+1}- \mbox{$\boldsymbol {q}$} ^{n}\) and \(\Delta \mbox{$\boldsymbol {v}$} = \mbox{$\boldsymbol {v}$} ^{n+1}- \mbox{$\boldsymbol {v}$} ^{n}\).

Definition 4.3

A discrete version of the generalized energy function (20) is given by

$$\begin{aligned} E^{n}& = \mbox{$\boldsymbol {p}$} ^{n}\cdot \mbox{$\boldsymbol {v}$} ^{n}- \frac{1}{2} \mbox{$\boldsymbol {v}$} ^{n}\cdot \mbox{$\mathbf {M}$} ( \mbox{$\boldsymbol {q}$} ^{n}) \mbox{$\boldsymbol {v}$} ^{n}+ V( \mbox{$\boldsymbol {q}$} ^{n}) . \end{aligned}$$
(74)

Proposition 4.4

The discrete-time generalized energy (74) is conserved by time-stepping method (72a)(72d).

Proof

Scalar multiplying (72b) with \(\Delta \mbox{$\boldsymbol {q}$} \) and adding the scalar product of (72c) with \(\Delta \mbox{$\boldsymbol {v}$} \) yields

$$\begin{aligned} &( \mbox{$\boldsymbol {p}$} ^{n+1}- \mbox{$\boldsymbol {p}$} ^{n}) \cdot ( \mbox{$\boldsymbol {q}$} ^{n+1}- \mbox{$\boldsymbol {q}$} ^{n}) + h \, \mbox{$\boldsymbol {p}$} ^{n+1/2}\cdot ( \mbox{$\boldsymbol {v}$} ^{n+1}- \mbox{$\boldsymbol {v}$} ^{n}) \\ &\quad =h \, \overline {\partial } _{ \mbox{$\boldsymbol {q}$} } L( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} ) \cdot ( \mbox{$\boldsymbol {q}$} ^{n+1}- \mbox{$\boldsymbol {q}$} ^{n}) - h\, \sum _{k=1}^{m} \lambda _{k} \overline {\nabla } g_{k}( \mbox{$\boldsymbol {q}$} ) \cdot ( \mbox{$\boldsymbol {q}$} ^{n+1}- \mbox{$\boldsymbol {q}$} ^{n}) + \overline {\partial } _{ \mbox{$\boldsymbol {v}$} } L( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} ) \cdot ( \mbox{$\boldsymbol {v}$} ^{n+1}- \mbox{$\boldsymbol {v}$} ^{n}). \end{aligned}$$
(75)

Inserting (72a) and making use of the directionality property gives

$$\begin{aligned} ( \mbox{$\boldsymbol {p}$} ^{n+1}- \mbox{$\boldsymbol {p}$} ^{n}) \cdot \mbox{$\boldsymbol {v}$} ^{n+1/2}+ \mbox{$\boldsymbol {p}$} ^{n+1/2}\cdot ( \mbox{$\boldsymbol {v}$} ^{n+1}- \mbox{$\boldsymbol {v}$} ^{n}) & = L( \mbox{$\boldsymbol {q}$} ^{n+1}, \mbox{$\boldsymbol {v}$} ^{n+1}) - L( \mbox{$\boldsymbol {q}$} ^{n}, \mbox{$\boldsymbol {v}$} ^{n}) \\ & \qquad \qquad - \sum _{k=1}^{m} \lambda _{k} \left (g_{k}( \mbox{$\boldsymbol {q}$} ^{n+1})-g_{k}( \mbox{$\boldsymbol {q}$} ^{n})\right ) . \end{aligned}$$
(76)

After cancelling some terms on the left-hand side of the previous relation and taking into account that the constraints are identically satisfied in each time step (see (72d)), one eventually arrives at

$$\begin{aligned} E^{n+1}- E^{n}= 0 \text{,} \end{aligned}$$
(77)

which concludes the proof. □

Remark 4.5

In compliance with Noether’s theorem (see Proposition 2.6), the present integrator preserves momentum maps also in the discrete setting, i.e.,

$$\begin{aligned} L_{\boldsymbol {\xi}} ^{n+1}- L_{\boldsymbol {\xi}} ^{n}= 0 \text{.} \end{aligned}$$
(78)

See Sect. 4.4 for the proof of the preserved angular momentum map for rigid body rotations. An analogous proof for the general case can be found in [32].

Proposition 4.6

The discrete fiber derivative (72c) in general does not imply a pointwise fulfillment of the continuous fiber derivative. That is, \(\textit{$\boldsymbol {p}$} ^{n}= \textit{$\mathbf {M}$} ( \textit{$\boldsymbol {q}$} ^{n}) \textit{$\boldsymbol {v}$} ^{n}\) does not hold in general. However, the relation \(\textit{$\boldsymbol {p}$} ^{n}= \textit{$\mathbf {M}$} \textit{$\boldsymbol {v}$} ^{n}\) is satisfied for constant mass matrices. As a consequence, the discretized Hamiltonian

$$\begin{aligned} H^{n}= \frac{1}{2} \textit{$\boldsymbol {p}$} ^{n}\cdot \textit{$\mathbf {M}$} ( \textit{$\boldsymbol {q}$} ^{n})^{\mathrm{-1}} \textit{$\boldsymbol {p}$} ^{n}+ V( \textit{$\boldsymbol {q}$} ^{n}) \end{aligned}$$
(79)

and the discrete total energy

$$\begin{aligned} E_{\mathrm{tot}}^{n}= \frac{1}{2} \textit{$\boldsymbol {v}$} ^{n}\cdot \textit{$\mathbf {M}$} ( \textit{$\boldsymbol {q}$} ^{n}) \textit{$\boldsymbol {v}$} ^{n}+ V( \textit{$\boldsymbol {q}$} ^{n}) \end{aligned}$$
(80)

are only identical to the discrete energy function (74) if the mass matrix is constant.

Proof

With the kinetic energy from (8) it can be verified that

$$\begin{aligned} \partial _{ \mbox{$\boldsymbol {v}$} } T( \mbox{$\boldsymbol {q}$} ^{n}, \mbox{$\boldsymbol {v}$} ^{n+1/2}) & = \mbox{$\mathbf {M}$} ( \mbox{$\boldsymbol {q}$} ^{n}) \mbox{$\boldsymbol {v}$} ^{n+1/2}, \end{aligned}$$
(81)
$$\begin{aligned} \partial _{ \mbox{$\boldsymbol {v}$} } T( \mbox{$\boldsymbol {q}$} ^{n+1}, \mbox{$\boldsymbol {v}$} ^{n+1/2}) & = \mbox{$\mathbf {M}$} ( \mbox{$\boldsymbol {q}$} ^{n+1}) \mbox{$\boldsymbol {v}$} ^{n+1/2}, \end{aligned}$$
(82)

such that with the discrete gradient design from Appendix A, eventually

$$\begin{aligned} \overline {\partial } _{ \mbox{$\boldsymbol {v}$} } T ( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} ) & = \frac{1}{2} \left ( \mbox{$\mathbf {M}$} ( \mbox{$\boldsymbol {q}$} ^{n}) + \mbox{$\mathbf {M}$} ( \mbox{$\boldsymbol {q}$} ^{n+1}) \right ) \mbox{$\boldsymbol {v}$} ^{n+1/2}. \end{aligned}$$
(83)

Consequently, the discrete fiber derivative (72c) yields

$$\begin{aligned} \mbox{$\boldsymbol {p}$} ^{n+1/2}& = \frac{1}{2} \left ( \mbox{$\mathbf {M}$} ( \mbox{$\boldsymbol {q}$} ^{n}) + \mbox{$\mathbf {M}$} ( \mbox{$\boldsymbol {q}$} ^{n+1}) \right ) \mbox{$\boldsymbol {v}$} ^{n+1/2}. \end{aligned}$$
(84)

In the case of a constant mass matrix, the discrete derivative is given by \(\overline {\partial } _{ \mbox{$\boldsymbol {v}$} } T ( \mbox{$\boldsymbol {q}$} , \mbox{$\boldsymbol {v}$} ) = \mbox{$\mathbf {M}$} \mbox{$\boldsymbol {v}$} ^{n+1/2}\). Accordingly, the discrete fiber derivative (72c) yields \(\mbox{$\boldsymbol {p}$} ^{n+1/2}= \mbox{$\mathbf {M}$} \mbox{$\boldsymbol {v}$} ^{n+1/2}\). Consequently, provided that \(\mbox{$\boldsymbol {p}$} ^{n}= \mbox{$\mathbf {M}$} \mbox{$\boldsymbol {v}$} ^{n}\) is satisfied, \(\mbox{$\boldsymbol {p}$} ^{n+1}= \mbox{$\mathbf {M}$} \mbox{$\boldsymbol {v}$} ^{n+1}\) is fulfilled, too. Assuming that consistent initial values are chosen, such that \(\mbox{$\boldsymbol {p}$} ^{0} = \mbox{$\mathbf {M}$} ( \mbox{$\boldsymbol {q}$} ^{0}) \mbox{$\boldsymbol {v}$} ^{0}\), by (84), the proposition has been proven. □

Remark 4.7

Discrete time equivalence to Lagrangian methods

As a consequence of Proposition (4.6), one can show that the proposed Livens-based EM method (72a)–(72d) can be written as a Lagrangian scheme if the mass matrix is constant. The scheme reads

$$ \begin{aligned} \mbox{$\boldsymbol {q}$} ^{n+1}- \mbox{$\boldsymbol {q}$} ^{n}& = h \, \mbox{$\boldsymbol {v}$} ^{n+1/2} \text{,} \\ \mbox{$\mathbf {M}$} ( \mbox{$\boldsymbol {v}$} ^{n+1}- \mbox{$\boldsymbol {v}$} ^{n}) & = h \overline {\nabla } V( \mbox{$\boldsymbol {q}$} ) - h\, \sum _{k=1}^{m} \lambda _{k} \overline {\nabla } g_{k}( \mbox{$\boldsymbol {q}$} ) \text{,} \\ \mbox{$\boldsymbol {g}$} ( \mbox{$\boldsymbol {q}$} ^{n+1}) & = \mbox{$\boldsymbol {0}$} \end{aligned} $$
(85)

and represents a direct approximation of (26a)–(26c). Due to the mixed nature of the discrete fiber derivative (84), there exists no such equivalence if the mass matrix depends on the generalized coordinates. In this case, an EM-consistent method cannot be derived in a Lagrangian framework in a straightforward way.

4.3 Application to rigid body rotations

For the rotational dynamics of rigid bodies in terms of Livens’ principle and unit quaternions, governed by (47a)–(47d), the method is specified by

q n + 1 q n =h v n + 1 / 2 ,
(86a)
p n + 1 p n =h q Thλ g,
(86b)
p n + 1 / 2 = v T,
(86c)
g( q n + 1 )=0.
(86d)

Since the kinetic energy may be formulated in terms of one invariant quantity, the convective angular velocity, see Corollary 3.2, the partitioned discrete derivatives for the present case become

(87)

where

Ω n + 1 / 2 = 1 2 ( Ω n + Ω n + 1 )=G( q n ) v n +G( q n + 1 ) v n + 1 ,
(88)

which differs from Ω( q n + 1 / 2 , v n + 1 / 2 ). We refer to [21] for more details on so-called G-equivariant discrete gradients. It can be shown that the specification above satisfies the directionality condition

q T ( q n + 1 q n ) + v T ( v n + 1 v n ) = T ˜ Ω n + 1 / 2 ( Ω q | n + 1 / 2 ( q n + 1 q n ) + Ω v | n + 1 / 2 ( v n + 1 v n ) ) = T ˜ Ω n + 1 / 2 ( Ω n + 1 Ω n ) = T ˜ ( Ω n + 1 ) T ˜ ( Ω n ) .
(89)

Note that we have taken into account the fact that \(\mbox{$\boldsymbol {\Omega}$} \) is bilinear in q and v, see (88), and that \(\tilde{T}( \mbox{$\boldsymbol {\Omega}$} )\) is a quadratic function, see (38). Moreover, the integrator meets the orthogonality conditions (see [21])

q L ξ + q n + 1 / 2 + v L ξ + v n + 1 / 2 =0,
(90)
g ξ + q n + 1 / 2 =0
(91)

pertaining to the symmetry conditions in continuous time (61). Making use of the augmented Lagrangian (9), the last two equations yield

q L λ ξ + q n + 1 / 2 + v L λ ξ + v n + 1 / 2 =0.
(92)

Lastly, due to the quadratic structure of the unity constraint (30), its discrete gradient can be introduced as

g=g( q n + 1 / 2 )= q n + 1 / 2 .
(93)

Remark 4.8

The present method satisfies the velocity constraint (41) in the midpoint \(t^{n+1/2}\) but not in the endpoint. This can be derived from the premultiplication of (86a) with q n + 1 / 2 and using the normality condition (86d) such that

h q n + 1 / 2 v n + 1 / 2 = 1 2 ( q n + 1 q n + 1 q n q n ) =0.
(94)

Assuming q n v n =0, one arrives at

q n + 1 v n + 1 = q n + 1 v n + q n v n + 1 0.
(95)

Consequently, this method should not be applied to the augmented system with regular mass matrix (140). See also Remark D.1. This has no negative impact if the scheme is applied, as recommended, to the system with singular mass matrix (46).

4.4 Conservation principles in discrete time

Proposition 4.9

The generalized energy function is a conserved quantity in discrete time, provided by solutions of (86a)(86d), viz.

$$\begin{aligned} E^{n+1}- E^{n}& = 0 \textit{.} \end{aligned}$$
(96)

Proof

Multiplying (86b) with ( q n + 1 q n ), adding (86c) multiplied by ( v n + 1 v n ), and inserting (86a) leads to

p n + 1 v n + 1 p n v n = q T( q n + 1 q n )+ v T( v n + 1 v n )λ g( q n + 1 q n ),
(97)

which, using (86d), and making use of the directionality condition (89), yields

p n + 1 v n + 1 p n v n = T n + 1 T n ,
(98)

which confirms the proposition. □

Proposition 4.10

The angular momentum map (65) is a conserved quantity in discrete time, provided by solutions of (86a)(86d).

Proof

It can be shown that

L ξ n + 1 L ξ n = 1 2 ( p n + 1 p n ) ξ + q n + 1 / 2 1 2 ( q n + 1 q n ) ξ + p n + 1 / 2 .
(99)

Inserting (86a), (86b), and (86c) yields

L ξ n + 1 L ξ n = h 2 ( q L λ ξ + q n + 1 / 2 + v L λ ξ + v n + 1 / 2 ) =0,
(100)

which is zero due to (92). □

4.5 Size reduction procedures

To obtain the mentioned beneficial numerical properties without the drawback of an increased numerical effort due to the enhanced state space with independent velocities and momenta, an implementation variant is proposed. We perform a size reduction such that the scheme can be enhanced to increase computational efficiency. By eliminating p n + 1 and v n + 1 from the set of unknowns in the implementation, we reduce the amount of nonlinear equations to be solved in each time step. From (86a) we can determine

v n + 1 = v ˜ n + 1 ( q n + 1 )= 2 h ( q n + 1 q n ) v n ,
(101)

and (86c) serves to recast

p n + 1 = p ˜ n + 1 ( q n + 1 , v ˜ n + 1 ( q n + 1 ))=2 v T p n .
(102)

By inserting these relations into (86b), together with (86d) we end up with five nonlinear equations

R 1 ( q n + 1 , λ ) = 0 4 × 1 R 2 ( q n + 1 ) = 0 ,
(103)

for five unknowns, namely four components of the quaternion and one scalar value for the Lagrange multiplier. After solving (103), equations (101) and (102) yield the updated velocities and momenta.

Remark 4.11

Discrete null-space method

An alternative size reduction procedure is given by a discrete null-space method [5] along the lines of Sect. 4.5 in [7]. It consists of an elimination of the Lagrange multiplier and a replacement of q n + 1 by an incremental rotation vector \({\boldsymbol {\vartheta}} \in \mathbb{R}^{3}\). In this context, G( q n + 1 / 2 ) can be used as a discrete null space matrix. Premultiplication of (86b) with that matrix eliminates the constraint forces due to (93), i.e.,

G( q n + 1 / 2 ) q n + 1 / 2 = 0 3 × 1 ,
(104)

where property (135) has been used. Moreover, the unity constraint can be neglected by replacing the update formula for the quaternion (86a) with

q n + 1 = exp S 3 ( ( 0 , 1 2 ϑ ) ) q n ,
(105)

where the exponential map on \(S^{3}\) is given in (40). Note that the last relation (105) automatically ensures the unity constraint such that q n + 1 S 3 . Using a similar elimination of the velocities and momenta as above eventually yields a minimal set of three nonlinear equations for the unknown \({\boldsymbol {\vartheta}}\) for each time step. The incremental rotation vector can be computed for each time step individually such that, in contrast to minimal representations using Euler angles, singularities due to the trigonometric functions are avoided.

Note that the above size reduction techniques do not alter the above-mentioned conservation properties of the proposed EM scheme.

5 Numerical studies

In the following, the newly proposed scheme (72a)–(72d) is applied to some numerical examples. Since this involves the solution of an implicit set of equations, Newton’s method is used in every time step with a tolerance of \(\varepsilon _{\mathrm{Newton}}=10^{-9}\). The computations have been performed using the code package available at [30], which can also be used for verification. The first two examples represent model problems dealing with singular and configuration-dependent mass matrix, respectively. Examples 3 and 4 show rigid body rotation problems, which are known from literature. Here we apply the newly proposed EM scheme (86a)–(86d). We moreover target a comparison to an established Hamiltonian EM method from [7] as well as two midpoint schemes, based on the Hamiltonian and Livens-based equations of motion, see Table 1. The last example shows how our approach can be adapted to more complex multibody systems, which include translational motion and external constraints.

Table 1 Overview of integration methods

The time step size for each example has been chosen according to the existing literature. When differing from that, we have made choices such that all methods under investigation converge to a solution. Due to the enhanced robustness of EM methods, this value is only restricted by the convergence of Newton’s method in each time step.

5.1 Mass-spring system with redundant coordinates

We take up an example with singular mass matrix from [59, Sect. 5, Example 3] as depicted in Fig. 1 with masses \(m_{i}\) and springs with constants \(k_{i}\) and resting lengths \(l_{i0}\), where \(i \in \{1,2 \}\). The system can be considered as a modular multibody system with two separate subsystems and two degrees of freedom. However, we use two coordinates describing the springs’ elongations (\(x_{1}\) and \(x_{2}\)) and one coordinate \(q_{2}\) where the two subsystems are interconnected such that \(n=3\). Correspondingly, we use

$$\begin{aligned} \mbox{$\boldsymbol {q}$} = \begin{bmatrix} x_{1} \\ q_{2} \\ x_{2} \end{bmatrix} \quad \text{and} \quad \mbox{$\boldsymbol {v}$} = \begin{bmatrix} v_{1} \\ v_{2} \\ v_{3} \end{bmatrix} = \begin{bmatrix} \dot{x}_{1} \\ \dot{q}_{2} \\ \dot{x}_{2} \end{bmatrix}, \end{aligned}$$
(106)

and the interconnection constraint \(q_{2} = x_{1} + l_{10} + w \) arises, which can be recast as

$$\begin{aligned} g( \mbox{$\boldsymbol {q}$} ) = \frac{1}{2} \left ( (q_{2} -x_{1})^{2} - (l_{10}+w)^{2} \right ) = 0 , \end{aligned}$$
(107)

such that \(m=1\). The total kinetic energy is given by

$$\begin{aligned} T( \mbox{$\boldsymbol {v}$} ) = \frac{1}{2} m_{1} v_{1}^{2} + \frac{1}{2} m_{2} (v_{2} + v_{3})^{2} = \frac{1}{2} \mbox{$\boldsymbol {v}$} ^{\mkern -1.5mu\mathsf {T}}\begin{bmatrix} m_{1} & & 0 & & 0 \\ 0 & & m_{2} & & m_{2} \\ 0 & & m_{2} & & m_{2} \end{bmatrix} \mbox{$\boldsymbol {v}$} , \end{aligned}$$
(108)

and thus we identify a mass matrix, which is constant and singular for all configurations. Thus, the inverse \(\mbox{$\mathbf {M}$} ^{\mathrm{-1}}\) does not exist, and we cannot find a Hamiltonian for this problem. Moreover, the discrete generalized energy (74) and the discrete total energy of system (80) are equivalent, see Proposition 4.6. The potential is given by the elastic potential of the two springs, which is assumed to be nonlinear, such that

$$\begin{aligned} V( \mbox{$\boldsymbol {q}$} ) = \frac{1}{4} k_{1} (x_{1}^{2} + x_{1}^{4}) + \frac{1}{4} k_{2} (x_{2}^{2} + x_{2}^{4}) . \end{aligned}$$
(109)

The initial conditions are \(\mbox{$\boldsymbol {q}$} ^{0}=[0 \ 1.1 \ 0]^{\mkern -1.5mu\mathsf {T}}\) and \(\mbox{$\boldsymbol {v}$} ^{0}=[1 \ 1 \ -1]^{\mkern -1.5mu\mathsf {T}}\), and the simulation parameters have been chosen as shown in Table 2.

Fig. 1
figure 1

Mass-spring system (left) and energy quantities (right)

Table 2 Simulation parameters for mass-spring system with \(i \in \{1,2\}\)

The simulation yielded the energy evolutions displayed in Fig. 1, where energy transfer between kinetic and potential energy becomes visible. The energy-consistent approximation provided by the proposed method becomes obvious in Fig. 2, where the temporal increment of the generalized energy is close to computer precision. Furthermore, Fig. 2 underlines the computationally exact treatment of the constraint equation in each time step.

Fig. 2
figure 2

Positional constraint (107) (left) and energy increments (right)

5.2 Nonlinear spring pendulum with spherical coordinates

We analyze a nonlinear spring pendulum in three dimensions, which is a popular finite–dimensional model problem for nonlinear elastic mechanical systems (see, e.g., [40]). We consider spherical coordinates for three degrees of freedom

$$\begin{aligned} \mbox{$\boldsymbol {q}$} = \begin{bmatrix} r \\ \theta \\ \varphi \end{bmatrix} \text{,} \end{aligned}$$
(110)

such that the distance of the mass \(m\) from the Cartesian origin is given by \(r \in \mathbb{R}_{\geq 0}\) and two angles \(\theta \) and \(\varphi \) describe the orientation, as depicted in Fig. 3. The mass matrix for this example is given by

$$\begin{aligned} \mbox{$\mathbf {M}$} ( \mbox{$\boldsymbol {q}$} ) = m \begin{bmatrix} 1 & & 0 & & 0 \\ 0 & & r^{2} & & 0 \\ 0 & & 0 & & r^{2} \sin ^{2}(\theta ) \end{bmatrix} \end{aligned}$$
(111)

and depends on the coordinates.Footnote 3 The potential energy is given by the nonlinear internal potential with spring constant \(EA \in \mathbb{R}_{\geq 0}\) such that

$$\begin{aligned} V( \mbox{$\boldsymbol {q}$} ) = \frac{1}{2} EA \varepsilon ^{2}(r) , \end{aligned}$$
(112)

where we consider Green–Lagrangian strains \(\varepsilon (r) =(r^{2} - l_{0}^{2})/(2 l_{0}^{2})\) and \(l_{0}\) denotes the spring’s resting length. Initial conditions have been chosen as \(\mbox{$\boldsymbol {q}$} ^{0} = [1.05 \ \pi /2 \ 0]^{\mkern -1.5mu\mathsf {T}}\) and \(\mbox{$\boldsymbol {v}$} ^{0} = [0 \ 1 \ 1]^{\mkern -1.5mu\mathsf {T}}\) to achieve an initial elongation of the spring by \(5\%\) and a tangential initial velocity. Further simulation parameters are given in Table 3.

Fig. 3
figure 3

Spring pendulum system (left) and energy quantities (right)

Table 3 Simulation parameters for spring pendulum

The evolution of the energetic quantities can be seen in Fig. 3. While the conservation of the discrete total energy is captured down to an order of \(10^{-4}\) (cf. Fig. 4, left), the generalized energy function is again exactly preserved by the newly proposed scheme (see Fig. 4, right).

Fig. 4
figure 4

Discrete total energy (80) increments (left) and generalized energy function (74) increments (right)

5.3 Free rotation of a rigid body

This example simulation is concerned with the free rotation of a rigid body, which is specified by a convective inertia tensor (39) corresponding to principal axes given by \(\mbox{$\mathbf {J}$} _{0} = \mathrm{diag}(6, 8, 3)\). This problem has been taken from [7] and originates in [9] with the same parameter choices. Similarly, the initial state is given by an initial orientation angle \(\vartheta _{0} = 0\) and an arbitrary orientation vector \(\mbox{$\boldsymbol {n}$} _{0}\), see (40), such that q(t=0)= q 0 =(1,0) and the initial convective angular velocity is given by \(\mbox{$\boldsymbol {\Omega}$} ^{0} = \mbox{$\boldsymbol {\Omega}$} (t=0) = [10 \ 20 \ 20]^{\mkern -1.5mu\mathsf {T}}\). Correspondingly, initial quaternion velocities and momenta are determined from and p 0 = M ˜ 4 v 0 . The time-step size has been set to \(h=0.05\) and the problem has been simulated for \(t \in \mathcal{T} = [0, 2]\), leading to a rotational motion (see snapshots depicted in Fig. 5).

Fig. 5
figure 5

Snapshots for \(t \in \{0, 0.25, 0.75, 1.25, 1.75, 2 \}\)

As of before, the energy-consistent behavior of our method is verified in Fig. 6. The method preserves the configuration space, i.e., the unity constraint (30) is computationally conserved (see Fig. 7, left). The discrete total energy (80) is not preserved by EML (see Fig. 7 (right)), due to the configuration-dependence of the quaternion mass matrix (46). The additional conservation of the spatial angular momentum (65) according to Proposition 4.10 can be observed in Fig. 8.

Fig. 6
figure 6

Generalized energy function (left) and increments \(E^{n+1}- E^{n}\) (right)

Fig. 7
figure 7

Unity constraint on position-level (left) and discrete total energy (80) (right)

Fig. 8
figure 8

Angular momentum components (left) and increments \(L_{i}^{n+1}- L_{i}^{n}\) (right)

Lastly, we investigate the increase in numerical efficiency with regard to the size reduction techniques mentioned in Sect. 4.5. To this end, the current problem is simulated with different time step sizes for a prolonged simulation period of \(\mathcal{T} = \left [0, 10\right ]\), and we display an average real runtime \(t_{\mathrm{comp}}\) for representative simulations.Footnote 4 Solving the EML scheme with size reduction (103) (labeled ‘‘REML’’) reduces the computational effort by nearly \(50\%\), see Fig. 9. An application of the discrete null space method as outlined in Remark 4.11 (labeled ‘‘Null-EML’’), yielding a minimal set of nonlinear time-stepping equations, again lowers the computational costs notably.

Fig. 9
figure 9

Computational effort with and without size reduction

5.4 Steady precession of a heavy top

This example is concerned with the motion of a symmetrical and heavy top, see Fig. 10 for a depiction. It is a well-known benchmark problem for rigid body rotations and has yet been addressed in, inter alia, [6, 7, 20, 32, 34, 47]. More specifically, the gyroscopic top undergoes a motion characterized by steady precession, i.e., its center of mass rotates on a circular trajectory with constant vertical height.

Fig. 10
figure 10

Heavy top system sketch (left) and total energy increment comparison (right). Legend follows Table 1

The simulation parameters are comprised in Table 4. The parameters are set according to a cone shape with height \(a\), radius \(r=a/2\), the center of mass located along the symmetry axis with a distance of \(l=3/4 a\) away from the tip. The total mass amounts to \(m= 1/3 \rho \pi r^{2} a\). Moreover, the momenta of inertia with respect to the center of mass are given by

$$\begin{aligned} J_{0}^{1} & = \frac{3}{80} m (4r^{2}+a^{2}) = J_{0}^{2} \text{,} \quad J_{0}^{3} = \frac{3}{10} m r^{2} \text{,} \end{aligned}$$
(113)

yielding \(J_{0}^{1} = J_{0}^{2} = J_{0}^{3} = 5.3014 \cdot 10^{-4}\). With respect to the fixed point of rotation, the momenta of inertia can be computed using the parallel axis theorem as

$$\begin{aligned} J_{1} & =J_{2} = J^{1}_{0} = J^{2}_{0} \text{,} \quad J_{3} = J^{3}_{0} + m l^{2} \text{,} \end{aligned}$$
(114)

which represent the principal values of the convective inertia tensor such that \(\mbox{$\mathbf {J}$} _{0} = \mathrm {diag} (J_{1}, J_{2}, J_{3})\). Additionally, we assume gravity with magnitude \(g\) acting in the negative vertical direction, i.e., \(\mbox{$\boldsymbol {b}$} = -g \mbox{$\boldsymbol {e}$} _{3}\), such that the external potential reads

V(q)=mg z cm (q)=mgl e 3 R(q) e 3 =mgl R 33 (q)=mgl( q 0 2 q 1 2 q 2 2 + q 3 2 ),
(115)

where \(z_{\mathrm{cm}}\) is the vertical Cartesian coordinate of the center of mass and the 33-component of the rotation matrix can be extracted from (51). Correspondingly, potential forces are given by

(116)

The heavy top starts with an initial configuration inclined by the nutation angle \(\vartheta _{0}\) about the \(\mbox{$\boldsymbol {e}$} _{1}\)-axis, such that in accordance with (40), one obtains

q(t=0)= ( cos ( ϑ 0 / 2 ) , sin ( ϑ 0 / 2 ) e 1 ) .
(117)

The steady precession condition, which allows for an analytical reference solution, is given by

$$\begin{aligned} \omega _{\mathrm{s}} = \frac{mgl}{J_{3} \omega _{\mathrm{p}}} + \frac{J_{1}-J_{3}}{J_{3}}\omega _{\mathrm{p}} \cos (\vartheta _{0}) \end{aligned}$$
(118)

(see [20, 45]), where \(\omega _{\mathrm{p}}\) is the precession rate and \(\omega _{\mathrm{s}}\) is the spin rate. In detail, to be consistent with [7, 32], we choose \(\omega _{\mathrm{p}} = 10\) and obtain the initial spatial angular velocity

$$\begin{aligned} \mbox{$\boldsymbol {\omega}$} (t=0) = \omega _{\mathrm{p}} \mbox{$\boldsymbol {e}$} _{3} + \omega _{\mathrm{s}} \mbox{$\boldsymbol {d}$} _{3}(t=0) \end{aligned}$$
(119)

with d 3 (t=0)=R( q 0 ) e 3 .

Table 4 Simulation parameters for heavy top problem

The simulation again verifies the structure-preserving properties of the proposed integrator, yielding energy-conservation in discrete time. In Fig. 10 the results from our method EML are compared with the results obtained from the comparison methods,Footnote 5 see Table 1. It can be observed that standard integration methods should not be used if one desires an accurate energy approximation for the present problem.

The conservation of the angular momentum map is for this example problem restricted to the component about the \(\mbox{$\boldsymbol {e}$} _{3}\)-axis since the present gravity prohibits symmetry about the other two axes. With respect to Proposition 3.3, this means that the present potential energy (115) satisfies V( q α )=V(q) with x α = exp S 3 (0,α e 3 ), leading to the results depicted in Fig. 11.

Fig. 11
figure 11

Angular momentum components (left) and increments of component about 3-axis (right), obtained using EML

In Fig. 12 we display the results for the 1- and 3-component of the center of mass for both the present integrator and the EMH scheme and compare it with the analytical solution for the Euclidean position of the center of mass

$$\begin{aligned} \mbox{$\boldsymbol { \varphi }$} _{\mathrm{ref}}(t) = l \sin (\vartheta _{0}) \sin (\omega _{\mathrm{p}} t) \mbox{$\boldsymbol {e}$} _{1} - l \sin (\vartheta _{0}) \cos (\omega _{\mathrm{p}} t) \mbox{$\boldsymbol {e}$} _{2} + l \cos (\vartheta _{0}) \mbox{$\boldsymbol {e}$} _{3} \text{.} \end{aligned}$$
(120)

While there is no visible difference in the quality of the approximation for the vertical component between the two EM methods (see Fig. 12, left), the novel EML method seems to yield more accurate results for the 1-component (see Fig. 12, right).

Fig. 12
figure 12

Vertical (left) and horizontal component (right) of center of mass

We moreover target a convergence analysis comparing the four above-mentioned schemes. To this end, we define the error measure

$$\begin{aligned} e = \frac{\mathopen{\lVert } \mbox{$\boldsymbol { \varphi }$} _{\mathrm{ref}}(t=0.1) - \mbox{$\boldsymbol { \varphi }$} _{\mathrm{num}}(t=0.1)\mathclose{\rVert }}{\mathopen{\lVert } \mbox{$\boldsymbol { \varphi }$} _{\mathrm{ref}}(t=0.1)\mathclose{\rVert }} \text{,} \end{aligned}$$
(121)

where \(\mbox{$\boldsymbol { \varphi }$} _{\mathrm{num}}\) denotes the numerical solution obtained using the different methods. The results in Fig. 13 highlight the good performance of the present EML method compared to EMH. It can be observed that the Livens-based integrators exhibit lower errors than the Hamiltonian methods. Interestingly, the MPL scheme performs better than the EML scheme. For a prescribed time step size it yields the lowest error for the present example. As expected, all methods show a second order convergence behavior.

Fig. 13
figure 13

\(h\)-convergence of investigated schemes. Legend follows Table 1

5.5 Closed loop multibody system

This example is concerned with a multibody system consisting of four rigid bars interconnected by four spherical joints according to [10, Sect. 4.1.2], see Fig. 14. The bars have length \(l\) and a unit square cross section \(A = 1\) such that the total mass of each bar amounts to \(m = \rho A l\). In addition to the orientation of each rigid body, which is parametrized with a unit-quaternion q ( a ) , \(a \in \{1,2,3,4\}\), the coordinates are completed by the Cartesian coordinates of the respective center of mass \(\mbox{$\boldsymbol { \varphi }$} ^{(a)} \in \mathbb{R}^{3}\) such that

q=( φ ( 1 ) , q ( 1 ) , φ ( 2 ) , q ( 2 ) , φ ( 3 ) , q ( 3 ) , φ ( 4 ) , q ( 4 ) )
(122)

and \(n=28\). The kinetic energy sums over all bodies and contains the translational parts as well, i.e.,

T(q, q ˙ )= a = 1 4 1 2 m φ ˙ ( a ) φ ˙ ( a ) + a = 1 4 1 2 q ˙ ( a ) M ˜ 4 ( a ) ( q ( a ) ) q ˙ ( a ) ,
(123)

with the singular and configuration-dependent rotation-related mass matrices for each body (46).

Fig. 14
figure 14

Closed loop multibody system sketch (left) and temporal function of external loads (right)

This induces a singular and configuration-dependent overall mass matrix with block-diagonal structure

M(q)=diag{m I 3 × 3 , M ˜ 4 ( 1 ) ( q ( 1 ) ),m I 3 × 3 , M ˜ 4 ( 2 ) ( q ( 2 ) ),m I 3 × 3 , M ˜ 4 ( 3 ) ( q ( 3 ) ),m I 3 × 3 , M ˜ 4 ( 4 ) ( q ( 4 ) )}.
(124)

Besides the internal constraints enforcing the unit-condition of each quaternion, the spherical joints induce the external constraints

$$\begin{aligned} \mbox{$\boldsymbol {g}$} ^{(a,b)}( \mbox{$\boldsymbol {q}$} ) = \mbox{$\boldsymbol { \varphi }$} ^{(a)} + \mbox{$\boldsymbol {x}$} ^{(a,b)} - \mbox{$\boldsymbol { \varphi }$} ^{(b)} - \mbox{$\boldsymbol {x}$} ^{(b,a)} \qquad (a,b) \in \{(1,2), (2,3), (3,4), (4,1) \} , \end{aligned}$$
(125)

where x ( a , b ) =R( q ( a ) ) X ( a , b ) denotes the spatial vector from the center of mass of body \((a)\) to the joint with body \((b)\) and involves the rotation matrix (50). The total amount of constraints is \(m=16\) and the pertaining external constraint forces are given by, for example,

g ( 1 , 2 ) (q)= [ I 3 × 3 2 E ( q ( 1 ) ) X ( 1 , 2 ) I 3 × 3 2 E ( q ( 2 ) ) X ( 2 , 1 ) 0 3 × 14 ] ,
(126)

using the notation from equation (137). Deriving this relation makes use of equations (136) and (137) contained in the Appendix. During \(t \in [0, 1]\) the system is subject to an external force and torque, respectively, given by

$$\begin{aligned} \mbox{$\boldsymbol {f}$} = 8 f(t) \mbox{$\boldsymbol {e}$} _{1} \text{,} \quad \mbox{$\boldsymbol {\tau}$} = 6 f(t) \mbox{$\boldsymbol {e}$} _{1} \qquad \text{with} \quad f(t) = \textstyle\begin{cases} 2 \, f_{m} \, t & \text{for} \ t \in [0, 0.5] \text{,} \\ 2 \, f_{m} \, (1-t) & \text{for} \ t \in (0.5, 1] \text{,} \\ 0 & \text{for} \ t \in (1, t_{\mathrm{end}}] \text{,} \end{cases}\displaystyle \end{aligned}$$
(127)

both acting in the center of mass of the first bar, i.e., at \(\mbox{$\boldsymbol {X}$} = l/2 \mbox{$\boldsymbol {e}$} _{1}\). The time function is depicted in Fig. 14. To find an equivalent quaternion representation, one can consider the externally induced power. In view of (43), this yields an external loading vector given by

(128)

which is added to the balance of momentum on the right-hand side of (19b). The simulation parameters are shown in Table 5, and the resulting motion can be viewed in the snapshots contained in Fig. 15. Figure 16 shows that, as soon as the system is closed, the conservation principles concerning energy and angular momentum are numerically identically fulfilled. This example underlines the applicability of the proposed approach to forced (i.e., open) systems as well as more advanced multibody systems, including closed loop structures.

Fig. 15
figure 15

Snapshots for \(t \in \{0, 2, 4,6, 8, 10 \}\)

Fig. 16
figure 16

Generalized energy function (left) and total angular momentum (right)

Table 5 Simulation parameters for closed loop multibody system

6 Conclusion and outlook

The present approach to the numerical integration of holonomically constrained dynamical systems is based on Livens’ principle. This variational principle is characterized by combining Lagrangian and Hamiltonian viewpoints on mechanics by accounting for independent coordinates, velocities, and momenta. Thus, the need for the inversion of the mass matrix is avoided, which allows for a novel approach to the simulation of mechanical systems with singular and/or configuration-dependent mass matrix. Moreover, a generalized total energy function depending on position, velocity, and momentum is introduced, which serves as a conserved quantity of the equations of motion pertaining to Livens’ principle (see previous works [32, 33]) and shows how to overcome the restrictions therein to constant and non-singular mass matrices.

In this work we have also targeted the modeling of rigid body rotations in terms of unit quaternions. The standard derivation yields a configuration-dependent mass matrix with rank-deficiency. In contrast to the existing literature, the usage of Livens’ principle avoids to set up an additional inertia parameter by circumventing a purely Hamiltonian setup. We have shown that the proposed approach can directly account for the singular mass matrix.

Based on the novel formulation, a structure-preserving discretization has been applied. As the corresponding scheme makes use of Gonzalez discrete gradients, the proposed integrator preserves the discrete generalized total energy, which differs (in case of configuration-dependent mass matrices) from the total energy in the Lagrangian setting. Moreover, the proposed scheme discretely covers the conservation of momentum maps corresponding to system symmetries and the holonomic constraints. Due to the relation to the midpoint rule, the scheme exhibits second-order accuracy. The newly proposed structure-preserving integration scheme enhances the method presented by Gonzalez [22] with respect to the formulation in a more general (not necessarily Hamiltonian) framework, which makes possible the EM-consistent simulation of systems with configuration-dependent and/or singular mass matrices comprising rigid body rotations in unit quaternions. In contrast to Lagrangian or Hamiltonian mechanics, the usage of Livens’ principle largely facilitates the design of such a method, see Remark 4.7.

The numerical properties of the present method have been demonstrated in model problems from multibody dynamics. Three examples, including a closed loop multibody system, have shown the method’s properties when dealing with rigid body dynamics in terms of unit quaternions. In one of the investigated examples, the Livens-based EM scheme (and also a standard midpoint scheme) shows a better approximation behavior than established Hamiltonian schemes. Additionally, the use of size reduction techniques allows computationally efficient implementations while keeping the desired conservation properties.

It should be noted that in the present work we have focussed on the design of an EM-consistent scheme. The development of variational integrators based on Livens’ principle with configuration dependent and/or singular mass matrices is interesting as well. Especially the design of higher order methods by following the ideas presented in Wenger et al. [61] might be in the scope of future research. In this connection, the approach by Altmann and Herzog [2] should also be applicable. While we have restricted ourselves to conservative systems, an extension can be obtained using the Lagrange–d’Alembert principle for non-conservative systems [43], as for example in [33, Sect. 4.3]. Lately, unit quaternions have been used for the modeling of the 3D mathematical pendulum in [14], which therefore seems to be yet another interesting application case of unit quaternions for rigid body rotations. To this end, the dynamics on \(S^{2}\) could be regarded as a special case of \(SO(3)\) allowing for unit quaternion representations with additional constraints. Lastly, the presented framework could be extended to infinite-dimensional systems where finite rotations need to be parameterized as well, e.g., geometrically exact shells [11].