RHSGGRotational:

Path: SC/Dynamics

% Right-hand-side for spacecraft attitude dynamics with gravity gradient.
 Includes hysteresis states.
--------------------------------------------------------------------------
   Form:
   [xDot, tDamp] = RHSGGRotational( x, t, d )
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   x 	(7+n,1)	[q;omega;z] z are hysteresis damper states
   t   (1,1)   Time (s)
   d   (.)     Data structure
               .inertia	(3,3) Inertia matrix (kg-m^2)
               .torque   (3,1) Torque in the body frame (Nm)
               .r        (3,1) Position vector (km)
               .mu       (1,1) Gravitational constant (km^3/s^2)

   -------
   Outputs
   -------
   x     (7+n,1)	d[q;omega]/dt
   tDamp (3,1)   Damping torque (Nm)
 
--------------------------------------------------------------------------