MagField:

Path: SC/Environs

% Computes the Earth magnetic field using the DGRF/IGRF model.
 This model only is valid for the Earth. Use MagFieldPlanet
 for all other planets. The model is loaded from IGRF11.mat if no
 dataFile or coefficients are given.
------------------------------------------------------------------------
   Form:
   [b, g, h] = MagField( position, jD, nMax, dataFile) 
   b         = MagField( position, jD, nMax, g, h )
------------------------------------------------------------------------

   ------
   Inputs
   ------
   position    (3,:)  Position in ECI (km)
   jD          (1,1) Julian date
   nMax        (1,1) Maximum number of terms used. Enter an empty matrix
                       to use all available terms
   dataFile    (1,:) Optional, The file name of a .mat file 
                       which contains the magnetic field data. 
                       The variables which must be stored in 
                       dataFile are: dateOfModel, g, gDot, h,
                       and hDot. This may also be the name of
                       a structure with fields .h, .g, .gDot, .hDot
                       and .dateOfModel
      - or - 
   g                  Optional, but speeds execution
   h                  Optional, but speeds execution  

   -------
   Outputs
   -------
   b           (3,:)  The magnetic field in ECI (T)
   g                  The (full) g coefficient matrix for dateTime
   h                  The (full) h coefficient matrix for dateTime

--------------------------------------------------------------------------
   References: Wertz, J., Spacecraft Attitude Determination and Control,
               Kluwer, 1976, pp. 779-781. 
--------------------------------------------------------------------------
   See also: ECIToEF, MagFieldPlanet
--------------------------------------------------------------------------

Children:

AerospaceUtils: Coord/ECIToEF
Common: Graphics/Plot2D
Common: Time/Date2JD
Common: Time/JD2000
Common: Time/JD2T
Math: Linear/Cross
Math: Linear/Unit
SC: BasicOrbit/RVFromKepler
SC: Environs/MagFieldPlanet
SC: SCMat/IGRF11

Back to the SC Module page