1 Introduction

The parametrization of spatial rotations is an important issue in many fields such as multibody dynamics (MBD) or in spacecraft attitude determination, for example, since the efficiency of non-linear computations involving large rotations depends largely upon the adequacy of the set of parameters adopted [16]. A commonly used type of rotation parameters in multibody systems dealing with the orientation of rigid or flexible bodies are Euler angles [41], whereas in spacecraft attitude determination, the rotation vector components are often used as rotation parameters [39, 52]. It is well known, however, that the direct time integration of kinematic equations with three rotation parameters is not possible in singular points. For a detailed discussion of singular points, see [49]. Hence, the rotational motion cannot be reconstructed by direct integration of the kinematic equations.

This contribution provides a novel numerical solution for the problem of direct time integration of Euler angles and, alternatively, the rotation vector as well as a novel implementation strategy for Lie group time integration methods.

1.1 The problem with the direct time integration of rotation parameters

To illustrate the problem of direct time integration of rotation parameters, we consider Euler’s equations of motion (EOM) for a single rigid body expressed in a local frame [35, 40]

$$ \mathbf {J}\dot{\boldsymbol {\omega }} + \boldsymbol {\omega }\times ( \mathbf {J}\boldsymbol {\omega }) = \boldsymbol{\tau } $$
(1)

that provides the angular velocity \(\boldsymbol {\omega }\in \mathbb {R}^{3}\), defined by

$$ \widetilde {\boldsymbol {\omega }}=\mathbf {R}^{T}\dot {\mathbf {R}}, $$
(2)

where \(\mathbf {R}\) is the rotation matrix transforming the body fixed coordinates of a point to the spatial coordinates. In Eq. (2), \(\widetilde {\boldsymbol {\omega }}\) is the skew-symmetric matrix such that \(\boldsymbol {\omega }\times \mathbf{x}=\widetilde {\boldsymbol {\omega }}\mathbf{x}\) for \(\boldsymbol {\omega },\mathbf{x}\in \mathbb {R}^{3}\) [30]. Solving Eq. (1) for angular velocity does not reveal the rotational motion of the rigid body. Therefore, Euler’s EOMs (1) must be complemented with the kinematic-reconstruction equation

$$ \dot {\mathbf {R}}= \mathbf {R}\,\widetilde {\boldsymbol {\omega }}, $$
(3)

which relates the angular velocity \(\boldsymbol {\omega }\) expressed in a local frame with the time derivative of the rotation matrix [51]. In order to determine \(\mathbf {R}\) and thus obtain the orientation of the body, it is required to solve Eq. (3), which is an ordinary differential equation (ODE) on the rotation group \(SO(3)\) [30, 51].

In many applications, however, e.g. rotor dynamics [38], the direct time integration in the rotation group is avoided by the introduction of a parametrization with generalized coordinatesFootnote 1\(\mathbf {q}\in \mathbb {R}^{3}\), e.g. Euler angles, such that their time derivatives \(\dot{\mathbf {q}}\) are related via

$$ \boldsymbol {\omega }= \mathbf {G}(\mathbf {q})\dot{\mathbf {q}} $$
(4)

to the angular velocity \(\boldsymbol {\omega }\) [30]. When solving the kinematic equations (4) numerically, it is important to note that for each choice of rotation parameters \(\mathbf {q}\), regardless of the transformation itself, the transformation (4) depends on the configuration. For any three rotation parameters (e.g. Euler angles, Rodrigues parameter, rotation vector, etc.), \(\mathbf {G}\) becomes singular at certain configurations, leading to discontinuities in \(\mathbf {q}\). If such points are passed, the direct time integration of Eq. (4) is no longer possible. Therefore, a reconstruction of the rotational motion is no longer possible, although the discontinuities in \(\mathbf {q}\) are finite.

1.2 State-of-the-art solutions for direct integration of rotation parameters

In spacecraft attitude determination, switching algorithms are often used as a reparametrization strategy to avoid singular points when using three rotation parameters. For example, the singular points of the rotation vector are often avoided by considering only small rotations (thus the rotation vector represents a locally non-singular three-dimensional rotation parametrization) and by accumulating the incremental attitude in a unit quaternion or direction cosine matrix (DCM) such that the rotation angle corresponding to a rotation vector never gets large [39]. However, the storage in a unit quaternion or a DCM increases the amount of memory required as compared to three rotation parameters. In [48] a switching algorithm is proposed to switch between different Euler angle sets to avoid the singular points while integrating the kinematic equations (4). In [29] a reparametrization strategy based on Shuster’s idea of artificial rotation [45] is presented, which shifts the rotation angles associated with singular points of the rotation vector in such a way that either the Rodrigues parameters or the rotation axis and rotation angle can be used without running into a singular point. However, applying a switching algorithm during the integration of Eq. (4) increases the computational complexity as well as the implementation complexity compared to the direct integration of Eq. (4).

Three rotation parameters can be used in simulation if a reparametrization strategy such as, for example, the updated Lagrangian point of view [9, 16] is implemented to avoid singular points [8]. In the updated Lagrangian point of view, rotations are treated in an updated incremental form. In each step of the solution process, the rotation increment required for moving from the known reference configuration to the current configuration is determined by means of the rotation vector, which is used as a local but not as a global parametrization of the rotation group [9]. Using the rotation vector as well as the rotation matrix from the previous time step, the rotation matrix is updated in the updated Lagrangian point of view in each time step. As in the updated Lagrangian point of view the rotation matrix is used as rotation variable instead of three rotation parameters, it may be difficult to implement the updated Lagrangian point of view approach in existing codes that are based on three rotation parameters.

A common approach in MBD and spacecraft attitude determination to avoid singular points is to use Euler parameters (also known as unit quaternions) [38], as they have only four components – just one more parameter than the dimension of the space of rotations. However, the extra component is bothersome, it requires extra storage as well as extra work to manage the redundancy, e.g. renormalization to unit length [17], or requires solving differential–algebraic equations (DAEs) [5, 51]. The need of solving DAEs, however, can be eliminated as shown in [51]. However, it is important to note that if the quaternion integration scheme proposed in [51] is implemented correctly, redundancy will not appear at any time.

The rest of the paper is organized as follows: In Sect. 2, we introduce the standard approach to integrating the kinematic-reconstruction equation (3) using Lie group methods. This section presents the fundamentals on which the proposed approach builds. Subsequently, in Sect. 3, we present our approach independently of a specific choice of rotation parameters. In Sect. 4 (resp. Sect. 5), we apply the proposed approach to the rotation vector (resp. Euler angles). The implementation of the proposed approach is discussed in Sect. 6. In Sect. 7, numerical examples are discussed which illustrate the benefits of the proposed approach. Finally, Sect. 8 draws conclusions from the study.

2 Standard Lie group approach

The singular points in formulations based on three rotation parameters can be circumvented by using the so-called Lie group integrators [3]. In MBD (see, e.g. the integrators proposed in [7, 9]), one seeks, similarly as in the Munthe–Kaas methods [18, 25, 34] for solving ODEs on Lie groups, a solution to the kinematic-reconstruction equation (3) in the form

$$ \mathbf {R}= \mathbf {R}_{0}\,\boldsymbol {\phi }(\widetilde {\mathbf {\Omega }}), $$
(5)

where \(\widetilde {\mathbf {\Omega }}\in \mathfrak {so}(3)\) is the new unknown and the solution of

$$ \dot {\mathbf {\Omega }}= \mathbf {T}_{\boldsymbol {\phi }}^{-1}(\mathbf {\Omega })\,\boldsymbol {\omega }, \quad \mathbf {\Omega }_{0} = \mathbf {0}. $$
(6)

In Eq. (5), \(\mathbf {R}_{0}\) is the initial attitude, and \(\mathfrak {so}(3)\) is the Lie algebra of the Lie group \(SO(3)\). Note that \(\mathbf {\Omega }_{0}\) in Eq. (6) is an initial condition and that \(\mathfrak {so}(3)\) is isomorphic to \(\mathbb {R}^{3}\); see, e.g. [3]. The smooth coordinate map \(\boldsymbol {\phi }\) takes \(\mathfrak {so}(3)\) to \(SO(3)\) [22, 24]. The most important coordinate map is the matrix exponentialFootnote 2\(\textrm {exp}(\cdot )\), which may be evaluated on \(SO(3)\) efficiently by Rodrigues’ formula [3, 24]. In Eq. (6), \(\mathbf {T}_{\boldsymbol {\phi }}^{-1}\) is the inverse tangent operator associated with the coordinate mapFootnote 3\(\boldsymbol {\phi }\). In case \(\boldsymbol {\phi }(\mathbf {\Omega })=\textrm {exp}(\mathbf {\Omega })\), \(\mathbf {\Omega }\) is termed instantaneous or incremental rotation vector in the context of Lie group methods on \(SO(3)\) [32, 47, 51]. To ensure a consistent notation in the following, the term incremental rotation vector is associated with \(\mathbf {\Omega }\) regardless of the choice of a coordinate map.

The crucial feature of Eq. (5) is that no global parametrization is required. In contrast to Eq. (4), Eq. (6) can be integrated without running into a singular point. This is because \(\mathbf {\Omega }\) serves as a coordinate vector that locally parametrizes the configuration increment from time step \(i\) to time step \(i+1\) and is assumed to describe small rotations [32].

