MagTorquer:

Path: SC/MagneticControl

% Models a magnetic torquer. 
--------------------------------------------------------------------------
   Form:
   output = MagTorquer( action, input )
--------------------------------------------------------------------------

   ---------
   Arguments
   ---------
   action         (1,:)    Action, 'initialize' or 'getTorque'

   action is 'getTorque'
   input          (.)    Data structure - each field is described below; the following sets of
                          fields are allowed:
                          {.bField},
                          {.position, {.date OR .julianDate}, {.qECIToBody OR .mECIToBody} }
                          {.position, {.date OR .julianDate}, .model, {.qECIToBody OR .mECIToBody}}
                          {.position, {.date OR .julianDate}, .model, .modelInputs, {.qECIToBody OR .mECIToBody}}
                          {.model, .modelInputs, {.qECIToBody OR .mECIToBody}}
                          In addition, the fields .dipoleSign and/or {.current OR .curFunInputs} may be included
                          for the input with any of the above combinations.

                           .bField         (3,n)    Earth's magnetic field in the spacecraft body
                                                     frame. If this field exists, then all others 
                                                     are ignored. (T)
                           .position       (3,n)    Position in ECI (km)
                           .date   (n,6) or structure  Date Time Array or Structure (see DTSToDTA for formats)
                           .julianDate     (1,n)    Julian date
                           .qECIToBody     (4,n)    Quaternion from ECI to spacecraft body frame
                           .mECIToBody    (3,3,n)   Transformation matrix from ECI to spacecraft body frame
                           .model         string    Name of the function that will compute the
                                                     magnetic field. SCT functions that can be
                                                     used are: 'BDipole', 'BMF', 'MagField' 
                                                     (function names are case sensative). User
                                                     supplied models may also be specified.
                           .modelInputs    {:}      Cell array containing any additional inputs
                                                     needed for MagField or BMF, or all inputs for a
                                                     custom model
                           .dipoleSign     (m,1)    Sign of the dipole for each torquer initialized 
                                                     Can also be a non-unity constant to indicate
                                                     a change in the magnitude of the dipole from
                                                     value set at initialization
                           .current        (m,1)    Current for each toruqer (A)
                           .curFunInputs   {:}      Inputs for the current calculation function


   output        (3,n,m)   Magnetic torque in spacecraft body frame. n is the number of 
                            position vectors entered, m is the number of torquers that have
                            been initialized. If n=1 but m>1, the output will be sqeezed to
                            remove the middle dimension. Units depend on the units of the 
                            dipoles entered. 

   action is 'initialize'
   input         (1,1)    Data structure - each field is described below; the following sets of
                          fields are allowed:
                          {.dipole},
                          {.n, .area, .nTurns }
                          {.n, .area, .nTurns, .mu }
                          {.n, .area, .nTurns, {.current OR .currentFunction} }
                          {.n, .area, .nTurns, {.current OR .currentFunction}, .mu }

                           .dipole          (3,m)   Dipole moment for each torquer (Atm^2)
                           .n               (3,m)   Unit vector in the direction of the 
                                                     dipole when positive current is applied
                           .area            (1,m)   Coil area for each torquer (m^2)
                           .nTurns          (1,m)   Number of turns for each torquer
                           .mu              (1,m)   Core permeability for each torquer 
                                                     (default=1, is vaccuum) (dimensionless)
                           .current         (1,m)   Current for each torquer (A)
                           .currentFunction string  Name of a function to be called to 
                                                     calculate the current

   output        (1)      Number of dipoles initialized 
--------------------------------------------------------------------------

Children:

AC: ACData/ACTConstants
AerospaceUtils: Coord/ECIToEF
SC: BasicOrbit/Period
SC: BasicOrbit/RVFromKepler
SC: Environs/BDipole
SC: Environs/BMF
SC: Environs/MagField
SC: Environs/MagFieldData
SC: Environs/MagFieldPlanet
SC: Environs/ReadMagField
SC: Ephem/EarthRte
SC: Ephem/MSidDay
SC: Ephem/SunV1
SC: SCData/sCTConstants
SC: SCMat/IGRF11
Common: CommonData/Constants
Common: CommonData/SwooshWatermark
Common: CommonData/xSplashSmall
Common: Database/Constant
Common: General/CellToMat
Common: General/DeBlankLT
Common: General/DeleteCell
Common: General/ListCases
Common: General/MatToCell
Common: General/Watermark
Common: Graphics/NewFig
Common: Graphics/Plot2D
Common: Graphics/Plot3D
Common: Graphics/PltStyle
Common: Graphics/TimeLabl
Common: Graphics/XLabelS
Common: Graphics/YLabelS
Common: Graphics/ZLabelS
Common: Quaternion/QForm
Common: Time/DTSToDTA
Common: Time/Date2JD
Common: Time/JD2000
Common: Time/JD2T
Common: Time/T2JD
Common: Transform/Cart2Sph
Math: Analysis/PGauss
Math: Analysis/SCHarm
Math: Linear/Cross
Math: Linear/DupVect
Math: Linear/Mag
Math: Linear/Skew
Math: Linear/Unit
Math: MathUtils/R2P5
Math: Trigonometry/CosD
Math: Trigonometry/SinD

Back to the SC Module page