The quaternion approach using a four parameter vector with a unity magnitude constraint allows three degrees of freedom. Due to the unity magnitude constraint, quaternions are elements of a unit sphere in four space. This unit sphere is not a Euclidean vector space in which the usual definitions of vector addition and scaling apply; therefore, care must be taken in the integration of the quaternion differential equation. Since the equations are linear, if the sampling rate is high enough that it is accurate to consider the rotation rate as constant over the sample interval T, then it is possible to find and implement a closed form solution to eqn. (D.30). Such a solution is presented below.
To simplify notation, letso that eqn. (D.30) can be written as
Our objective is to findwhenis known and Q(t) is constant for Given these assumptions, forwe have that
and we define the integrating factor
Multiplying the integrating factor into eqn. (D.32) from the left and simplifying proceeds as follows:
Integrating both sides over the interval yields
where it has been recognized that
To write the solution of eqn. (D.34) in a more convenient form, we defineand
where
With these definitions, eqn. (D.34) is equivalent to
Fortunately, the state transition matrix .allows further simplification. First, it is easily verified by direct multiplication that
Therefore, because the above derivation can be repeated over any interval of duration T for which the assumption of a constant angular rate is valid, we have the general equation
where‘ involve the integral of the angular rates over the fc-th sampling interval
Note that no approximations were made in this derivation, so the solution is in closed form given the assumption thatis constant over the interval of length T. The solution is easily verified to be norm preserving by showing that the norm of the right side of eqn. (D.36) is equal to.
The algorithm is not an exact solution to the differential equation over any interval where the angular rates are not constant. In [73] the algorithm of eqn. (D.36) is shown to be second order and a third order algorithm is also presented. The algorithm being second order means the algorithm error contains terms proportional to T3 and higher powers. Because T is small, higher order algorithms have smaller errors; however, the tradeoff is that they require additional computation.