As shown in [7], \(\mathbf {R}_{0}\) is updated in Eq. (5) in each integration step. Therefore, the rotation matrix \(\mathbf {R}_{0}\) represents a kind of history variable that needs to be available in each integration step during the simulation.Footnote 4 Handling the history variable \(\mathbf {R}_{0}\) during time integration is cumbersome and requires additional memory compared to three rotation parameters. The latter procedure may therefore be difficult to implement in existing codes. Specifically on embedded systems, additional history variables might be difficult to be integrated.

3 Proposed approach (independent of specific rotation parameters)

In this section we present the proposed approach for computing consistent updates for a general set of three rotation parameters, which is subsequently applied to the rotation vector as well as Euler angles.

In the proposed approach, the rotation matrix \(\mathbf {R}\) that is reconstructed with Eq. (5) using the incremental rotation vector \(\mathbf {\Omega }\) is parametrized by three rotation parametersFootnote 5\(\mathbf {q}\in \mathbb {R}^{3}\), and therefore Eq. (5) may be represented in the form

$$ \mathbf {R}(\mathbf {q}) = \mathbf {R}(\mathbf {q}_{0})\boldsymbol {\phi }( \widetilde {\mathbf {\Omega }}), $$
(7)

where \(\mathbf {q}_{0}\) represents initial attitude such that \(\mathbf {R}(\mathbf {q}_{0})=\mathbf {R}_{0}\).

The idea of the proposed approach is to consider Eq. (7) as that rotation, which is equivalent to a rotation \(\mathbf {R}(\mathbf {q}_{0} \circ \Delta \mathbf {q})\) due to an incremental change of the rotation parameters \(\Delta \mathbf {q}\in \mathbb {R}^{3}\) such that

$$ \mathbf {R}= \mathbf {R}(\mathbf {q}_{0})\boldsymbol {\phi }(\widetilde {\mathbf {\Omega }}) \,\,\widehat {=}\,\,\mathbf {R}(\mathbf {q}_{0} \circ \Delta \mathbf {q}) = \mathbf {R}(\mathbf {q}) $$
(8)

applies and therefore to consider

$$ \mathbf {q}= \mathbf {q}_{0} \circ \Delta \mathbf {q}$$
(9)

as the solution of Eq. (3) instead of Eq. (5). In Eqs. (8)–(9), the symbol ‘∘’ represents the composition rule for the selected rotation parameters \(\mathbf {q}\). Note that the explicit form of the composition rule ‘∘’ for rotation parameters depends on the selected rotation parameters. Note also that the symbol ‘∘’ is used here to indicate that the rotation parameters \(\mathbf {q}\) are determined from the rotation parameters \(\mathbf {q}_{0}\) and \(\Delta \mathbf {q}\) using the appropriateFootnote 6composition rule. In Eq. (9), we assume that

$$ \Delta \mathbf {q}=\Delta \mathbf {q}(\mathbf {q}_{0}, \mathbf {\Omega }) $$
(10)

and that \(\Delta \mathbf {q}\) does not need to be small. Furthermore, we consider the incremental change of the rotation parameters \(\Delta \mathbf {q}\) as a finite increment of rotation. To be able to compute the rotation parameter update with Eq. (9), \(\Delta \mathbf {q}(\mathbf {q}_{0},\mathbf {\Omega })\) must be determined for the selected rotation parameters depending on the incremental rotation vector \(\mathbf {\Omega }\), where the incremental rotation vector is determined in each time step by solving Eq. (6) numerically.

The rotation parameters \(\mathbf {q}\) can, of course, also be extracted from the rotation matrix as shown in [19, 27, 43], which is a detour compared to the method proposed in this paper. In the proposed approach, the rotation parameters \(\mathbf {q}\) are computed directly using the incremental rotation vector without having to evaluate in advance the rotation matrix, see Fig. 1, last line.

Fig. 1
figure 1

Schematic comparison of the procedure for computing three rotation parameters. Note that \(f(\mathbf {R})\) is a function that computes three rotation parameters from a rotation matrix \(\mathbf {R}\)

As shown in Fig. 1, in the proposed approach the rotation parameters are not determined by integrating the corresponding kinematic equations (4), but by using the incremental rotation vector. Thus, we do not need to deal with the singular points occurring in the kinematic equations (4). Of course, there is no three-parametric description of spatial rotations that is free of singular points [49]. Consequently, singular points are also present in the proposed approach. However, Eq. (9) allows dealing with singular points at the coordinate level. At the coordinate level, singular points can be embedded within the composition rule of rotations that applies to the selected rotation parameters using case distinctions, for example, such that the time integration scheme reconstructs the rotation parameters associated with a singular point without failing.

We would like to note, however, that the idea of computing rotation updates based on the incremental rotation vector is not new at all, see the references in Sect. 1.2 and Sect. 2. However, the authors are not aware that an approach similar to the presented one has already been discussed for the time integration of three rotation parameters.

As a final remark, we would like to note that the reason why we consider different parametrizations for the map \(\boldsymbol {\phi }\) in Eq. (7) is that the choice of the parametrization of the map \(\boldsymbol {\phi }\) has a significant influence on the computational effort required to compute \(\Delta \mathbf {q}\) and thus on the computational effort required to determine a rotation parameter update.

The advantages of the proposed approach are shown in the following by the example of the rotation vector, as well as by the example of Euler angles.

4 Proposed approach for the time integration of rotation vector

In this section, we apply the general approach to integrating rotation parameters presented in Sect. 3 to the rotation vector parametrization, i.e. \(\mathbf {q}=\mathbf {v}\).

4.1 Definition of the rotation vector

If \(\mathbf {n}\in \mathbb {R}^{3}\) is a unit vector along the rotation axis and \(\varphi \in \mathbb {R}\) is the rotation angle, then the corresponding rotation vector \(\mathbf {v}\in \mathbb {R}^{3}\) is given by [4, 28, 32, 43] (see also Fig. 2)

$$ \mathbf {v}= \varphi \,\mathbf {n}, $$
(11)

where the rotation angle \(\varphi \) and rotation axis \(\mathbf {n}\) can be recovered from rotation vector \(\mathbf {v}\) by

$$ \varphi = \Vert \mathbf {v}\Vert \quad \textrm{and}\quad \mathbf {n}= \textstyle\begin{cases} \mathbf {0}& \mbox{if }\Vert \mathbf {v}\Vert = 0, \\ \frac{\mathbf {v}}{\vert \vert \mathbf {v}\vert \vert } & \text{else}. \end{cases} $$
(12)
Fig. 2
figure 2

Body-fixed vector in positions \(\mathbf{r}\) before and \(\mathbf{r}^{*}\) after the rotation (\(\varphi \), \(\mathbf {n}\)), see also [53]

4.2 Rotation vector update

To be able to compute an update of the rotation vector in the form of Eq. (9), we need to find the composition rule for rotation vectors depending on the incremental rotation vectorFootnote 7\(\mathbf {\Omega }\).

The relation between the incremental rotation vector \(\mathbf {\Omega }\) and the rotation vector increment \(\Delta \mathbf {v}\) when \(\boldsymbol {\phi }=\textrm {exp}\) isFootnote 8

$$ \Delta \mathbf {v}= \mathbf {\Omega }. $$
(13)

The composition rule of two successive rotations with rotation vectors

$$ \Delta \mathbf {v}= \Delta \varphi \,\Delta \mathbf {n}$$
(14)

and

$$ \mathbf {v}_{0} = \varphi _{0}\,\mathbf {n}_{0} ,$$
(15)

with \(\mathbf {v}\) being the resultant rotation vector, is determined by using Eq. (11) as

$$ \mathbf {v}= \mathbf {v}_{0} \circ \Delta \mathbf {v}= \varphi (\varphi _{0},\Delta \varphi , \mathbf {n}_{0},\Delta \mathbf {n})\,\mathbf {n}( \varphi _{0},\Delta \varphi ,\mathbf {n}_{0}, \Delta \mathbf {n}) = \varphi \,\mathbf {n}. $$
(16)

In Eq. (16), \(\varphi (\varphi _{0},\Delta \varphi , \mathbf {n}_{0},\Delta \mathbf {n})\) and \(\mathbf {n}(\varphi _{0},\Delta \varphi , \mathbf {n}_{0},\Delta \mathbf {n})\) are given by

$$\begin{aligned} \varphi &= \varphi _{0}\circ \Delta \varphi = 2\, \mathrm {acos}\left ( \cos \frac{\varphi _{0}}{2}\cos \frac{\vert \vert \mathbf {\Omega }\vert \vert }{2} - \mathbf {n}_{0}^{T} \mathbf {\Omega }\frac{\sin \frac{\varphi _{0}}{2}\sin \frac{\vert \vert \mathbf {\Omega }\vert \vert }{2}}{\vert \vert \mathbf {\Omega }\vert \vert } \right ), \end{aligned}$$
(17)
$$\begin{aligned} \mathbf {n}&= \mathbf {n}_{0}\circ \Delta \mathbf {n}= \frac{\sin \frac{\varphi _{0}}{2}\cos \frac{\vert \vert \mathbf {\Omega }\vert \vert }{2}}{\sin \frac{\varphi }{2}} \mathbf {n}_{0} + \frac{\sin \frac{\vert \vert \mathbf {\Omega }\vert \vert }{2}}{\vert \vert \mathbf {\Omega }\vert \vert \sin \frac{\varphi }{2}} \left [ \mathbf {I}\cos \frac{\varphi _{0}}{2} + \widetilde{\mathbf {n}}_{0}\sin \frac{\varphi _{0}}{2} \right ]\mathbf {\Omega }, \end{aligned}$$
(18)

