Implement quaternion representation of six-degrees-of-freedom equations of motion with respect to body axes

**Library:**Aerospace Blockset / Equations of Motion / 6DOF

The 6DOF (Quaternion) block implements quaternion representation of six-degrees-of-freedom equations of motion with respect to body axes. For a description of the coordinate system and the translational dynamics, see the block description for the 6DOF (Euler Angles) block.

For more information on the integration of the rate of change of the quaternion vector, see Algorithms.

The block assumes that the applied forces act at the center of gravity of the body, and that the mass and inertia are constant.

The integration of the rate of change of the quaternion vector is given below. The
gain *K* drives the norm of the quaternion state vector to 1.0 should $$\epsilon $$become nonzero. You must choose the value of this gain with care,
because a large value improves the decay rate of the error in the norm, but also slows
the simulation because fast dynamics are introduced. An error in the magnitude in one
element of the quaternion vector is spread equally among all the elements, potentially
increasing the error in the state vector.

$$\begin{array}{l}\left[\begin{array}{c}{\dot{q}}_{0}\\ {\dot{q}}_{1}\\ {\dot{q}}_{2}\\ {\dot{q}}_{3}\end{array}\right]=\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$2$}\right.\left[\begin{array}{cccc}0& -p& -q& -r\\ p& 0& r& -q\\ q& -r& 0& p\\ r& q& -p& 0\end{array}\right]\left[\begin{array}{c}{q}_{0}\\ {q}_{1}\\ {q}_{2}\\ {q}_{3}\end{array}\right]+K\epsilon \left[\begin{array}{c}{q}_{0}\\ {q}_{1}\\ {q}_{2}\\ {q}_{3}\end{array}\right]\\ \epsilon =1-\left({q}_{0}^{2}+{q}_{1}^{2}+{q}_{2}^{2}+{q}_{3}^{2}\right)\end{array}$$

Aerospace Blockset™ uses quaternions that are defined using the scalar-first convention.

6DOF (Euler Angles) | 6DOF ECEF (Quaternion) | 6DOF Wind (Quaternion) | 6DOF Wind (Wind Angles) | Custom Variable Mass 6DOF (Euler Angles) | Custom Variable Mass 6DOF (Quaternion) | Custom Variable Mass 6DOF ECEF (Quaternion) | Custom Variable Mass 6DOF Wind (Quaternion) | Custom Variable Mass 6DOF Wind (Wind Angles) | Simple Variable Mass 6DOF (Euler Angles) | Simple Variable Mass 6DOF (Quaternion) | Simple Variable Mass 6DOF ECEF (Quaternion) | Simple Variable Mass 6DOF Wind (Quaternion) | Simple Variable Mass 6DOF Wind (Wind Angles)