RHSRigidBodyMass:

Path: SCPro/DynamicalModels

% Spacecraft attitude and orbit dynamics with time-varying mass.
   This is a rigid body with an external force and torque input.
   The position is in km. The gravity model is for a point mass.
   The force and torque area constant across the integration time step.
   The body has time varying mass but not inertia.

   In this function d.mass is the dry mass. The fuel mass is in the state
   vector x. If m is less than zero mDot is set to zero.

   The function fDist (which should be a handle) is of the form

         [force, torque] = MyFun( x, t, d )

   You can add additional fields to d. force must be in N in the body 
   frame and torque in Nm in the body frame. This function allows you
   to add forces and torques within the integration loop. This is
   required for forces and torques that are functions of time or the
   state vector.

   Since version 2014.1
--------------------------------------------------------------------------
   Form:
   [xDot, force, torque] = RHSRigidBodyMass( x, t, d )
--------------------------------------------------------------------------

   -------
   Inputs
   -------
   x       (14,1)	State vector [r;v;q;w;m] (km,km/s,,rad/s,kg)
   t       (1,1)	  Time (unused) (s)
   d       (1,1)	  Data structure for the simulation
                   .torque     (3,1) External torque (Nm)
                   .force      (3,1) External force (N)
                   .inertia    (3,3) Vehicle inertia (kg-m^2)
                   .mass       (1,1) Vehicle dry mass (kg)
                   .mu         (1,1) Gravitational parameter (km^3/s^2)
                   .fDist      (1,:) Disturbance function handle
                   .fDistData  (1,1) Data structure for the disturbance
                                     function
                   .mDot       (1,1) Mass rate (kg/s)

   -------
   Outputs
   -------
   xDot    (14,1)    d[r;v;q;w;m]/ (km/s,km/s^2,,rad/s^2,kg/s)
   force   (3,1)     Disturbance force (N)
   torque	(3,1)     Disturbance torque (Nm)

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

Children:

AerospaceUtils: Coord/QIToBDot
Common: Quaternion/QTForm
Math: Linear/Mag
Math: Linear/Skew

Back to the SCPro Module page