after elementary transformations of the equations given in [1, 37, 39, 54] where \(\mathbf {I}\) is a 3×3-identity matrix. In Eqs. (17)–(18), we have used the relationships

$$ \Delta \varphi = \Vert \mathbf {\Omega }\Vert $$
(19)

and

$$ \Delta \mathbf {n}= \frac{\mathbf {\Omega }}{\Vert \mathbf {\Omega }\Vert }. $$
(20)

In Eqs. (17)–(18), \(\varphi _{0} \circ \Delta \varphi \) represents the composition rule for rotation angles and \(\mathbf {n}_{0} \circ \Delta \mathbf {n}\) represents the composition rule for rotation axes. It should be noted, however, that Eqs. (17)–(18) can only be evaluated for \(\Vert \mathbf {\Omega }\Vert \neq 0\) and \(\varphi \notin S_{v}\) where

$$ S_{v}= \left \{ x \ | \ \sin \frac{x}{2}=0, \ x\in \mathbb {R}\right \} . $$
(21)

4.3 Improved rotation vector update

The case \(\Vert \mathbf {\Omega }\Vert =0\) can be covered using the cardinal sine function

$$ \mathrm {sinc}(x) = \textstyle\begin{cases} 1 & \text{if } x = 0, \\ \frac{\sin x}{ x } & \text{else}, \end{cases} $$
(22)

which is continuous and computable at \(x=0\) [32]. Therefore, we replace Eqs. (17)–(18) with

$$\begin{aligned} \varphi &= \varphi _{0}\circ \Delta \varphi = 2\, \mathrm {acos}\left ( \cos \frac{\varphi _{0}}{2}\cos \frac{\vert \vert \mathbf {\Omega }\vert \vert }{2} - \frac{\mathbf {n}_{0}^{T}\mathbf {\Omega }}{2}\sin \frac{\varphi _{0}}{2}\mathrm {sinc}\frac{\vert \vert \mathbf {\Omega }\vert \vert }{2} \right ), \end{aligned}$$
(23)
$$\begin{aligned} \mathbf {n}&= \mathbf {n}_{0}\circ \Delta \mathbf {n}= \frac{\sin \frac{\varphi _{0}}{2}\cos \frac{\vert \vert \mathbf {\Omega }\vert \vert }{2}}{\sin \frac{\varphi }{2}} \mathbf {n}_{0} + \frac{\mathrm {sinc}\frac{\vert \vert \mathbf {\Omega }\vert \vert }{2}}{2\sin \frac{\varphi }{2}} \left [ \mathbf {I}\cos \frac{\varphi _{0}}{2} + \widetilde{\mathbf {n}}_{0}\sin \frac{\varphi _{0}}{2} \right ]\mathbf {\Omega }. \end{aligned}$$
(24)

To cover the case \(\varphi \in S_{v}\), we introduce the rotation axis \(\bar {\mathbf {n}}\) using the case distinctionFootnote 9

$$ \bar {\mathbf {n}}= \textstyle\begin{cases} \mathbf {0}& \text{if }\varphi \in S_{v}, \\ \frac{\sin \frac{\varphi _{0}}{2}\cos \frac{\vert \vert \mathbf {\Omega }\vert \vert }{2}}{\sin \frac{\varphi }{2}} \mathbf {n}_{0} + \frac{\mathrm {sinc}\frac{\vert \vert \mathbf {\Omega }\vert \vert }{2}}{2\sin \frac{\varphi }{2}} \left [ \mathbf {I}\cos \frac{\varphi _{0}}{2} + \widetilde{\mathbf {n}}_{0}\sin \frac{\varphi _{0}}{2} \right ]\mathbf {\Omega }& \text{else}. \end{cases} $$
(25)

By using Eqs. (23) and (25), the composition rule for rotation vectors reads

$$ \mathbf {v}= \mathbf {v}_{0} \circ \Delta \mathbf {v}= \varphi (\varphi _{0},\mathbf {n}_{0},\mathbf {\Omega })\, \bar {\mathbf {n}}(\varphi _{0},\mathbf {n}_{0}, \mathbf {\Omega }) = \varphi \,\bar {\mathbf {n}}, $$
(26)

which can be evaluated for all \(\varphi \in \mathbb {R}\) without restrictions.

The improvements of Eqs. (23) and (24) (resp. Eq. (25)) compared to Eqs. (17)–(18) are shown with the following considerations:

  • Case 1. In the case that \(\varphi _{0} \neq 0\) and \(\mathbf {\Omega }=\mathbf {0}\), after a few steps of calculation, it follows from Eqs. (23) and (25) that

    $$ \varphi (\varphi _{0} \neq 0,\,\mathbf {\Omega }=\mathbf {0}) = \varphi _{0} $$
    (27)

    and

    $$ \bar {\mathbf {n}}(\varphi _{0} \neq 0,\,\mathbf {\Omega }= \mathbf {0}) = \mathbf {n}_{0}. $$
    (28)

    For this case, Eq. (26) therefore gives

    $$ \mathbf {v}(\varphi _{0} \neq 0,\,\mathbf {\Omega }=\mathbf {0}) = \mathbf {v}_{0}. $$
    (29)
  • Case 2. In the case that \(\varphi _{0} = 0\) and \(\mathbf {\Omega }\neq \mathbf {0}\), after a few steps of calculation it follows from Eqs. (23) and (25) that

    $$ \varphi (\varphi _{0} = 0,\,\mathbf {\Omega }\neq \mathbf {0}) = \Vert \mathbf {\Omega }\Vert $$
    (30)

    and

    $$ \bar {\mathbf {n}}(\varphi _{0} = 0,\,\mathbf {\Omega }\neq \mathbf {0}) =\frac{\mathbf {\Omega }}{\Vert \mathbf {\Omega }\Vert }. $$
    (31)

    For this case, Eq. (26) therefore gives

    $$ \mathbf {v}(\varphi _{0} = 0,\,\mathbf {\Omega }\neq \mathbf {0}) = \mathbf {\Omega }. $$
    (32)
  • Case 3. Of course, for the trivial case \(\varphi _{0} = 0\) and \(\mathbf {\Omega }=\mathbf {0}\), Eq. (26) yields

    $$ \mathbf {v}(\varphi _{0} = 0,\,\mathbf {\Omega }=\mathbf {0}) = \mathbf {0}. $$
    (33)

Note that the rotation vector exhibits a redundancy at the rotation angles \(\varphi \in S_{v}\) [20]. However, the Rodrigues’ formula

$$ \mathbf {R}(\varphi ,\mathbf {n}) = \mathbf {I}+ \sin \varphi \,\widetilde{\mathbf {n}} + (1-\cos \varphi ) \widetilde{\mathbf {n}}^{2} $$
(34)

resolves the redundancy \(\varphi \in S_{v}\),

$$ \mathbf {R}(0,\mathbf {n}) = \mathbf {R}(\pm 2\pi \mathbb {N}, \mathbf {n}) = \mathbf {I}. $$
(35)

Note that the redundancy of the rotation vector at \(\varphi \in S_{v}\) can be bypassed by scaling the rotation vector such that its magnitude always belongs to an interval \(\varphi \in \left [-\pi ,\,\pi \right ]\) as shown in [20].

Since we use the exponential map Eq. (77) in Eq. (13) to establish a relation between \(\mathbf {\Omega }\) and \(\Delta \mathbf {v}\), the inverse tangent operator corresponding to the exponential map \(\mathbf {T}_{\textrm {exp}}^{-1}\) in Eq. (82) needs to used in Eq. (6). Therefore, Eq. (6) takes the form

$$ \dot {\mathbf {\Omega }}= \mathbf {T}_{\textrm {exp}}^{-1}(\mathbf {\Omega })\,\boldsymbol {\omega }, \quad \mathbf {\Omega }_{0} = \mathbf {0}. $$
(36)

The incremental rotation vector \(\mathbf {\Omega }\) is then determined in each time step by solving Eq. (36) numerically.

As a final remark, we would like to note that Engø [14] presented a closed form of the Baker–Campbell–Hausdorff formula on \(\mathfrak {so}(3)\) and has interpreted it as a composition of two rotations, which was extended in [12] for \(\mathit{SE}(3)\) and dual quaternions. However, the formula presented in [14] cannot be applied directly for the time integration of the rotation vector, since it only provides correct answers for rotation angles smaller than \(\pi \)/2 as noted in the paper.

5 Proposed approach for the time integration of Euler angles

In this section, we apply the general approach to the Euler angle parametrization, i.e. \(\mathbf {q}=\boldsymbol {\alpha }\).

To be able to compute an update for Euler angles in the form of Eq. (9), we need to find the composition rule as well as the Euler angle increment depending on the incremental rotation vector \(\mathbf {\Omega }\). Since there are 12 possible sets of Euler angles [13, 19, 44], we present a general procedure to determine the Euler angle increment for an arbitrary set of Euler angles. In Appx. B we apply the general procedure shown in this section to determine the Euler angle increment for Cardan/Tait–Bryan angles, which has been omitted here for reasons of space and clarity.

