Skip to main content
Log in

Singularity-free time integration of rotational quaternions using non-redundant ordinary differential equations

  • Published:
Multibody System Dynamics Aims and scope Submit manuscript

Abstract

A novel ODE time stepping scheme for solving rotational kinematics in terms of unit quaternions is presented in the paper. This scheme inherently respects the unit-length condition without including it explicitly as a constraint equation, as it is common practice. In the standard algorithms, the unit-length condition is included as an additional equation leading to kinematical equations in the form of a system of differential-algebraic equations (DAEs). On the contrary, the proposed method is based on numerical integration of the kinematic relations in terms of the instantaneous rotation vector that form a system of ordinary differential equations (ODEs) on the Lie algebra \(\mathit{so}(3)\) of the rotation group \(\mathit{SO}(3)\). This rotation vector defines an incremental rotation (and thus the associated incremental unit quaternion), and the rotation update is determined by the exponential mapping on the quaternion group. Since the kinematic ODE on \(\mathit{so}(3)\) can be solved by using any standard (possibly higher-order) ODE integration scheme, the proposed method yields a non-redundant integration algorithm for the rotational kinematics in terms of unit quaternions, avoiding integration of DAE equations. Besides being ‘more elegant’—in the opinion of the authors—this integration procedure also exhibits numerical advantages in terms of better accuracy when longer integration steps are applied during simulation. As presented in the paper, the numerical integration of three non-linear ODEs in terms of the rotation vector as canonical coordinates achieves a higher accuracy compared to integrating the four (linear in ODE part) standard-quaternion DAE system. In summary, this paper solves the long-standing problem of the necessity of imposing the unit-length constraint equation during integration of quaternions, i.e. the need to deal with DAE’s in the context of such kinematical model, which has been a major drawback of using quaternions, and a numerical scheme is presented that also allows for longer integration steps during kinematic reconstruction of large three-dimensional rotations.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17
Fig. 18
Fig. 19
Fig. 20
Fig. 21
Fig. 22
Fig. 23

Similar content being viewed by others

