EarthOrbitSimulation:

Path: SC/Tools

% Coupled attitude and orbit simulation
 Demonstrates control design using PID3Axis, the Disturbances function,
 rigid body attitude dynamics with FRB, orbit dynamics with FOrbCart, and
 integration using RK4. 

 Initial conditions are obtained from the CAD model. Alternate orbital
 elements can be specified. 

 Use this function as a template for your own ACS function or script based
 on the pointing needs of your mission. 
-------------------------------------------------------------------------------
   Form:
   data = EarthOrbitSimulation( g, elements, jD0, nOrbits, dACS )
-------------------------------------------------------------------------------

   ------
   Inputs
   ------
   g           (.)     CAD model with initial states
                       .rECI  (3,1)
                       .vECI  (3,1)
                       .q     (4,1)
                       .omega (3,1)
   elements   (1,6)    Orbital elements [a i W w e M], or empty
   jD0        (1,1)    Initial epoch date
   nOrbits    (1,1)    How many orbits
   dACS        (.)     ACS structure with target and control data (PID3Axis)

   -------
   Outputs
   -------
   data        (.)     Output data
                       .time (1,:)
                       .r    (3,:)
                       .v    (3,:)
                       .q    (4,:)
                       .w    (3,:)
                       .torque (3,:) Control torque
                       .force  (3,:) Applied force (currently 0)
                       .tqDist (3,:) Disturbance torque
                       .fDist  (3,:) Disturbance force

-------------------------------------------------------------------------------