Any combination of three elementary rotations is given as

$$ \mathbf {R}(\alpha _{1},\alpha _{2},\alpha _{3}) = \textrm {exp}( \alpha _{1}\widetilde {\mathbf {e}}_{1})\,\textrm {exp}(\alpha _{2}\widetilde {\mathbf {e}}_{2})\, \textrm {exp}(\alpha _{3}\widetilde {\mathbf {e}}_{3}) ,$$
(37)

with \(\mathbf {e}_{i}\) being a constant unit vector [32, 48] and \(\textrm {exp}\) being the exponential map Eq. (77). For the Cardan/Tait–Bryan angle parametrization, these are the unit vectors

e 1 = [ 1 0 0 ] T , e 2 = [ 0 1 0 ] T , e 3 = [ 0 0 1 ] T ,
(38)

whereas for 313-Euler angles these are unit vectors [32]

e 1 = [ 0 0 1 ] T , e 2 = [ 1 0 0 ] T , e 3 = [ 0 0 1 ] T .
(39)

In the proposed approach, the composition rule of two successive rotations with Euler angles \(\alpha _{0,1}\), \(\alpha _{0,2}\), \(\alpha _{0,3}\) and \(\Delta \alpha _{1}\), \(\Delta \alpha _{2}\), \(\Delta \alpha _{3}\) where \(\alpha _{1}\), \(\alpha _{2}\), \(\alpha _{3}\) are the resulting Euler angles is applied asFootnote 10

$$ \alpha _{i} = \alpha _{0,i} \circ \Delta \alpha _{i} = \alpha _{0,i} + \Delta \alpha _{i} \quad \textrm{for $i=1,2,3$}, $$
(40)

where \(\Delta \alpha _{i}\) is implicitly defined by the standard Lie group method Eq. (5) and explicitly computed in our approach.

By using Eq. (40), the elementary rotation \(\textrm {exp}(\alpha _{i}\widetilde {\mathbf {e}}_{i})\) associated with the \(i\)th Euler angle \(\alpha _{i}\) is written as

$$ \textrm {exp}(\alpha _{i}\widetilde {\mathbf {e}}_{i}) = \textrm {exp}((\alpha _{0,i} + \Delta \alpha _{i})\widetilde {\mathbf {e}}_{i}) = \textrm {exp}(\alpha _{0,i} \widetilde {\mathbf {e}}_{i})\,\textrm {exp}(\Delta \alpha _{i}\widetilde {\mathbf {e}}_{i}). $$
(41)

By multiplying Eq. (41) with \(\textrm {exp}^{T}(\alpha _{0,i}\widetilde {\mathbf {e}}_{i})\) from the left, the elementary rotation \(\textrm {exp}(\Delta \alpha _{i}\widetilde {\mathbf {e}}_{i})\) associated with the Euler angle increment \(\Delta \alpha _{i}\) is given by

$$ \textrm {exp}(\Delta \alpha _{i}\widetilde {\mathbf {e}}_{i}) = \textrm {exp}^{T}( \alpha _{0,i}\widetilde {\mathbf {e}}_{i})\,\textrm {exp}(\alpha _{i}\widetilde {\mathbf {e}}_{i}). $$
(42)

From Eq. (42) two equations are obtained for \(\Delta \alpha _{i}\), one equation for the sine and one equation for the cosine of an incremental angle, which readFootnote 11

$$\begin{aligned} \sin \Delta \alpha _{i} &= \cos \alpha _{0,i}\sin \alpha _{i} - \sin \alpha _{0,i}\cos \alpha _{i} =: y_{i} , \end{aligned}$$
(43)
$$\begin{aligned} \cos \Delta \alpha _{i} &= \cos \alpha _{0,i}\cos \alpha _{i} + \sin \alpha _{0,i}\sin \alpha _{i} =: x_{i} . \end{aligned}$$
(44)

From Eqs. (43)–(44), the Euler angle increment \(\Delta \alpha _{i}\) is computed using the proper four-quadrant inverse tangent function atan2Footnote 12

$$ \Delta \alpha _{i} = \mathrm {atan2}\left (y_{i},\, x_{i} \right ). $$
(45)

In order to be able to compute \(\Delta \alpha _{i}\) with Eq. (45), \(\sin \alpha _{i}\) and \(\cos \alpha _{i}\) in Eqs. (43)–(44) need to be expressed depending on the incremental rotation vector. However, the equations that provide this connection assume different forms for each of the 12 possible Euler angle combinations. The procedure for establishing a relationship between \(\sin \alpha _{i}\) and \(\cos \alpha _{i}\) and \(\mathbf {\Omega }\) is illustrated in Appx. B using the Cardan/Tait–Bryan angles as an example.

By combining the Euler angles \(\alpha _{0,i}\) in vector

$$ \boldsymbol {\alpha }_{0} = \begin{bmatrix} \alpha _{0,1} & \alpha _{0,2} & \alpha _{0,3} \end{bmatrix} ^{T} $$
(46)

and the Euler angle increments \(\Delta \alpha _{i}\) obtained with Eq. (45) in vector

$$ \Delta \boldsymbol {\alpha }= \Delta \boldsymbol {\alpha }(\boldsymbol {\alpha }_{0},\mathbf {\Omega }) = \begin{bmatrix} \Delta \alpha _{1} \\ \Delta \alpha _{2} \\ \Delta \alpha _{3} \end{bmatrix} = \begin{bmatrix} \mathrm {atan2}(\, y_{1},\, x_{1} \,) \\ \mathrm {atan2}(\, y_{2},\, x_{2} \,) \\ \mathrm {atan2}(\, y_{3},\, x_{3} \,) \end{bmatrix} $$
(47)

and the Euler angles \(\alpha _{i}\) in vector

$$ \boldsymbol {\alpha }= \begin{bmatrix} \alpha _{1} & \alpha _{2} & \alpha _{3} \end{bmatrix} ^{T}, $$
(48)

the composition rule of two successive rotations in vector form for Euler angles is

$$ \boldsymbol {\alpha }= \boldsymbol {\alpha }_{0} \circ \Delta \boldsymbol {\alpha }(\boldsymbol {\alpha }_{0}, \mathbf {\Omega }) = \boldsymbol {\alpha }_{0} + \Delta \boldsymbol {\alpha }(\boldsymbol {\alpha }_{0}, \mathbf {\Omega }). $$
(49)

6 Time integration scheme for the proposed approach

In the proposed approach, the rotational update within the \(i\)th integration step is based on Eq. (9), where the incremental rotation vector updates a rotation of \(\mathbf {q}_{i}\) to \(\mathbf {q}_{i+1}\). Therefore we express the update for the step \(i+1\) in the form

$$ \mathbf {q}_{i+1} = \mathbf {q}_{i} \circ \Delta \mathbf {q}(\mathbf {q}_{i}, \mathbf {\Omega }_{i}), $$
(50)

where \(\mathbf {\Omega }_{i}\) is the incremental rotation vector of step \(i\) and \(\mathbf {q}_{i}\) represents the rotation parameters at the \(i\)th step; see, e.g. [3, 8]. In order to obtain \(\mathbf {\Omega }_{i}\), we write Eq. (6) as

$$ \dot {\mathbf {\Omega }}_{i} = \mathbf {T}_{\boldsymbol {\phi }}^{-1}(\mathbf {\Omega }_{i})\,\boldsymbol {\omega }_{i+1}, \quad \mathbf {\Omega }_{0} = \mathbf {0}, $$
(51)

where \(\mathbf {\Omega }_{0}\) is the initial condition for the integration of Eq. (51) in the \(i\)th integration step and \(\boldsymbol {\omega }_{i+1}\) is the angular velocity of step \(i+1\). The equations (51) should be integrated within each integration step together with the dynamical equations of motion, which determine the angular velocity field \(\boldsymbol {\omega }\) from the angular acceleration field

$$ \dot{\boldsymbol {\omega }} = \dot{\boldsymbol {\omega }}(\mathbf {q},\, \boldsymbol {\omega }) $$
(52)

by using Euler’s EOMs (1); see, for example, [51].

6.1 Explicit Euler (RK1)

Using the time step size \(h\), the explicit Euler method takes the following form for the proposed approach:

$$\begin{aligned} \boldsymbol {\omega }_{i+1} &= \boldsymbol {\omega }_{i} + h\,\dot{\boldsymbol {\omega }}_{i}( \mathbf {q}_{i},\, \boldsymbol {\omega }_{i}), \end{aligned}$$
(53)
$$\begin{aligned} \mathbf {\Omega }_{i} &= h\,\boldsymbol {\omega }_{i+1}, \end{aligned}$$
(54)
$$\begin{aligned} \mathbf {q}_{i+1} &= \mathbf {q}_{i} \circ \Delta \mathbf {q}(\mathbf {q}_{i}, \mathbf {\Omega }_{i}), \end{aligned}$$
(55)

which differs from the standard explicit Euler Lie group method presented in [26] by the fact the no history variables are required. The conventional explicit Euler method for the direct time integration of rotation parameters would have the form