References

  1. Betsch, P., Siebert, R.: Rigid body dynamics in terms of quaternions: Hamiltonian formulation and conserving numerical integration. Int. J. Numer. Methods Eng. 79, 444–473 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  2. Nikravesh, P.E.: Spatial kinematic and dynamic analysis with Euler parameters. In: Haug, E.J. (ed.) Computer Aided Analysis and Optimization of Mechanical System Dynamics, pp. 261–281. Springer, Heidelberg (1984)

    Chapter  Google Scholar 

  3. Altmann, S.L.: Rotations, Quaternions, and Double Groups. Oxford University Press, Oxford (1986)

    MATH  Google Scholar 

  4. Holm, D.D.: Geometric Mechanics. Part II: Rotating, Translating and Rolling. Imperial College Press, London (2008)

    Book  MATH  Google Scholar 

  5. Barker, L.E., Bowles, R.L., Williams, L.H.: Development and application of a local linearization of quaternion rate equations in real-time flight simulation problems. NASA tech. note, TN D-7347 (1973)

  6. Nikravesh, P.E.: Computer-Aided Analysis of Mechanical Systems. Prentice Hall, Englewood Hills (1988)

    Google Scholar 

  7. Bauchau, O.A.: Flexible Multibody Dynamics. Springer, Dordrecht (2011)

    Book  MATH  Google Scholar 

  8. Hamilton, W.R.: Lectures on Quaternions. Hodges and Smith, Dublin (1853)

    Google Scholar 

  9. Hamilton, W.R.: Elements of Quaternions, 3rd edn. Chelsea, New York (1969)

    Google Scholar 

  10. Tait, P.G.: An Elementary Treatise on Quaternions. MacMillan, London (1867)

    MATH  Google Scholar 

  11. Kelland, P., Tait, P.G.: Introduction to Quaternions, with Numerous Examples. MacMillan, London (1882)

    MATH  Google Scholar 

  12. Cayley, A.: On certain results relating to quaternions. In: The Collected Mathematical Papers of Arthur Cayley, vol. 1, pp. 123–126 (1889)

    Google Scholar 

  13. Altmann, S.L.: Hamilton, Rodrigues, and the quaternion scandal. Math. Mag. 62, 306 (1989)

    Article  MathSciNet  MATH  Google Scholar 

  14. Vince, J.: Quaternions for Computer Graphics. Springer, London (2011)

    Book  MATH  Google Scholar 

  15. Robinson, A.C.: On the use of quaternions in simulation of rigid-body motion. Tech. rep., Aeronautical Research Lab., Wright Air Development Center, Dayton, OH, pp. 58–17 (1958)

  16. Taylor, R.H.: Planning and execution of straight line manipulator trajectories. IBM J. Res. Dev. 23, 424–436 (1979)

    Article  Google Scholar 

  17. Huston, R.L., Kelly, F.A.: The development of equations of motion of single-arm robots. IEEE Trans. Syst. Man Cybern. 12, 259–266 (1982)

    Article  MathSciNet  MATH  Google Scholar 

  18. Meyer, G.: Design and global analysis of spacecraft attitude control systems. NASA tech. rep., R-361 (1971)

  19. Junkins, J.L., Turner, J.D.: Optimal continuous torque attitude maneuvers. J. Guid. Control 3, 210–217 (1980)

    Article  MathSciNet  Google Scholar 

  20. Shoemake, K.: Animating rotation with quaternion curves. Comput. Graph. 19, 245–254 (1985)

    Article  Google Scholar 

  21. Horn, B.K.P.: Closed-form solution of absolute orientation using unit quaternions. J. Opt. Soc. Am. 4, 629–642 (1987)

    Article  Google Scholar 

  22. Morawiec, A.: Orientations and Rotations. Springer, Berlin (2004)

    Book  MATH  Google Scholar 

  23. D’Souza, A.F., Garg, V.K.: Advanced Dynamics, Modeling and Analysis. Prentice–Hall, Englewood Cliffs (1984)

    Google Scholar 

  24. Goldstein, H.: Classical Mechanics. Addison–Wesley, Reading (1980)

    MATH  Google Scholar 

  25. Hairer, E., Lubich, C., Wanner, G.: Geometric Numerical Integration. Springer, Berlin (2006)

    MATH  Google Scholar 

  26. Iserles, A., Munthe-Kaas, H.Z., Norsett, S.P., Zanna, A.: Lie group methods. Acta Numer. 9, 215–365 (2000)

    Article  MathSciNet  MATH  Google Scholar 

  27. Munthe-Kaas, H.Z.: Runge–Kutta methods on Lie groups. BIT Numer. Math. 38, 92–111 (1998)

    Article  MathSciNet  MATH  Google Scholar 

  28. Engø, K., Marthinsen, A.: Modeling and solutions of some mechanical problems on Lie groups. Multibody Syst. Dyn. 2, 71–88 (1998)

    Article  MATH  Google Scholar 

  29. Marthinsen, A., Munthe-Kaas, H., Owren, B.: Simulation of ordin differential equations on manifolds: some numerical experiments and verifications. Model. Identif. Control 18, 75–88 (1997)

    Article  MATH  Google Scholar 

  30. Bottasso, C.L., Borri, M.: Integrating finite rotations. Comput. Methods Appl. Mech. Eng. 164, 307–331 (1998)

    Article  MathSciNet  MATH  Google Scholar 

  31. Celledoni, E., Owren, B.: Lie group methods for rigid body dynamics and time integration on manifolds. Comput. Methods Appl. Mech. Eng. 192, 421–438 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  32. Curtis, M.L.: Matrix Groups. Springer, Berlin (1984)

    Book  Google Scholar 

  33. Müller, A.: Group theoretical approaches to vector parameterization of rotations. J. Geom. Symmetry Phys. 19, 243–272 (2010)

    MathSciNet  MATH  Google Scholar 

  34. Terze, Z., Mueller, A., Zlatar, D.: Lie Group integration method for constrained multibody systems in state space. Multibody Syst. Dyn. 34, 275–305 (2015)

    Article  MathSciNet  MATH  Google Scholar 

  35. Mueller, A., Terze, Z.: On the choice of configuration space for numerical Lie group integration of constrained rigid body systems. J. Comput. Appl. Math. 262, 3–13 (2013)

    Article  MathSciNet  MATH  Google Scholar 

  36. Fukushima, T.: Simple, regular, and efficient numerical integration of rotational motion. Astron. J. 135, 2298–2322 (2008)

    Article  Google Scholar 

  37. Müller, A.: Approximation of finite rigid body motions from velocity fields. Z. Angew. Math. Mech. 90, 514–521 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  38. Becker, C., Betsch, P.: Application of a gyrostatic rigid body formulation in the context of a direct transcription method for optimal control in multibody dynamics. In: Terze, Z. (ed.) Multibody Dynamics: Computational Methods and Applications. Computational Methods in Applied Sciences, pp. 237–254. Springer, Berlin (2014)

    Google Scholar 

  39. Budd, C.J., Iserles, A.: Geometric integration: numerical solution of differential equations on manifolds. Philos. Trans. R. Soc., Math. Phys. Eng. Sci. 357, 945–956 (1999)

    Article  MathSciNet  MATH  Google Scholar 

  40. Munthe-Kaas, H.: High order Runge–Kutta methods on manifolds. Appl. Numer. Math. 29, 115–127 (1999)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Acknowledgement

