Overview: Quaternions and Euler angles were used to model the orientation of a spacecraft as it underwent a rotation sequence.
In the realm of quaternions, a rotation or series of rotations can be described by a simple rotation. In particular, a fixed rotation axis could be used to represent a rigid body's orientation within a frame (Image 1). A spacecraft docking maneuver was modeled by using quaternions and Euler angles.
To model a simple rotation, the scalar components (λ) of the rotation axis (λ) must be computed. This is achieved by first achieved by calculating the Euler parameters as shown in Image 2. By squaring each Euler parameter and taking their summation, the summation should equal one. This verifies whether the Euler parameters were calculated correctly. Next, algebraic techniques were applied to obtain the simple rotation angle (θ) of λ. The Euler parameters and θ were substituted to obtain the scalar components λ; these scalar values were verified. All appropriate values were then substituted into a rotation table expressed in matrix form (Image 3).
MATLAB was used to create a static plot of the system and to animate it. In the former, a series of rotations were first defined. Next, the relevant equations were applied to compute the Euler parameters, scalar components, and θ. These terms were applied in the rotation matrix and were plotted. The latter follows a similar process. Since θ is already calculated, it is only necessary to increment θ_i until it is equal to θ. Doing so updates each cell in the matrix.
Image 4 shows a spacecraft docking maneuver modeled by Euler angles. This involved constructing a rotation table and vector basis for each rotation. The final rotation table was constructed to describe the full rotation of the system.
Modeling spacecraft dynamics using quaternions is more advantageous over Euler angles. As shown by Images 2 - 3, the same series of equations could be applied to any series of rotations. The Euler angle rotations shown in Image 4 assumes a particular set of rotations in a particular order. This would require the final rotation matrix to be rederived for each new series of rotations; this is not required for quaternions. Ultimately, modeling spacecraft dynamics via quaternions is a more efficient than Euler angles.
In the following sections, the spacecraft's orientation was plotted when it rotated by 90° or by an arbitrary amount. The former case was modeled to obtain an intuitive sense of how simple rotations occur. Cases where the spacecraft was rotated about 1-axis, 2-axes, and 3-axes were plotted. Animations were created to visualize the simple rotations.
The first category that was examined was where the spacecraft rotated 90° around a particular Newtonian axis. Considering that Figure 1 matches the final spacecraft orientation when Euler angles angles were implemented, this indicates that the quaternion method is correct. For the corresponding animation, it can be observed that the ax axis remains fixed. Figures 2 - 3 shows rotations about the Newtonian y and z axes, respectively. All cases were exactly the same when Euler angle body rotations were implemented.
Rotations about two axes were then performed. Figure 2 matches the spacecraft's orientation when Euler angles were used. Thus, the quaternion method was applied correctly. Although there 36 combinations for a two-axial rotation, none of these would result in the same orientation for a one-axial rotation.
The third category involved the spacecraft undergoing three 90° rotations. In this instance, Figure 1 does not match the orientation when Euler angles were used. This is because the spacecraft undergone Euler rotations about ax, az, and ay'' for the Euler angle case; the final rotation matrix is dependent on rotation sequence. Considering all three axes are rotated, it is possible for the spacecraft to be in the same orientation if only one or two rotations occurred.
With intuition obtained on how simple rotations work, the rotations were randomized about two axes.
The last case modeled was where three random rotations took place.
The spacecraft's orientation was primarily modeled by quaternions. Considering that there are 216 rotations if three axes are rotated, and that rotation tables would need to be reconstructed each time when using Euler angles, quaternions are more advantageous when modeling spacecraft dynamics. This is because the quaternion rotation matrix could be reused for each new case.
[1] P. Mitiguy, Advanced Dynamics and Motion Simulation, 2024, p. 44.