$$\begin{aligned} \boldsymbol {\omega }_{i+1} &= \boldsymbol {\omega }_{i} + h\,\dot{\boldsymbol {\omega }}_{i}( \mathbf {q}_{i},\, \boldsymbol {\omega }_{i}), \end{aligned}$$
(56)
$$\begin{aligned} \mathbf {q}_{i+1} &= \mathbf {q}_{i} + h\,\mathbf {G}^{-1}( \mathbf {q}_{i})\,\boldsymbol {\omega }_{i}. \end{aligned}$$
(57)

The comparison of Eqs. (56)–(57) with Eqs. (53)–(55) shows that the proposed approach can be integrated into existing applications that use three rotation parameters by simply replacingFootnote 13Eq. (57) with Eqs. (54)–(55).

Using the rotation vector, i.e. \(\mathbf {q}=\mathbf {v}\), for Euler’s EOMs (1)

$$ \dot{\boldsymbol {\omega }}_{i} = \mathbf{J}^{-1}\left ( \boldsymbol{\tau }( \mathbf {v}_{i},\, \boldsymbol {\omega }_{i}) - \widetilde {\boldsymbol {\omega }}_{i}\mathbf{J}\boldsymbol {\omega }_{i} \right ) $$
(58)

for the proposed approach, the explicit Euler method takes the form

$$\begin{aligned} \boldsymbol {\omega }_{i+1} &= \boldsymbol {\omega }_{i} + h\,\dot{\boldsymbol {\omega }}_{i}, \end{aligned}$$
(59)
$$\begin{aligned} \mathbf {\Omega }_{i} &= h\,\boldsymbol {\omega }_{i+1}, \end{aligned}$$
(60)
$$\begin{aligned} \varphi _{i+1} &= 2\,\mathrm {acos}\left ( \cos \frac{\varphi _{i}}{2}\cos \frac{\vert \vert \mathbf {\Omega }_{i} \vert \vert }{2} - \frac{\mathbf {n}_{i}^{T}\mathbf {\Omega }_{i}}{2}\sin \frac{\varphi _{i}}{2}\mathrm {sinc}\frac{\vert \vert \mathbf {\Omega }_{i} \vert \vert }{2} \right ), \end{aligned}$$
(61)
$$\begin{aligned} \bar {\mathbf {n}}_{i+1} &= \textstyle\begin{cases} \mathbf {0}\quad \text{if }\varphi _{i+1}\in S_{v},\text{ else} & \\ \frac{\sin \frac{\varphi _{i}}{2}\cos \frac{\vert \vert \mathbf {\Omega }_{i} \vert \vert }{2}}{\sin \frac{\varphi _{i+1}}{2}} \mathbf {n}_{i} + \frac{\mathrm {sinc}\frac{\vert \vert \mathbf {\Omega }_{i} \vert \vert }{2}}{2\sin \frac{\varphi _{i+1}}{2}} \left [ \mathbf {I}\cos \frac{\varphi _{i}}{2} + \widetilde{\mathbf {n}}_{i}\sin \frac{\varphi _{i}}{2} \right ]\mathbf {\Omega }_{i}, & \end{cases}\displaystyle \end{aligned}$$
(62)
$$\begin{aligned} \mathbf {v}_{i+1} &= \varphi _{i+1}\bar {\mathbf {n}}_{i+1}. \end{aligned}$$
(63)

At this point, we would like to give a brief interpretation of the RK1 method with regard to its functionality in a singular point: Since \(\dot{\boldsymbol {\omega }}\) is bounded (due to the physical limitation of torque), \(\boldsymbol {\omega }\) is also bounded, and thus also \(\mathbf {\Omega }\). Consequently, \(\mathbf {v}\) is also bounded due to the definition of the composition rule for rotation vectors defined in Sect. 4. However, if one would consider the direct integration of the kinematic equations of the rotation vector Eq. (87) (Appx. A.3), \(\dot{\mathbf {v}}\) would not be bounded at a singular point.

Note that, according to the explicit Euler method, Eqs. (53)–(55) are only first-order accurate and have a numerical stability limit for the step size \(h\) in case of stiff differential equations.

6.2 Explicit Runge–Kutta method of fourth-order (RK4)

To achieve a higher accuracy with larger step sizes \(h\), we consider the explicit fourth-order Runge–Kutta method presented for time integration of Euler parameters by Terze et al. in [51] in all presented numerical examples, which we have written here in accordance with the proposed approach. Starting with values at the previous step \(\mathbf {q}_{i}\), \(\boldsymbol {\omega }_{i}\), the slope estimations are obtained by

k 1 =h ω ˙ ( q i , ω i ), K 1 =h T ϕ 1 (0) ω i ,
(64)
k 2 =h ω ˙ ( q i Δq( q i , 1 2 K 1 ), ω i + 1 2 k 1 ), K 2 =h T ϕ 1 ( 1 2 K 1 )( ω i + 1 2 k 1 ),
(65)
k 3 =h ω ˙ ( q i Δq( q i , 1 2 K 2 ), ω i + 1 2 k 2 ), K 3 =h T ϕ 1 ( 1 2 K 2 )( ω i + 1 2 k 2 ),
(66)
k 4 =h ω ˙ ( q i Δq( q i , K 3 ), ω i + k 3 ), K 3 =h T ϕ 1 ( K 3 )( ω i + k 3 ).
(67)

The four coefficients \(\mathbf{K}_{1},\ldots ,\mathbf{K}_{4}\) represent the slopes within one time step \((i \rightarrow i+1)\) in the solution process of Eq. (51) and the four coefficients \(\mathbf{k}_{1},\ldots ,\mathbf{k}_{4}\) contain the slopes within one time step in the solution process of the dynamic equations of motion. The equations

$$\begin{aligned} \boldsymbol {\omega }_{i+1} &= \boldsymbol {\omega }_{i} + \frac{1}{6}\left (\mathbf{k}_{1} + 2 \mathbf{k}_{2} + 2\mathbf{k}_{3} + \mathbf{k}_{4} \right ), \end{aligned}$$
(68)
$$\begin{aligned} \mathbf {\Omega }_{i} &= \frac{1}{6}\left (\mathbf{K}_{1} + 2\mathbf{K}_{2} + 2\mathbf{K}_{3} + \mathbf{K}_{4} \right ), \end{aligned}$$
(69)
$$\begin{aligned} \mathbf {q}_{i+1} &= \mathbf {q}_{i} \circ \Delta \mathbf {q}(\mathbf {q}_{i},\, \mathbf {\Omega }_{i}), \end{aligned}$$
(70)

update the angular velocity vector \(\boldsymbol {\omega }\) and the rotation parameter vector \(\mathbf {q}\) to \((\mathbf {q}_{i+1},\, \boldsymbol {\omega }_{i+1})\) based on the current state \((\mathbf {q}_{i},\, \boldsymbol {\omega }_{i})\).

Since the composition rule of two successive rotations can be expressed in a closed form for the rotation vector and the Euler angles, the order of accuracy of the overall algorithm depends only on the accuracy of the ODE integrator used to solve Eq. (51). The main paradigm of the Lie group methods is the reformulation of the underlying equation on the Lie group as an algebra action, and since the Lie algebra is a linear space, all reasonable discretization methods can be expected to respect its structure [23, 24]. Therefore the user can influence the accuracy of the overall algorithm by choosing the ODE integrator to solve Eq. (51).

7 Numerical examples

7.1 Behaviour in singular configurations

As a first numerical example, we investigate the behaviour of the proposed rotation vector and Euler angle approach near and in a singular point where \(\mathbf {G}(\mathbf {q})\) in Eq. (4) becomes singular. For this purpose, we consider a parameter study for the torque-free, free rotation of a rigid body with parametrized initial conditions, which are changed such that the orientation approaches the singular point and finally reaches it. Since there are a total of 12 possible Euler angle sets, we limit ourselves to Cardan/Tait–Bryan angles for the proposed Euler angle approach in all following numerical examples. The rigid body is considered to be a box with inertia tensor \(\mathbf{J}\) given in standard units equal to \(\mathbf{J} = \mathrm{diag}(5.2988, 1.1775, 4.3568)\). The rotation vector parametrization has a singular points at the rotation angles \(\varphi \in S_{v}\), see Eq. (87) in Appx. A.3, whereas the Cardan/Tait–Bryan angles exhibit a singular point at \(\alpha _{2}=\pm n\frac{\pi }{2}\) with \(n\in \mathbb {N}\), see Eq. (88) in Appx. A.4. In order to determine \(\boldsymbol {\omega }(t)\), \(\mathbf {\Omega }(t)\) and thus also \(\mathbf {v}(t)\) and \(\boldsymbol {\alpha }(t)\), Euler’s equations of motion (1) as well as the incremental rotation vector differential equation (36) are integrated using the RK4 algorithm presented in Sect. 6.2, whereby in the proposed Cardan/Tait–Bryan approach we use the exponential map Eq. (78) as a coordinate map. Similar results for Cardan/Tait–Bryan angles can be obtained by choosing the Cayley transform Eq. (83) as a coordinate map. The whole algorithm has been implemented in MATLAB R2018b.

7.1.1 Numerical tests for the proposed rotation vector approach

