Path: SCPro/DynamicalModels
% Computes the constraint forces and torques.
   It computes the separation forces and torques needed to keep
   the relative velocity between the first vehicle and the rest zero.
   Type ConstraintForceAndTorque for a simulation of two attached
   spacecraft.
   The 2nd spacecraft should rotate around the first one.
   Note that for all arrays body 0 is the first column or element except
   for lambda and kappa where the columns correspond to the hinge vectors.
   hinge 1 is between body 0 and body 1, hinge 2 is between body 0 and
   body 2, etc.
--------------------------------------------------------------------------
   Form:
   varargout = ConstraintForceAndTorque( action, varargin )
--------------------------------------------------------------------------
   ------
   Inputs
   ------
   action           (1,:)    'initialize' or 'update'
   'initialize'
   xA               (13,1)   Aggregate vehicle state
   e                ( 3,:)   Positions of individual body cms in 0
   d                (1, 1)   Data structure
   'update'
   x                (13*n,1) Vehicle state
   d                (1,1)    Data structure
                             .t      (3,n)   Disturbance torques in body k frame
                             .f      (3,n)   Disturbance forces in ECI frame (kN)
                             .inr    {n}     Inertia matrix in body k frame
                             .m      (n)     Mass (kg)
                             .mu     (1,1)   Gravitational parameter
                             .lambda (:,n-1) Vectors from hinge to cm in k frame
                             .kappa  (:,n-1) Vectors from body 0 cm to hinges
                             .b      {n }    Transformation matrix from k to 1
                             .e0     (3,1)   Location of body 0 cm 
   -------
   Outputs
   -------
   'initialize'
   x                (13*n,1) State vector
   'update'
   fC               (3,n)    Constraint forces in ECI frame
   tC               (3,n)    Constraint torques in ECI frame
--------------------------------------------------------------------------
AC: ACData/ACTConstants AerospaceUtils: Coord/QIToBDot SC: BasicOrbit/Period SC: SCData/sCTConstants SCPro: DynamicalModels/RHSNSpacecraft Common: CommonData/Constants Common: CommonData/SwooshWatermark Common: CommonData/xSplashSmall Common: Control/C2DZOH Common: Database/Constant Common: General/CellToMat Common: General/DeleteCell Common: General/MatToCell Common: General/Watermark Common: Graphics/NewFig Common: Graphics/Plot2D Common: Graphics/PltStyle Common: Graphics/TimeLabl Common: Quaternion/Mat2Q Common: Quaternion/Q2Mat Common: Quaternion/QForm Common: Quaternion/QTForm Math: Integration/RK4 Math: Linear/Cross Math: Linear/DupVect Math: Linear/Mag Math: Linear/Skew Math: Linear/SkewSq Math: Linear/SkewSymm
Back to the SCPro Module page