The authors thank Viktor Pandža, Ph.D. student at University of Zagreb, for programming part of the numerical experiments presented in the paper.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Zdravko Terze.

Appendices

Appendix A: Differential of the exponential map and its inverse

Starting from the rotational motion of one body, we introduce the differential of the exponential mapping \(\operatorname {dexp}: \mathit{so}(3) \times \mathit{so}(3) \to \mathit{so}(3)\) via the ‘left trivialized’ tangent of the exponential map ‘exp’ in such a way that the following expression is valid:

$$ \frac{\mathrm{d}}{\mathrm{d}t}\exp \bigl(\bar{w}(t)\bigr) = \exp \bigl(\bar{w}(t)\bigr) \operatorname {dexp}_{ - \bar{w}(t)}\bigl(\dot{\bar{w}}(t)\bigr), $$
(A.1)

where the function \(\operatorname {dexp}_{ - \bar{w}}\) is defined as

$$\begin{aligned} \operatorname {dexp}_{ - \bar{w}}(w) =& w - \frac{1}{2!} [ \bar{w},w ] + \frac{1}{3!} \bigl[ \bar{w}, [ \bar{w},w ] \bigr] + \frac{1}{4!} \bigl[ \bar{w}, \bigl[ \bar{w}, [ \bar{w},w ] \bigr] \bigr] +\cdots \\ =& \sum_{j = 0}^{\infty} \frac{1}{(j + 1)!} \bigl( - \operatorname {ad}_{\bar{w}}^{j}(w)\bigr), \end{aligned}$$
(A.2)

and the adjoint operator \(\operatorname {ad}_{\bar{w}}\) is given as a Lie bracket,

$$ \operatorname {ad}_{\bar{w}}(w) = \bar{w}w - w\bar{w} = [ \bar{w},w ], \quad\mathrm{for\ all}\ w(t), \bar{w}(t) \in \mathit{so}(3). $$
(A.3)

Furthermore, the inverse function \(\operatorname {dexp}_{ - \bar{w}}^{ - 1}\) is defined by

$$ \operatorname {dexp}_{ - \bar{w}}^{ - 1}(w) = w + \frac{1}{2} [ \bar{w},w ] + \frac{1}{12} \bigl[ \bar{w}, [ \bar{w},w ] \bigr] +\cdots = \sum _{j = 0}^{\infty} \frac{B_{j}}{j!} \bigl( - \operatorname {ad}_{\bar{w}}^{j}(w)\bigr), $$
(A.4)

