|
This article is the consolidated self study problem bank for the PhysicsLibrary quaternion series.
The problems are arranged roughly from foundational algebra through engineering attitude propagation. All forty exercises are stated before any solutions so that the article can be used as a genuine problem set.
Unless a problem explicitly states otherwise, use the PhysicsLibrary passive frame convention:
 |
(1) |
 |
(2) |
and Hamilton multiplication
Quaternion components are displayed scalar first.
- Convention identification.
A software library stores quaternion arrays as
and documents
Identify the storage order and multiplication convention. Does the storage order determine whether the quaternion is active or passive?
- Hamilton basis products.
Evaluate
- General quaternion product.
Let
and
Compute and .
- Conjugate and product reversal.
For arbitrary quaternions and , prove
Then verify the identity numerically using the quaternions in Exercise 3.
- norm and inverse.
For
compute
, , and .
Verify directly that
- Normalization.
Normalize
State whether normalization changes the physical rotation axis represented by the vector part.
- Double representation.
Show algebraically that for a unit quaternion,
Explain the geometric meaning.
- Pure quaternion square.
Let
Prove
- Positive
frame rotation about .
Construct for a positive frame rotation about
.
- Arbitrary axis construction.
Construct the passive quaternion for a positive frame rotation about
- Passive coordinate transformation.
Using the quaternion from Exercise 9, transform the fixed physical vector
into coordinates.
- Passive Rodrigues formula.
Starting from
derive
 |