In this subsection we investigate the behaviour of the rotation vector approach proposed in this paper near and in the singular point at \(\varphi =0\). Similar results can be obtained for other singular points of the rotation vector. In order to reach the singular point at \(\varphi =0\) step by step, we change the initial condition for angular velocity according to

$$ \boldsymbol {\omega }_{0} = \begin{bmatrix} 0, & 2\pi , & 2\pi \epsilon \end{bmatrix} ^{T}, $$
(71)

gradually increasing the factor \(\epsilon \in \left \{ 0,\,\textrm{1e--7},\,\textrm{1e--5},\, 1\right \} \) whereby the initial orientation of the rigid body is kept constant at \(\mathbf {v}_{0}= \begin{bmatrix} 0, & -\frac{\pi }{2}, & 0\end{bmatrix} ^{T}\text{ rad}\). Thus, the singular point is reached after \(t=0.5\text{ s}\).

As can be seen in Fig. 3(a), in the case of \(\varphi =0\), the rotation vector \(\mathbf {v}_{\mathrm{StdAppr}}\) can no longer be determined by integrating Eq. (87) at \(t=0.5\text{ s}\) due to the division by zero. In contrast, as can be seen in Fig. 3(b), the proposed approach for computing a rotation vector update \(\mathbf {v}_{\mathrm{PropAppr}}\) is able to pass through the singular point without failing.

Fig. 3
figure 3

Time history of the rotating rigid body’s rotation angle \(\Vert \mathbf {v}\Vert _{2}\) using different initial conditions, see Eq. (71). (a) shows the time history of the rotation angle \(\Vert \mathbf {v}_{\mathrm{StdAppr}}\Vert _{2}\) computed by direct time integration of Eq. (87). (b) shows the time history of the rotation angle \(\Vert \mathbf {v}_{\mathrm{PropAppr}}\Vert _{2}\) computed with the proposed approach

Figure 4 illustrates convergence in the norm of the rotation error \(\Vert \mathbf {v}_{\mathrm{Ref}} - \mathbf {v}_{ \mathrm{converged}}\Vert \) for decreasing values of the integration step \(h_{n} = (2^{(1-n)})_{n=2,3,\ldots,15}\), where the rotation vector \(\mathbf {v}_{\mathrm{StdAppr}}\) is obtained by directly integrating (87). The converged reference solution \(\mathbf {v}_{\mathrm{Ref}}\) is obtained with \(h=1/32768\text{ s}\) using the proposed approach. As can be seen in Fig. 4(a), the rotation vector \(\mathbf {v}_{\mathrm{StdAppr}}\) converges slower the closer the rotation angle comes to the singular point at \(\varphi =0\) and it even fails as the rotation angle reaches \(\varphi =0\). The failure of the standard method corresponds to the expectation, since in the kinematic Eq. (87) a division by zero occurs at \(\varphi =0\). In contrast, the rotation vector \(\mathbf {v}_{\mathrm{PropAppr}}\) computed with the proposed approach exhibits the expected fourth-order convergence characteristics for all considered values of \(\epsilon \), as can be seen in Fig. 4(b). Furthermore, as can be seen in Fig. 4(b), the rotation angle \(\Vert \mathbf {v}_{\mathrm{PropAppr}}\Vert _{2}\) for \(\epsilon =0\) is already converged at larger time steps, such that \(\Vert \mathbf {v}_{\mathrm{Ref}} - \mathbf {v}_{ \mathrm{converged}}\Vert =0\), except at \(h=1/2048\) where a deviation of approximately \(1\textrm{e--}13\) is observed. To illustrate the situation \(\Vert \mathbf {v}_{\mathrm{Ref}} - \mathbf {v}_{ \mathrm{converged}}\Vert =0\) in a better way, \(\Vert \mathbf {v}_{\mathrm{Ref}} - \mathbf {v}_{ \mathrm{converged}}\Vert =1\textrm{e--}14\) was set in Fig. 4(b) for \(\epsilon =0\).

Fig. 4
figure 4

Error in the norm of the rotating rigid body’s rotation vector shown on a double-logarithmic scale

7.1.2 Numerical tests for the proposed Cardan/Tait–Bryan angle approach

In this subsection we investigate the behaviour of the proposed Cardan/Tait–Bryan angle approach near and in the singular point at \(\alpha _{2}=\frac{\pi }{2}\). In order to reach the singular point at \(\alpha _{2}=\frac{\pi }{2}\) step by step, we change the initial condition for angular velocity according to

$$ \boldsymbol {\omega }_{0} = \begin{bmatrix} 0, & \pi , & \pi \epsilon \end{bmatrix} ^{T}, $$
(72)

gradually increasing the factor \(\epsilon \in \left \{ 0,\,\textrm{1e--5},\,\textrm{1e--2},\, \textrm{1e--1}\right \} \) whereby the initial orientation of the rigid body is kept constant at \(\boldsymbol {\alpha }_{0}= \begin{bmatrix} 0, & 0, & 0\end{bmatrix} ^{T}\text{ rad}\). Thus, the singular point is reached after \(t=0.5\text{ s}\).

As can be seen in Fig. 5(a), as \(\Vert \boldsymbol {\alpha }_{\mathrm{StdAppr}}\Vert _{2}\) (which is dominated by the rotation angle \(\alpha _{2}\)) comes to the singular point at \(\alpha _{2}=\frac{\pi }{2}\), \(\Vert \boldsymbol {\alpha }_{\mathrm{StdAppr}}\Vert _{2}\) can no longer be determined at \(t=0.5\text{ s}\) by integrating the kinematic equation (88). This corresponds to the expectation, since in Eq. (88) a division by zero occurs at \(\alpha _{2}=\frac{\pi }{2}\). In contrast, as can be seen in Fig. 5(b), the proposed approach is able to pass through the singular point at \(\alpha _{2}=\frac{\pi }{2}\) without failing.

Fig. 5
figure 5

Time history of the rotating rigid body’s norm of Cardan/Tait–Bryan angles for different initial conditions, see Eq. (72)

In the case that \(\epsilon =0\), the rigid body performs a pure rotation around the middle axis of rotation. For this simple case an analytical solution of Eq. (88) for the rotation angle \(\alpha _{2}\) can be given, which is

$$ \alpha _{2}^{\mathrm{Analytical}}(t)= t \pi . $$
(73)

However, as can be seen in Fig. 6(b), the Cardan/Tait–Bryan angles determined with the proposed approach show finite jumps compared to the analytical solution (Fig. 6(a)) at angle values for \(\alpha _{2}= n\frac{\pi }{2}\) with \(n\in \mathbb {N}\) (these are the angle values where the Cardan/Tait–Bryan angle parametrization has singular points). However, the Cardan/Tait–Bryan angles determined with the proposed approach can, if desired, be converted in the course of post-processing, see Fig. 7(a). The conversion can be done by evaluating the rotation matrix and extracting the angles as shown for example in [19]. However, we would like to emphasize that this conversion is not necessary in order to uniquely represent the rotational attitude of a rigid body using the proposed approach. Figure 7(b) shows the deviation of the converted angle \(\alpha _{2}\) from the analytic solution for a time interval of 100 s, whereby the angles determined with the proposed approach were determined with a time step size of \(h=1\textrm{e--}3\text{ s}\).

Fig. 6
figure 6

Time evolution of the rotating rigid body’s Cardan/Tait–Bryan angles in case of a pure rotation around the middle axis of rotation

Fig. 7
figure 7

Time evolution of the rotating rigid body’s of Cardan/Tait–Bryan angle \(\alpha _{2}\) in case of a pure rotation around the middle axis of rotation

Figure 8 illustrates convergence in the norm of the rotation error \(\Vert \boldsymbol {\alpha }_{\mathrm{Ref}} - \boldsymbol {\alpha }_{\mathrm{converged}} \Vert \) for decreasing values of the integration step \(h_{n} = (2^{(1-n)})_{n=1,2,\ldots,14}\), where the rotation vector \(\boldsymbol {\alpha }_{\mathrm{StdAppr}}\) is obtained by integrating the kinematic equation (88). The converged reference solution \(\boldsymbol {\alpha }_{\mathrm{Ref}} \) is obtained with \(h=1/16384\text{ s}\) using the proposed approach. As can be seen in Fig. 8(a), \(\boldsymbol {\alpha }_{\mathrm{StdAppr}}\) converges slower the closer \(\alpha _{2}\) comes to the singular point at \(\alpha _{2}=\frac{\pi }{2}\) and it even fails as the rotation angle \(\alpha _{2}\) reaches \(\alpha _{2}=\frac{\pi }{2}\). The failure of the standard method corresponds to the expectation, since in the kinematic Eq. (88) a division by zero occurs at \(\alpha _{2}=\frac{\pi }{2}\). In contrast, the proposed Cardan/Tait–Bryan angle approach exhibits the expected fourth-order convergence characteristics for all considered values of \(\epsilon \), as can be seen in Fig. 8(b). Furthermore, as can be seen in Fig. 8(b), \(\Vert \boldsymbol {\alpha }_{\mathrm{PropAppr}}\Vert _{2}\) is in case that \(\alpha _{2}=\frac{\pi }{2}\) already converged at larger time steps. For the convergence investigations in Fig. 8, the Cardan/Tait–Bryan angles determined with the proposed approach were converted as described above in the case of \(\epsilon =0\).

Fig. 8
figure 8

