The system dynamics are represented by a system of nonlinear time invariant equations, in the form of

_{}, 
(4.62) 
where _{ } is the vehicle state vector from (4.12), and _{ } is a nonlinear function of the current state and the commanded moment that calculates the first derivative of each of the elements of _{ }. The change in angular velocity _{ }, _{ }, and _{ } are calculated by solving (4.63) for angular acceleration. First, expand (4.1).

_{}. 
(4.63) 
Then, solve for angular acceleration.

_{} 
(4.64) 
where

_{} 
(4.65) 

_{} 
(4.66) 
and

_{} 
(4.67) 
To find the change in angular velocity, the algorithm first
calculates the angular momentum using (4.66). This is then plugged
into (4.65). This result, along with the result of (4.67) is then
used in (4.64) to find the angular acceleration.
The change in attitude _{ },
_{ },
_{ },
and _{ }
due to the current angular velocity are calculated using (4.9).
The Cartesian position and velocity are not modified in this
simulation. The state is propagated forward through time by numerical
integration of (4.62) using a fourth order RungeKutta algorithm.