(3) |
- Extract axis and angle.
Given
recover the positive physical frame rotation axis and angle.
- Small frame rotation.
For
form the first order passive small rotation quaternion.
- Active versus passive diagnostic.
A positive geometric rotation about is represented by the active rotor
Write the passive frame quaternion for the same geometry and state the relationship between the two.
- Finite frame chain.
Suppose
and
Compute .
- Noncommuting order.
Using
compute and . Explain why the results differ.
- Quaternion to DCM.
Convert
to a direction cosine matrix.
- DCM to quaternion.
Recover a passive unit quaternion from
- DCM column interpretation.
For the matrix in Exercise 19, interpret each of the three columns geometrically.
- Transpose and conjugate.
Prove
Interpret this result as a reversal of frame map direction.
- Quaternion and DCM composition.
Show that under the PhysicsLibrary convention
Use Exercise 16 as a numerical check.
- Pure yaw Euler conversion.
For intrinsic - - yaw, pitch, roll with
compute the passive quaternion.
- General
- - quaternion.
For
compute
to at least six decimal places.
- Recover Euler Angles.
Given a passive quaternion with corresponding DCM entries
recover the principal intrinsic - - roll, pitch, and yaw angles.
- Gimbal lock.
Explain why the intrinsic - - representation becomes singular at
What remains well defined?
- Derivative at the identity.
For
and constant body resolved angular velocity
compute .
- Body resolved component equations.
Starting from
derive the four scalar component equations.
- Norm preservation.
Prove that the exact continuous quaternion kinematic equation preserves
- Exact constant rate propagation.
Let
Find the exact quaternion at
- Recover angular velocity.
Starting from
derive in terms of and .
- Body versus reference resolved rate.
Prove that
when
- Forward Euler norm drift.
With
compute one forward Euler step and its norm.
- DCM kinematics.
Derive
- Left and right errors.
Given actual attitude and desired attitude , derive
and
Show how each reconstructs .
- Same axis attitude error.
The actual attitude is positive passive yaw and the desired attitude is positive passive yaw .
Compute the relative quaternion and recover the physical frame error.
- Small passive attitude error.
An error quaternion is locally
Recover the first order physical frame error vector.
- Transport right error to left error.
Show that
Then derive the first order vector relation
- Principal sign choice.
An error calculation returns
Select the principal representative and recover the physical frame error.
- Bias corrected IMU update.
A body gyroscope reports
with bias estimate
For
compute the corrected rate, delta angle, exact passive increment, and .
- Body increment multiplication side.
Use frame labels to prove that a body resolved IMU increment satisfies
for
.
- Two small increments and coning.
Two successive body increments are
and
Show to second order that the equivalent physical rotation vector is
- Quaternion sign continuity.
Suppose two successive numerical states satisfy
What operation should be performed if a continuous quaternion time history is desired? Does the operation change physical attitude?
- Specific force transformation.
The attitude state is
An accelerometer measures
. Derive the DCM and quaternion expressions for
.
- Capstone convention audit.
A legacy routine propagates a quaternion using
and labels the state .
Identify both convention inconsistencies relative to PhysicsLibrary and write the corrected update.
The array
is scalar last storage.
The rule
identifies Hamilton multiplication.
Storage order does not determine active versus passive interpretation. That must be defined separately by the frame map and vector transformation law.
Using the Hamilton multiplication table,
Also,
Finally,
Using scalar vector form or direct expansion,
The scalar part of is
The vector part is
The cross product is
Hence
For , the cross product reverses sign:
Write
Conjugation changes the sign of every vector part. Since Hamilton multiplication contains
, conjugation changes the cross term sign. Reversing factor order also changes the cross term sign because
Therefore
For Exercise 3,
so
Direct multiplication of gives the same result.
For
the norm is
The conjugate is
Therefore
Since
we have
The norm is
Therefore
Normalization rescales all four components by the same positive scalar. It does not change the direction of the vector part, although it does change the half angle implied by a nonunit quaternion if one had incorrectly attempted to interpret the original unnormalized components as a unit rotation.
Because
we have
Thus and represent the same physical orientation. Unit quaternions double cover the rotation group.
Expand
The diagonal terms give
Every mixed pair cancels because, for example,
Therefore
The passive axis angle formula gives
Hence
The half angle is , so
Thus
Therefore
From Exercise 9,
The corresponding passive DCM is
Therefore
The fixed physical vector has coordinates along
.
Let
Expand
Using pure quaternion multiplication and collecting vector terms gives
Use
and
Then
The scalar component is
Therefore
The vector part is
Its norm is
For a passive quaternion, the physical frame axis is opposite the normalized vector part:
The passive first order small frame quaternion is
Hence
The passive frame quaternion for the same positive geometric frame rotation is the conjugate of the active rotor:
Thus
The chain is
Therefore
Since
we obtain
First,
Second,
They differ because
Finite rotations about different axes do not commute.
For
we have
Substitution into the passive quaternion DCM formula gives
The trace is
Hence
Then
The other vector components are zero.
Thus
The negative quaternion is equally valid.
For
the first column is
so the frame basis direction has coordinates
.
The second column is
so the frame basis direction has coordinates
.
The third column is
so the axes coincide.
The conjugate is the inverse unit quaternion:
The DCM of the inverse transformation is the inverse matrix:
A proper DCM is orthogonal, so
Therefore
Quaternion conjugation reverses the passive frame map direction.
For any vector,
is represented by the quaternion sandwich
Since
we have
Thus the transformation associated with is applied first and the transformation associated with second. Therefore
For Exercise 16,
which gives the same direct
frame map.
For a pure yaw,
For
Using
the passive scalar first components are approximately
For passive intrinsic - - ,
Thus
Next,
Finally,
Therefore
For intrinsic - - ,
At
we have
The matrix entries used to recover roll and yaw lose independent information. The first and third Euler axes become aligned.
The physical attitude remains perfectly well defined. Only the selected Euler coordinate chart becomes singular.
A quaternion representation remains nonsingular.
The passive body resolved kinematic equation is
At
we obtain
Let
and
Expanding
gives
Differentiate
From
we have
because is pure.
Therefore
Hence unit norm is preserved exactly in continuous time.
The rate magnitude is
The unit axis is
At s,
Therefore
Numerically,
Start with
Right multiply by :
Thus
Given
we have
Therefore
The two equations describe the same physical angular velocity resolved in different frames.
At the identity,
For
s,
The norm is
The result is not exactly unit because the Euler step follows a tangent line rather than the unit quaternion three sphere.
For a physical vector fixed in inertial space,
A rotating frame observes
Thus
Since
is arbitrary,
For a left error,
Right multiply by :
For a right error,
Left multiply by :
Thus
The actual attitude is
The desired attitude is
Therefore
This represents a positive frame yaw error of
about
.
Because the rotations share the same axis, the left and right errors coincide.
For the passive small error convention,
Therefore
Starting from
multiply by on the left and on the right:
For small passive errors,
Then
Since the quaternion sandwich transforms vector coordinates,
The scalar component is negative, so multiply the whole quaternion by :
The scalar is approximately
so the full angle is
The passive vector part is along
, so the physical positive frame axis is
.
Thus the principal physical error is positive about .
The corrected rate is
The delta angle is
The exact passive increment is
Numerically,
Since ,
At sample ,
maps
The measured body increment is
which maps
The frame chain is therefore
Thus
or
For small passive increments,
and
Chronological body increments compose as
Expanding through second order,
The vector part of the last product is
Matching
gives
If
replace
The new quaternion represents exactly the same physical attitude because and are equivalent.
The operation merely chooses the representative nearest the previous sample.
The attitude quaternion
maps inertial coordinates into body coordinates.
Therefore the inverse DCM maps body specific force back into inertial coordinates:
The equivalent quaternion expression is
The legacy routine uses
Relative to the PhysicsLibrary state , two inconsistencies are present.
First, a positive body frame increment must have a negative quaternion vector sign:
Second, a body resolved increment must left multiply the passive inertial to body state.
Therefore the corrected update is
The problem set may be used in four passes:
- Exercises 1–8 for algebra and convention fluency;
- Exercises 9–26 for finite attitude representation and conversion;
- Exercises 27–39 for dynamics, estimation, and attitude error;
- Exercises 40–45 for sampled IMU propagation and implementation auditing.
A student who can solve the final convention audit without relying on a memorized active quaternion formula has internalized the central PhysicsLibrary convention.
The exercises and worked solutions in this article are newly written or rewritten for the PhysicsLibrary passive quaternion series.
Hamilton provides the foundational algebra. Sommer and coauthors provide a modern analysis of quaternion convention management. Henderson provides an engineering reference for quaternion, matrix, and Euler conversion. Markley and Crassidis provide spacecraft attitude and error quaternion context. Solà and Savage provide useful treatments of quaternion kinematics, error states, and IMU propagation.
- 1
- W. R. Hamilton, Elements of Quaternions, 2nd ed., edited by C. J. Joly, Longmans, Green, and Co., 1899. Public domain historical source. Internet Archive scan https://archive.org/details/elementsofquater01hamiuoft
- 2
- H. Sommer, I. Gilitschenski, M. Bloesch, S. Weiss, R. Siegwart, and J. Nieto, “Why and How to Avoid the Flipped Quaternion Multiplication,” Aerospace, vol. 5, no. 3, article 72, 2018. Published under CC BY 4.0. Publisher article https://www.mdpi.com/2226-4310/5/3/72
- 3
- D. M. Henderson, Euler Angles, Quaternions, and Transformation Matrices: Working Relationships, JSC-12960, NASA Johnson Space Center, 1977. NASA Technical Reports Server search https://ntrs.nasa.gov/search?q=JSC-12960
- 4
- F. L. Markley and J. L. Crassidis, Fundamentals of Spacecraft Attitude Determination and Control, Springer, 2014. Publisher book page https://link.springer.com/book/10.1007/978-1-4939-0802-8
- 5
- J. Solà, “Quaternion Kinematics for the Error State Kalman Filter,” arXiv:1711.02508, 2017. arXiv preprint https://arxiv.org/abs/1711.02508
- 6
- P. G. Savage, “Strapdown Inertial Navigation Integration Algorithm Design Part 1: Attitude Algorithms,” Journal of Guidance, Control, and Dynamics, vol. 21, no. 1, pp. 19–28, 1998. DOI record https://doi.org/10.2514/2.4228
Unless otherwise noted, this PhysicsLibrary entry is intended for release under the Creative Commons Attribution ShareAlike 4.0 International license.
|