Error in the norm of the rotating rigid body’s Cardan/Tait–Bryan angles shown on a double-logarithmic scale

7.1.3 Influence of the used ODE integrator for solving Eq. (51)

To illustrate how the accuracy of the proposed approach depends on the order of the ODE integrator used to integrate Eq. (51), we compare in Fig. 9 the rotation vector error when the integration of Eq. (51) (resp. Eq. (36)) was performed using the two methods RK1 (see Sect. 6.1) and RK4 (see Sect. 6.2). As model problem we consider here the rotation of a torque-free rigid body about an axis close to its unstable axis of rotation. The rigid body is considered to be a box with inertia tensor equal to \(\mathbf{J} = \mathrm{diag}(5.2988, 1.1775, 4.3568)\). Since \(J_{11} > J_{33} > J_{22}\), an unstable rotation about the third axis is expected. The initial conditions are set as \(\mathbf {v}_{0} = \begin{bmatrix} 0, & 0, & 0\end{bmatrix} ^{T}\) and \(\boldsymbol {\omega }_{0}= \begin{bmatrix} 0.01, & 0, & 100 \end{bmatrix} ^{T}\).

Fig. 9
figure 9

Convergence in the norm of the rotation vector, shown on a double-logarithmic scale

Figure 9 illustrates convergence in the norm of the rotation error \(\Vert \mathbf {v}_{\mathrm{Ref}} - \mathbf {v}_{\mathrm{converged}}\Vert \) for decreasing values of the integration step \(h_{n} = (\frac{1}{2}\cdot 10^{(1-n)})_{n=2,3,\ldots,6}\), where the converged reference solution \(\mathbf {v}_{\mathrm{Ref}}\) is obtained with \(h=1/2000000\text{ s}\). Convergence is investigated at \(t=0.5\text{ s}\). As can be seen in Fig. 9, the overall integration results show first and fourth order convergence characteristics as expected. This demonstrates the fact that the order of accuracy of the proposed approach can be selected by the user and that it depends only on the accuracy of the ODE integrator used for the integration of Eq. (51). The versatility of the proposed approach in terms of the possibility of arbitrarily selecting the order of accuracy according to the field of application should contribute positively to its use in the various fields of application, including those requiring higher-order integration schemes. The same behaviour is observed in the Euler angle integration scheme presented in this paper. However, due to space reasons we do not present the corresponding figure here. We would like to note that the latter behaviour is also observed for the Euler parameter integration scheme presented in [51].

7.1.4 Convergence comparison with the standard Lie group method

To illustrate how the proposed approach compares to the standard Lie group method in terms of accuracy, we compare in Fig. 10 the position error of a point \(\mathbf{p}= \begin{bmatrix} 1, & 1, & 1\end{bmatrix} ^{T}\) that is located on a rotating rigid body. In the standard Lie group method, the point \(\mathbf{p}\) is rotated with the rotation matrix obtained from Eq. (5). In the proposed approach for the integration of the rotation vector the point \(\mathbf{p}\) is rotated with the rotation matrix Eq. (86), which is computed from the rotation vector obtained from Eq. (26). In the proposed approach for the integration of the Cardan/Tait–Bryan (CTB) angles, the point \(\mathbf{p}\) is rotated using the rotation matrix Eq. (77), which is computed based on the Cardan/Tait–Bryan angles obtained from Eq. (49). As coordinate map \(\boldsymbol {\phi }\) the exponential map Eq. (77) is used. The time integration of Eq. (51) is performed with the RK4 method shown in Sect. 6.2.

Fig. 10
figure 10

Convergence in the norm of position vector \(\mathbf{p}(t)\), shown on a double-logarithmic scale

The rigid body is considered to be a box with inertia tensor equal to \(\mathbf{J} = \mathrm{diag}(5.2988, 1.1775, 4.3568)\) that rotates about an axis close to its unstable axis of rotation. No external torques are acting on the rigid body. Since \(J_{11} > J_{33} > J_{22}\), an unstable rotation about the third axis is expected. The initial conditions are set as \(\mathbf {R}_{0} = \mathbf {I}\), \(\mathbf {v}_{0} = \boldsymbol {\alpha }_{0} = \begin{bmatrix} 0, & 0, & 0\end{bmatrix} ^{T}\) and \(\boldsymbol {\omega }_{0}= \begin{bmatrix} 0.01, & 0, & 100 \end{bmatrix} ^{T}\).

Figure 10 illustrates convergence in the norm of the position error \(\Vert \mathbf{p}_{\mathrm{Ref}} - \mathbf{p}_{\mathrm{converged}} \Vert \) for decreasing values of the time step \(h_{n} = (10^{-2}\cdot 2^{(1-n)})_{n=1,2,\ldots,7}\). Convergence is investigated at \(t=1\text{ s}\). The converged reference solution \(\mathbf{p}_{\mathrm{Ref}}\) is obtained with \(h=1/12800\text{ s}\) using the standard Lie group method. Table 1 shows the position error \(\Vert \mathbf{p}_{\mathrm{Ref}} - \mathbf{p}_{\mathrm{converged}} \Vert \) of the three methods considered.

Table 1 Position error \(\Vert \mathbf{p}_{\mathrm{Ref}} - \mathbf{p}_{\mathrm{converged}} \Vert \) of the three methods considered

As can be seen in Fig. 10 and Table 1, the proposed approach exhibits almost the same convergence behaviour as the standard Lie group method. The difference between the standard Lie group method and the proposed approach that can be observed in Table 1 is due to round-off errors. From this observation we conclude that the proposed method is equivalent to a Lie group method. As the proposed approach is equivalent to a Lie group method, we will not further compare the proposed approach with the standard Lie group method in the following accuracy comparisons. For further investigations and results on Lie group methods, we would like to refer to the corresponding literature; see, e.g. [2, 3, 18, 26].

7.2 Heavy top

As a second example, we present the integration of the dynamics of a heavy top to illustrate the performance of the proposed approach. The heavy top is a kind of benchmark problem in the context of geometric integration methods, which is, for example, also discussed in [3, 8, 15, 33, 50, 51]. Following [51], the configuration space of the heavy top is set as \(SO(3)\) and the dynamical model is formulated in the classical ODE form on the basis of Euler’s rotational equation

$$ \mathbf{J}_{\textrm{FP}}\dot{\boldsymbol {\omega }} + \widetilde {\boldsymbol {\omega }}\mathbf{J}_{ \textrm{FP}}\boldsymbol {\omega }= \boldsymbol{\tau }_{\textrm{FP}}. $$
(74)

In Eq. (74), \(\boldsymbol {\omega }\) and \(\dot{\boldsymbol {\omega }}\) are the body angular velocity and angular acceleration, \(\mathbf{J}_{\textrm{FP}}\) is the tensor of inertia with respect to the top’s fixed point, which is computed from the mass center inertia tensor \(\mathbf{J}\) using the parallel-axis theorem

$$ \mathbf{J}_{\textrm{FP}} = \mathbf{J} - m\widetilde{\mathbf{r}}_{b} \widetilde{\mathbf{r}}_{b}. $$
(75)

In Eq. (75), \(m\) is body mass and \(\mathbf{r}_{b}\) is the body mass center position expressed in the body fixed frame with respect to the top’s fixed point. The gravity torque \(\boldsymbol{\tau }_{\textrm{FP}}\) with respect to the fixed point is computed as

$$ \boldsymbol{\tau }_{\textrm{FP}}=m\widetilde{\mathbf{r}}_{b}\mathbf {R}^{T} \mathbf{g}, $$
(76)

where \(\mathbf{g}=\left [0, \,\, 0, \,\, -9.81 \right ]^{T}\) represents gravity and \(\mathbf {R}\) is a rotation matrix.Footnote 14

In standard units, the mass center inertia tensor is defined as

$$ \mathbf{J} = \mathrm{diag}(0.234375, 0.46875, 0.234375), $$

the mass \(m\) is given by \(m = 15\), and the center of the mass is positioned in the body-fixed frame at \(\mathbf{r}_{b} = \left [0, \,\, 1, \,\, 0 \right ]^{T}\). The initial conditions are set as \(\mathbf {q}_{0} = \left [0, \,\,\, 0, \,\, 0 \right ]^{T}\) and \(\boldsymbol {\omega }_{0}=\left [0, \,\, 150, \,\, -4.61538 \right ]^{T}\).

In order to determine \(\boldsymbol {\omega }(t)\), \(\mathbf {\Omega }(t)\) and thus also the rotation vector \(\mathbf {v}(t)\) as well as the Cardan/Tait–Bryan angles \(\boldsymbol {\alpha }(t)\), the equations of motion (74) as well as the incremental rotation vector ODE (36) are integrated using the RK4 algorithm shown in Sect. 6.2. In the proposed Cardan/Tait–Bryan angle approach, we use the exponential map as a coordinate map. Similar results can be obtained by choosing the Cayley transform as a coordinate map. The whole algorithm has been implemented in MATLAB R2018b. The integration results, obtained using a fixed time step size of \(h = 1e-3 s\), are shown in Figs. 1117.

Fig. 11
figure 11

Spatial trajectory of body mass center