where \(B_{j}\) are Bernoulli numbers [39]; see also [40]. In above expressions, please note that Eqs. (A.2) and (A.4) are derived under assumption of the ‘left trivialization’ expression in (A.1). This is in accordance with our formulation where the left invariant vector field \(\tilde{\boldsymbol{\omega}}_{i} \in \mathit{so}(3)\) is used in the presented study. However, in the literature, the differential of the exponential mapping is usually defined by using the ‘right trivialized’ formulation in the form:

$$ \frac{\mathrm{d}}{\mathrm{d}t}\exp \bigl(\bar{w}(t)\bigr) = \operatorname {dexp}_{\bar{w}(t)}\bigl(\dot{ \bar{w}}(t)\bigr)\exp \bigl(\bar{w}(t)\bigr). $$
(A.5)

This would lead to expressions of \(\operatorname {dexp}_{\bar{w}}\) and \(\operatorname {dexp}_{\bar{w}}^{ - 1}\) with Lie brackets that would appear with different signs in (A.2) and (A.4). However, please note that, if the right trivialization had been used, the final expressions for \(\operatorname {dexp}_{\bar{w}}\) and \(\operatorname {dexp}_{\bar{w}}^{ - 1}\) would have differed from (A.2) and (A.4) only in the sign of the second term \(\pm \frac{1}{2} [ \bar{w},w ]\).

Appendix B: Newly proposed ODE-based quaternion integration algorithm that inherently respects the unit-length condition without including it explicitly as a constraint equation

By assuming the fourth-order required integration accuracy, the proposed algorithm can be written in the form

$$\begin{gathered} \boldsymbol{\omega}_{0}, \mathrm{q}_{0}, \Delta t, \\ K_{1} = \Delta t \cdot \operatorname {dexp}(\boldsymbol{\omega}_{0}, \boldsymbol{0}), \\ k_{1} = \Delta t \cdot f(\boldsymbol{\omega}_{0}, \mathrm{q}_{0}), \\ K_{2} = \Delta t \cdot \operatorname {dexp}\biggl( \boldsymbol{\omega}_{0} + \frac{1}{2}k_{1}, \frac{1}{2}K_{1} \biggr), \\ k_{2} = \Delta t \cdot f \biggl( \boldsymbol{\omega}_{0} + \frac{1}{2}k_{1}, \mathrm{q}_{0} \circ \exp_{\boldsymbol{\mathcal{S}}^{3}} \biggl( \frac{1}{2}K_{1} \biggr) \biggr), \\ \vdots \\ K_{4} = \Delta t \cdot \operatorname {dexp}(\boldsymbol{\omega}_{0} + k_{3}, K_{3}), \\ k_{4} = \Delta t \cdot f\bigl(\boldsymbol{\omega}_{0} + k_{3}, \mathrm{q}_{0} \circ \exp_{\boldsymbol{\mathcal{S}}^{3}}(K_{3}) \bigr), \\ \mathrm{q}_{\mathrm{out}} = \mathrm{q}_{0} \circ \exp_{\boldsymbol{\mathcal{S}}^{3}} \biggl( \frac{1}{6}(K_{1} + 2K_{2} + 2K_{3} + K_{4}) \biggr), \\ \boldsymbol{\omega}_{\mathrm{out}} = \boldsymbol{\omega}_{0} + \frac{1}{6}(k_{1} + 2k_{2} + 2k_{3} + k_{4}), \end{gathered}$$
(B.1)

where \(f(\boldsymbol{\omega},\mathrm{q})\) represents determination of the derivative of the angular velocity \(\boldsymbol{\omega}\) (by using Euler’s rotational equation, for example) and \(\operatorname {dexp}\) is given by (5) and (7). Lower-order integration algorithms can be written accordingly.

Appendix C

3.1 C.1 Formulation I

