RHSCubeSat:

Path: CubeSat/Simulation

% Right-hand-side for a CubeSat orbit and attitude dynamical model.
 Includes drag and optical surface disturbances, magnetic dipole,
 gravity gradient, rigid body dynamics and power. Uses the J70
 atmosphere model and applies a point-mass gravity model. Computes sun
 location with SunV1 and accounts for eclipses from the Earth. The
 surface parameters in surfData are passed to both the optical and
 aerodynamic disturbance model functions.

 The states are [position;velocity;quaternion;angular velocity; battery charge].
 The battery charge must always be the last state. Its units are J. If there
 are wheel states they must be between the spacecraft angular velocity and the
 battery charge, and the indices be logged in kWheels.

 Can output the disturbance forces and torques for post-processing.
 There is also a call to retrieve the default data structure.
--------------------------------------------------------------------------
   Form:
   [xDot,dist,power] = RHSCubeSat( x, t, d )
   d = RHSCubeSat
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   x        (14,1)    [r;v;q;w;wRWA;b]
   t         (1,1)    Time, sec
   d          (.)     Data structure
                      .jD0      (1,1) Julian date of epoch
                      .mass     (1,1) Spacecraft mass (kg)
                      .inertia  (3,3) Inertia matrix (kg-m2)
                      .dipole   (3,1) Residual dipole (ATM^2)
                      .power     (.)  Power data, see SolarCellPower 
                      .aeroModel    * Handle, see CubeSatAero
                      .opticalModel * Handle, see CubeSatRadiationPressure
                      .surfData  (.)  optional; empty to skip drag/optical calcs
                                      .cD    (3,1) Drag coefficient
                                      .cM    (3,1) Center of mass (m)
                                      .area  (1,n) Area (m2)
                                      .nFace (3,n) Face normals
                                      .rFace (3,n) Face locations (m)
                                      .att    (.)  Attitude model
                                      .sigma (3,n) Optical coefficients
                                      .planet (1)  Planet effects flag
                      .atm       (.) optional; empty to skip J70 and use AtmDens2
                      .kWheels         (n), empty if no wheels, indices of wRWA
                      .inertiaRWA     (1,1), optional, polar inertia (kg-m2)
                      .tRWA           (3,1), optional, wheel torque (Nm)

   -------
   Outputs
   -------
   x           (14,1)	   d[r;v;q;w;b]/dt
   dist         (.)       Disturbances data
    .fTotal  	   (3,1)   Total force, ECI frame  (N)
    .tTotal       (3,1)   Total torque, body frame (Nm)
    .fAerodyn	   (3,1)   Aerodynamic force
    .tAerodyn     (3,1)   Aerodynamic torque
    .fOptical	   (3,1)   Optical force
    .tOptical     (3,1)   Optical torque
    .tMag         (3,1)   Magnetic torque
    .tGG          (3,1)   Gravity gradient torque
   power       (1,1)      Power from solar cells (W)
 
--------------------------------------------------------------------------
 See also SolarCellPower, CubeSatAero, CubeSatRadiationPressure,
 SolarFluxPrediction, CubeSatEnvironment, CubeSatSimulation,
 CubeSatRWASimulation
--------------------------------------------------------------------------

Children:

AC: ACData/ACTConstants
AerospaceUtils: AtmosphericCalculations/AtmDens2
AerospaceUtils: AtmosphericCalculations/AtmJ70
AerospaceUtils: AtmosphericCalculations/BaromExp
AerospaceUtils: AtmosphericCalculations/DiffusionExp
AerospaceUtils: Coord/ECIToEF
AerospaceUtils: Coord/QIToBDot
AerospaceUtils: Coord/QLVLH
AerospaceUtils: Coord/R2LatLon
CubeSat: Power/SolarCellPower
CubeSat: Simulation/CubeSatAero
CubeSat: Simulation/CubeSatEnvironment
CubeSat: Simulation/CubeSatRadiationPressure
CubeSat: Utilities/CubeSatAttitude
CubeSat: Utilities/CubeSatFaces
CubeSat: Utilities/CubeSatModel
CubeSat: Visualization/DrawCubeSat
CubeSat: Visualization/GroundTrack
Orbit: OrbitCoord/ConvertNORAD
Orbit: OrbitCoord/SLR
Orbit: OrbitMechanics/NORAD
Orbit: OrbitMechanics/NORADToEl
Orbit: OrbitMechanics/PropagateTLE
Orbit: OrbitMechanics/RVOrbGen
Orbit: Visualization/OrbTrack
SC: BasicOrbit/CP2I
SC: BasicOrbit/E2M
SC: BasicOrbit/E2Nu
SC: BasicOrbit/El2RV
SC: BasicOrbit/M2E
SC: BasicOrbit/M2EApp
SC: BasicOrbit/M2EEl
SC: BasicOrbit/M2EHy
SC: BasicOrbit/M2Nu
SC: BasicOrbit/M2NuPb
SC: BasicOrbit/Nu2E
SC: BasicOrbit/Nu2M
SC: BasicOrbit/Period
SC: BasicOrbit/RV2El
SC: BasicOrbit/RVFromKepler
SC: Disturbances/GravityGradientFromR
SC: Disturbances/SolarF
SC: Environs/BDipole
SC: Environs/SolarFluxPrediction
SC: Ephem/ECIToPlanet
SC: Ephem/EOfE
SC: Ephem/EarthNut
SC: Ephem/EarthPre
SC: Ephem/EarthRot
SC: Ephem/EarthRte
SC: Ephem/Eclipse
SC: Ephem/GMSTime
SC: Ephem/MSidDay
SC: Ephem/MoonRot
SC: Ephem/Moons
SC: Ephem/NutDelta
SC: Ephem/ObOfE
SC: Ephem/SunV1
SC: Ephem/TruEarth
SC: SCData/sCTConstants
SC: SCMat/EarthMR
SC: SCMat/SolarFluxPredictions
SC: Visualization/PlotPlanet
SCPro: MannedVehicle/ISSOrbit
Common: CommonData/Constants
Common: CommonData/SwooshWatermark
Common: CommonData/xSplashSmall
Common: ComponentModels/Box
Common: Control/C2DZOH
Common: Database/Constant
Common: FileUtils/FindDirectory
Common: General/CellToMat
Common: General/DeBlankLT
Common: General/DeleteCell
Common: General/DispWithTitle
Common: General/MatToCell
Common: General/Watermark
Common: Graphics/AddFillToPlots
Common: Graphics/Axis3D
Common: Graphics/DrawVertices
Common: Graphics/Ellipsd
Common: Graphics/Map
Common: Graphics/Mesh2
Common: Graphics/NPlot
Common: Graphics/NewFig
Common: Graphics/Plot2D
Common: Graphics/Plot3D
Common: Graphics/PltStyle
Common: Graphics/TimeLabl
Common: Graphics/TitleS
Common: Graphics/XLabelS
Common: Graphics/YLabelS
Common: Graphics/ZLabelS
Common: MassProperties/AddMass
Common: MassProperties/IC623X3
Common: MassProperties/Inertias
Common: Quaternion/Mat2Q
Common: Quaternion/QForm
Common: Quaternion/QMult
Common: Quaternion/QTForm
Common: Time/DTAToDTS
Common: Time/DTSToDTA
Common: Time/Date2DN
Common: Time/Date2JD
Common: Time/JD2000
Common: Time/JD2Array
Common: Time/JD2DN
Common: Time/JD2Date
Common: Time/JD2T
Common: Time/JDToMidnight
Common: Time/T2JD
Math: Linear/Cross
Math: Linear/Dot
Math: Linear/DupVect
Math: Linear/Mag
Math: Linear/Skew
Math: Linear/SkewSq
Math: Linear/SkewSymm
Math: Linear/Unit
Math: MathUtils/R2P5
Math: Trigonometry/ACosD
Math: Trigonometry/CosD
Math: Trigonometry/SinD

Back to the CubeSat Module page