Spacecraft Control Framework 1.0
Spacecraft Control Library
Classes | Typedefs | Enumerations | Variables
sc_environs.h File Reference

Environmental functions. More...

Go to the source code of this file.

Classes

struct  mag_data_s
 Structure for storing magnetic field data. More...
 

Typedefs

typedef struct mag_data_s mag_data_t
 Structure for storing magnetic field data.
 

Enumerations

enum  {
  kMercury , kVenus , kEarth , kMars ,
  kJupiter , kSaturn , kUranus , kNeptune ,
  kPluto , kMoon , kPhobos , kDeimos ,
  kSun
}
 Planet IDs.
 

Functions

Atmosphere and gas functions
double mol_wt_to_R (double mol_wt)
 Compute gas constant R given the molecular weight. More...
 
double atm_dens_exp (double h, int planet=kEarth)
 Atmospheric density using an exponential model. More...
 
double atm_dens_scale (double h)
 Atmospheric density using scale heights. More...
 
Radiation
double earth_radiation_total (const ml_matrix &pos, const ml_matrix &u_sun)
 Computes the total earth radiation including albedo. More...
 
double earth_radiation (const ml_matrix &pos)
 Computes the earth radiation. More...
 
Magnetic field functions
ml_matrix b_dipole (const ml_matrix &pos, double jd)
 Computes the magnetic field based on a tilted dipole model. More...
 
ml_matrix mag_field (const ml_matrix &position, double jd, int nMax, const mag_data_s &mag_data)
 Planetary magnetic field at a given position. More...
 
ml_matrix schmidt (int nMax, int mMax)
 Schmidt normalization. More...
 
double albedo_flux (const ml_matrix &r, const ml_matrix &rPlanet, const ml_matrix &rSun, double radius=RADIUS_EARTH, double albedo=0.34)
 Albedo flux. More...
 

Variables

const double SOLAR_FLUX = 1367.0
 Value of solar flux at 1 AU, in W/m2.
 

Detailed Description

Environmental functions.

Atmosphere, magnetic field, and radiation models.

Function Documentation

◆ mol_wt_to_R()

double mol_wt_to_R ( double  mol_wt)

Compute gas constant R given the molecular weight.

Compute gas constant R given the molecular weight.

Parameters
mol_wtThe molecular weight.
Returns
Gas constant

References GAS_R.

◆ atm_dens_exp()

double atm_dens_exp ( double  h,
int  planet 
)

Atmospheric density using an exponential model.

Atmospheric density using an exponential model.

The earth model has an additional scaling coefficient in the exponent.

Parameters
hAltitude (km)
planetPlanetary ID
Returns
rho The density of the atmosphere in kg/m3.

◆ atm_dens_scale()

double atm_dens_scale ( double  h)

Atmospheric density using scale heights.

Atmospheric density using scale heights.

Valid from 0 to 1000 km. Ref: Wertz, J.R., Spacecraft Attitude Determination and Control, Kluwer, 1976, p. 820.

Parameters
hAltitude (km)
Returns
rho Atmospheric density (km/m3)

◆ earth_radiation_total()

double earth_radiation_total ( const ml_matrix &  pos,
const ml_matrix &  u_sun 
)

Computes the total earth radiation including albedo.

Computes the total earth radiation including albedo.

Assumes a fixed albedo fraction.

Parameters
posPosition vector relative to the Earth (km)
u_sunSun unit vector
Returns
Combined earth and albedo radiation flux

References earth_radiation(), RADIUS_EARTH, and SOLAR_FLUX.

◆ earth_radiation()

double earth_radiation ( const ml_matrix &  pos)

Computes the earth radiation.

Parameters
posPosition vector relative to the Earth (km)
Returns
Combined earth and albedo radiation flux

References earth_radiation(), and RADIUS_EARTH.

Referenced by earth_radiation(), and earth_radiation_total().

◆ b_dipole()

ml_matrix b_dipole ( const ml_matrix &  pos,
double  jd 
)

Computes the magnetic field based on a tilted dipole model.

Computes the magnetic field based on a tilted dipole model.

Parameters
pos(3,1) position vector in ECI frame.
jdJulian date.
Returns
Magnetic field vector (T).

References earth_rot(), and jd_to_jcent().

◆ mag_field()

ml_matrix mag_field ( const ml_matrix &  position,
double  jd,
int  nMax,
const mag_data_t mag_data 
)

Planetary magnetic field at a given position.

Planetary magnetic field at a given position.

Ref: Wertz, J., Spacecraft Attitude Determination and Control, Kluwer, 1976, pp. 779-781. Jursa, Adolph S., ed., Handbook of Geophysics and the Space Environment, Air Force Geophysics Laboratory, 1985, p. 4-28.

Parameters
position(3,1) Position in planet-centered frame (km)
jdJulian date
nMaxMaximum number of terms used
mag_dataStructure containing magnetic field data
Returns
b Magnetic field at position

References cart_to_sph(), mag_data_s::dateOfModel, earth_rot(), mag_data_s::g, mag_data_s::gDot, mag_data_s::h, mag_data_s::hDot, jd_to_jcent(), p_gauss(), RPhiTheta2Cart(), s_c_harm(), and schmidt().

◆ schmidt()

ml_matrix schmidt ( int  nMax,
int  mMax 
)

Schmidt normalization.

Schmidt normalization.

Used by MagField.

Parameters
nMaxMaximum n coefficient
mMaxMaximum m coefficient
Returns
the normalization coefficients

Referenced by mag_field().

◆ albedo_flux()

double albedo_flux ( const ml_matrix &  r,
const ml_matrix &  rPlanet,
const ml_matrix &  rSun,
double  radius,
double  albedo 
)

Albedo flux.

Parameters
rPosition vector
rPlanetLocation of the planet in the same frame
rSunPosition vector of the sun
radiusPlanet radius
albedoAlbedo fraction (0-1)
Returns
Magnitude of the albedo flux (W/m2)

References SOLAR_FLUX.