Classes | Typedefs | Enumerations | Functions

sc_environs.h File Reference

Environmental functions. More...

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

double mol_wt_to_R (double mol_wt)
 Compute gas constant R given the molecular weight.
double atm_dens_exp (double h, int planet=kEarth)
 Atmospheric density using an exponential model.
double atm_dens_scale (double h)
 Atmospheric density using scale heights.
double earth_radiation_total (const ml_matrix &pos, const ml_matrix &u_sun)
 Computes the total earth radiation including albedo.
double earth_radiation (const ml_matrix &pos)
 Computes the earth radiation.
ml_matrix b_dipole (const ml_matrix &pos, double jd)
 Computes the magnetic field based on a tilted dipole model.
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.
ml_matrix schmidt (int nMax, int mMax)
 Schmidt normalization.
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.

Detailed Description

Atmosphere, magnetic field, and radiation models.


Function Documentation

double mol_wt_to_R ( double  mol_wt )

Compute gas constant R given the molecular weight.

Parameters:
mol_wtThe molecular weight.
Returns:
Gas constant

References GAS_R.

double atm_dens_exp ( double  h,
int  planet 
)

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.
double atm_dens_scale ( double  h )

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)
double earth_radiation_total ( const ml_matrix &  pos,
const ml_matrix &  u_sun 
)

Computes the total earth radiation including albedo.

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

References RADIUS_EARTH.

double earth_radiation ( const ml_matrix &  pos )
Parameters:
posPosition vector relative to the Earth (km)
Returns:
Combined earth and albedo radiation flux

References RADIUS_EARTH.

ml_matrix b_dipole ( const ml_matrix &  pos,
double  jd 
)

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).
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.

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 mag_data_s::dateOfModel, mag_data_s::g, mag_data_s::gDot, mag_data_s::h, and mag_data_s::hDot.

ml_matrix schmidt ( int  nMax,
int  mMax 
)

Schmidt normalization.

Used by MagField.

Parameters:
nMaxMaximum n coefficient
mMaxMaximum m coefficient
Returns:
the normalization coefficients
double albedo_flux ( const ml_matrix &  r,
const ml_matrix &  rPlanet,
const ml_matrix &  rSun,
double  radius,
double  albedo 
)
Parameters:
rPosition vector
rPlanetLocation of the planet in the same frame
rSunPosition vector of the sun
radiusPlanet radius
albedoalbedo fraction
Maximumm coefficient
Returns:
magnitude of the albedo flux