The first formulation of rigid body rotational dynamics that includes standard quaternion integration algorithm is described in [6, Chap. 11.2]. Here, the rotational dynamics equations of motion and unit-length quaternion constraint equation \(\mathrm{q}_{i}^{T}\ddot{\mathrm{q}} + \dot{\mathrm{q}}_{i}^{T}\dot{\mathrm{q}}_{i} = 0\) at the acceleration level are assembled in the matrix form, which yields

$$ \left[ \textstyle\begin{array}{c@{\quad}c} \mathbf{J}^{*} & \mathrm{q}\\ \mathrm{q}^{T} & 0 \end{array}\displaystyle \right] \left[ \textstyle\begin{array}{c} \ddot{\mathrm{q}}\\ \boldsymbol{\sigma} \end{array}\displaystyle \right] + \left[ \textstyle\begin{array}{c} 2\mathbf{H}\dot{\mathrm{q}} \\ \dot{\mathrm{q}}^{T}\dot{\mathrm{q}} \end{array}\displaystyle \right] = \left[ \textstyle\begin{array}{c} \mathbf{n}^{*} \\ 0 \end{array}\displaystyle \right], $$
(C.1)

where \(\mathbf{n}^{*} = 2\mathbf{L}^{T}\mathbf{n}\) is the sum of the moments acting on the body expressed in terms of four components. Here

$$ \mathbf{J}^{*} = 4\mathbf{L}^{T}\mathbf{J}\mathbf{L}, $$
(C.2)

is the inertia tensor expressed in terms of four components and

$$ \mathbf{L} = \left[ \textstyle\begin{array}{c@{\quad}c@{\quad}c@{\quad}c} - q_{1} & q_{0} & q_{3} & - q_{2}\\ - q_{2} & - q_{3} & q_{0} & q_{1}\\ - q_{3} & q_{2} & - q_{1} & q_{0} \end{array}\displaystyle \right] $$
(C.3)

is the Euler parameters transformation matrix, while \(\mathbf{H}\) is given as

$$ \mathbf{H} = 4\dot{\mathbf{L}}^{T}\mathbf{J}\mathbf{L}. $$
(C.4)

Using \(\mathbf{L}\), it can be shown that

$$ \dot{\mathrm{q}} = \frac{1}{2}\mathbf{L}^{T}\boldsymbol{\omega}, $$
(C.5)

which represents the identity between the time derivative of the Euler parameters and the angular velocity vector. This means that the first formulation leads to the following integration algorithm:

$$\begin{gathered} \mathrm{q}_{0}, \dot{\mathrm{q}}_{0}, \Delta t, \\ K_{1} = \Delta t \cdot \dot{\mathrm{q}}_{0}, \\ k_{1} = \Delta t \cdot f(\mathrm{q}_{0},\dot{ \mathrm{q}}_{0}), \\ K_{2} = \Delta t \cdot \biggl( \dot{\mathrm{q}}_{0} + \frac{1}{2}k_{1} \biggr), \\ k_{2} = \Delta t \cdot f\biggl(\mathrm{q}_{0} + \frac{1}{2}K_{1}, \dot{\mathrm{q}}_{0} + \frac{1}{2}k_{1}\biggr), \\ \vdots \\ K_{4} = \Delta t \cdot ( \dot{\mathrm{q}}_{0} + k_{3} ), \\ k_{4} = \Delta t \cdot f(\mathrm{q}_{0} + K_{3}, \dot{\mathrm{q}}_{0} + k_{3}), \\ \mathrm{q}_{\mathrm{out}} = \mathrm{q}_{0} + \frac{1}{6}(K_{1} + 2K_{2} + 2K_{3} + K_{4}), \\ \dot{\mathrm{q}}_{\mathrm{out}} = \dot{\mathrm{q}}_{0} + \frac{1}{6}(k_{1} + 2k_{2} + 2k_{3} + k_{4}), \end{gathered}$$
(C.6)

where \(f(\mathrm{q},\dot{\mathrm{q}})\) represents determination of the second derivative of the quaternion \(\mathrm{q}\) (by using Eq. (C.1)). Here it should be emphasized that, after each integration step (C.6), the numerically calculated quaternions must be stabilized by using additional explicit constraint equation:

$$ \mathrm{q} = \frac{1}{\sqrt{1 + \delta}} \mathrm{q}_{\mathrm{out}}, $$
(C.7)

where \(\delta = \mathrm{q}_{\mathrm{out}}^{T}\mathrm{q}_{\mathrm{out}} - 1\) is the quaternion unit-length constraint violation and \(\mathrm{q}_{\mathrm{out}}\) is numerical value obtained after integration step (C.6), and before applying the unit-length correction equation (C.7) that provides the final body attitude for a step. Furthermore, besides the stabilization procedure at the position level, the first formulation also requires stabilization at the velocity level. This algorithm resembles stabilization procedure at the position level, being based on the correction formula for the velocities:

$$ \dot{\mathrm{q}} = \dot{\mathrm{q}}_{\mathrm{out}} - \sigma \mathrm{q}, $$
(C.8)

where \(\sigma = \dot{\mathrm{q}}_{\mathrm{out}}^{T}\mathrm{q}\) is the quaternion constraint violation at the velocity level.

3.2 C.2 Formulation II

Here, see [6, Chap. 11.2], the rotational equations of motion are formulated via body angular velocity \(\boldsymbol{\omega}\) in the form of Euler equations:

$$ \mathbf{J}\dot{\boldsymbol{\omega}} + \tilde{\boldsymbol{\omega}} \mathbf{J}\boldsymbol{\omega} = \mathbf{n}, $$
(C.9)

which leads to the following rotational dynamics integration algorithm in terms of quaternions (description of all variables is the same as above)

$$\begin{gathered} \boldsymbol{\omega}_{0}, \mathrm{q}_{0}, \Delta t, \\ K_{1} = \Delta t \cdot \frac{1}{2} \cdot \mathbf{L}^{T}( \mathrm{q}_{0}) \cdot \boldsymbol{\omega}_{0}, \\ k_{1} = \Delta t \cdot f(\boldsymbol{\omega}_{0}, \mathrm{q}_{0}), \\ K_{2} = \Delta t \cdot \frac{1}{2} \cdot \mathbf{L}^{T} \biggl( \mathrm{q}_{0} + \frac{1}{2}K_{1} \biggr) \cdot \biggl( \boldsymbol{\omega}_{0} + \frac{1}{2}k_{1} \biggr), \\ k_{2} = \Delta t \cdot f\biggl(\boldsymbol{\omega}_{0} + \frac{1}{2}k_{1}, \mathrm{q}_{0} + \frac{1}{2}K_{1} \biggr), \\ \vdots \end{gathered}$$
(C.10)
$$\begin{gathered} K_{4} = \Delta t \cdot \frac{1}{2} \cdot \mathbf{L}^{T}( \mathrm{q}_{0} + K_{3}) \cdot (\boldsymbol{ \omega}_{0} + k_{3}), \\ k_{4} = \Delta t \cdot f(\boldsymbol{\omega}_{0} + k_{3}, \mathrm{q}_{0} + K_{3}), \\ \mathrm{q}_{\mathrm{out}} = \mathrm{q}_{0} + \frac{1}{6}(K_{1} + 2K_{2} + 2K_{3} + K_{4}), \\ \boldsymbol{\omega}_{\mathrm{out}} = \boldsymbol{\omega}_{0} + \frac{1}{6}(k_{1} + 2k_{2} + 2k_{3} + k_{4}). \end{gathered}$$
(C.11)

As was the case within the framework of Formulation I, after the integration step (C.10) the integration result \(\mathrm{q}_{\mathrm{out}}\) must be re-normalized by using (C.7).

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Terze, Z., Müller, A. & Zlatar, D. Singularity-free time integration of rotational quaternions using non-redundant ordinary differential equations. Multibody Syst Dyn 38, 201–225 (2016). https://doi.org/10.1007/s11044-016-9518-7

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11044-016-9518-7

Keywords

Navigation