The variables \(\boldsymbol {\omega }(t)\), \(\mathbf {v}(t)\) and \(\boldsymbol {\alpha }(t)\) shown in Figs. 14 and 1516 are basic results that result from the integration of the equations of motion and from the selected rotation parameters, while the results shown in Figs. 11, 12, 13 and 17 are computed on the basis of \(\mathbf {v}(t)\) and \(\boldsymbol {\omega }(t)\) using basic kinematic relationships. The results shown in Figs. 1113 and 17 can, of course, also be achieved with the proposed Cardan/Tait–Bryan angle approach, which is why we do not present them explicitly here.

Fig. 12
figure 12

Position of body mass center

Fig. 13
figure 13

Velocity of body mass center

Fig. 14
figure 14

Body angular velocity

The time evolution of the rotation vector components as well as the time evolution of the Cardan/Tait–Bryan angle components, obtained by the proposed approach, are illustrated in Figs. 1516.

Fig. 15
figure 15

Components of rotation vector (proposed approach)

Fig. 16
figure 16

Components of Cardan/Tait–Bryan angles (proposed approach)

The deviation of the orthogonality constraint of the rotation matrix is shown in Fig. 17(a). As can be seen in Fig. 17(a), the proposed approach does not introduce any drift in the integration results during the whole simulation time domain of 1000 s. In comparison, Fig. 17(a) shows the deviation of the orthogonality condition of the rotation matrix in the case where Euler parameters are used as rotation parameters, whereby the Euler parameters were computed using the method presented by Terze et al. in [51]. As illustrated in Fig. 17(b), the maximum error of the orthogonality constraint of the rotation matrix is for the simulation time domain of 1000 s in the range of machine precision.

Fig. 17
figure 17

Time evolution of the norm of rotation matrix orthogonality condition as well as maximum error in rotation matrix orthogonality condition computed for one million steps

Figure 18 illustrates the convergence in norm of the rotation error \(\Vert \mathbf {v}-\mathbf {v}_{\mathrm{converged}}\Vert \) as well as the convergence in norm of the rotation error \(\Vert \boldsymbol {\alpha }- \boldsymbol {\alpha }_{\mathrm{converged}}\Vert _{2}\) for decreasing values of the time step \(h_{n} = (10^{-2}\cdot 2^{(1-n)})_{n=1,2,\ldots,11}\). The reference solution for the rotation vector \(\mathbf {v}_{\mathrm{converged}} = \mathbf {v}(t = 1)\) as well as the reference solution for the Cardan/Tait–Bryan angles \(\boldsymbol {\alpha }_{\mathrm{converged}} = \boldsymbol {\alpha }(t = 1)\) were computed using the proposed approach and a integration step of \(h = 1/204800\). In order to be able to compare the convergence behaviour of the proposed approach with the convergence behaviour of the standard approach (direct integration of the kinematic equations of the rotation vector and the Cardan/Tait–Bryan angles), the initial orientation of the heavy top may not be defined by \(\mathbf {v}_{0} = \mathbf {0}\), since the kinematic equations (87) of the rotation vector cannot be evaluated at \(\mathbf {v}_{0} = \mathbf {0}\) (because of the division by zero). Therefore, the initial conditions for the convergence considerations are set as \(\mathbf {q}_{0} = \mathbf {v}_{0} = \boldsymbol {\alpha }_{0} = \left [0, \,\, 0.52359877, \,\, 0 \right ]^{T}\text{ rad}\).

Fig. 18
figure 18

Comparison of the convergence of the norm of the rotation vector error and of the norm of Cardan/Tait–Bryan angle error, shown on a double-logarithmic scale

As can be seen in Fig. 18(a) as well as in Fig. 18(b), the proposed approach for computing a rotation vector update and a Cardan/Tait–Bryan angle update exhibit smaller errors (of about the order of \(1\textrm{e--}2\)) in norm of the rotation error for each time step \(h\) in comparison to the rotation updates computed by directly integrating the corresponding kinematic equations. Especially the newly introduced rotation vector formulation shows a much smaller error at larger time steps than the direct integration of the corresponding kinematic equations, as can be seen in Fig. 18(a).

7.3 Computational costs

Finally, we compare in Tables 23 the number of arithmetic operations required by the proposed approach Eq. (9) with those required by the standard Lie group method Eq. (5) and by the Euler parameter integration scheme presented in [51] to determine an update for the rotation vector or Euler angles. For the comparison of the standard Lie group method and the Euler parameter integration scheme with the proposed approach, three rotation parameters are computed from the rotation matrix Eq. (5), respectively the Euler parameters computed with Eq. (12) in [51]. The rotation matrix \(\mathbf {R}_{0}\) in Eq. (5) and the Euler parameters \(\boldsymbol{\theta }_{0}\) are reconstructed from the rotation vector \(\mathbf {v}_{0}\) and the Cardan/Tait–Bryan angles \(\boldsymbol {\alpha }_{0}\), respectively. The cost of the integration of the incremental rotation vector differential equation (6) is left out in the following considerations, since the computational cost depends on the chosen integration scheme. As the three rotation parameters determined by direct integration of the kinematic equations (4) cannot be determined in singular points, we do not consider the computational costs of this methods any further here. The columns in Tables 23 show the respective number of additions, subtractions, multiplications, divisions, trigonometric functions and roots and the results of adding all these together. While the rows of Tables 23 show the method considered in each case.

Table 2 Number of arithmetic operations needed in the proposed approach Eq. (26), in the standard Lie group method Eq. (5), and in the quaternion integration scheme [51] for computing a rotation vector update. Note that \(f(\cdot )\) is a function that computes the rotation vector from a given rotation matrix \(\mathbf {R}\) according to page 54 in [46], respectively Euler parameters according to page 482 in [42]. Note also that the term \(\textrm {exp}\) or \(\textrm {cay}\) in the second and third row indicates which coordinate map is used in Eq. (5)
Table 3 Number of arithmetic operations needed in the proposed approach Eq. (49), in the standard Lie group method Eq. (5), and in the quaternion integration scheme [51] for computing a Cardan/Tait–Bryan angle update. Note that \(f(\cdot )\) is a function that computes Cardan/Tait–Bryan angles from a given rotation matrix \(\mathbf {R}\) according to page 15 in [19], respectively Euler parameters according to page 469 in [42]. Note also that the term \(\textrm {exp}\) or \(\textrm {cay}\) indicates which coordinate map is used as the basis of the respective formulation

As shown in Table 2, the proposed rotation vector approach requires fewer operations to determine a rotation vector update as compared to determining the rotation vector update from the rotation matrix computed with the standard Lie group method. In contrast, the method which computes an update for the rotation vector from the Euler parameters requires fewer operations than the proposed approach. As shown in Table 3, the proposed Cardan/Tait–Bryan angle approach requires fewer operations to determine a Cardan/Tait–Bryan angle update as compared to determining the Cardan/Tait–Bryan angle update from the rotation matrix. In contrast, the method which computes an update for the Cardan/Tait–Bryan angles from the Euler parameters requires fewer operations as the proposed approach.

8 Conclusions

A novel numerical solution for solving rotational kinematics by using three rotation parameters is presented in this paper. The proposed approach is illustrated by the example of the rotation vector and the Euler angles. In contrast to standard formulations based on three rotation parameters, in which singular points are avoided, for example, by applying reparametrization strategies, singular points can be passed through in the proposed approach by computation of finite increments of rotation. On the contrary to standard formulations based on three rotation parameters, the proposed approach is based on the numerical integration of the kinematic relations in the form of the so-called incremental rotation vector. The kinematic relations of the incremental rotation vector form a system of ODEs on the Lie algebra \(\mathfrak {so}(3)\) of the rotation group \(SO(3)\) that can be solved singularity-free by any standard ODE integration scheme. In the proposed approach, after the incremental rotation vector has been determined for the current step, the rotation parameter update for the current step is determined with the composition rule of rotations that applies to the particular rotation parameters using the finite increments of rotation (which are expressed in dependence of the incremental rotation vector), and the rotation parameters of the previous integration step.

By taking this route, the proposed approach is able to reconstruct the rotation parameters even in singular configurations. As shown in the paper, the proposed approach exhibits the same accuracy as the standard Lie group method and the accuracy is higher as compared to the direct time integration of rotation parameters. As the presented results show, the order of accuracy of the presented integration scheme depends only on the accuracy of the ODE integrator used for solving Eq. (51). Therefore the user can influence the accuracy of the overall algorithm by choosing the ODE integrator to solve Eq. (51).

The new methods proposed in this paper are more favourable compared to the standard Lie group method in terms of their computational effort. However, the newly proposed methods are less favourable in terms of the required computational effort as compared to reconstructing the rotation vector or Cardan/Tait–Bryan angles from the Euler parameter integration scheme proposed in [51]. Therefore, the improvement of the proposed approach regarding its computational efficiency will be the subject of future research.

For solving stiff problems, the use of an implicit time integration scheme is advantageous [18]. Therefore, embedding the proposed approach in an implicit time integration scheme will be the content of future work.

In summary, the current paper provides a novel numerical solution for the long-standing problem of direct time integration of Euler angles and, alternatively, the rotation vector. The paper provides ready to implement update formulas that allow to compute consistent updates for the rotation vector and the Euler angles. The provided update formulas can be easily integrated into existing codes that uses either the rotation vector or Euler angles and provide a novel implementation strategy of Lie group methods.