Spacecraft Control Framework 1.0
Spacecraft Control Library
|
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. | |
Environmental functions.
Atmosphere, magnetic field, and radiation models.
double mol_wt_to_R | ( | double | mol_wt | ) |
Compute gas constant R given the molecular weight.
Compute gas constant R given the molecular weight.
mol_wt | The molecular weight. |
References GAS_R.
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.
h | Altitude (km) |
planet | Planetary ID |
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.
h | Altitude (km) |
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.
pos | Position vector relative to the Earth (km) |
u_sun | Sun unit vector |
References earth_radiation(), RADIUS_EARTH, and SOLAR_FLUX.
double earth_radiation | ( | const ml_matrix & | pos | ) |
Computes the earth radiation.
pos | Position vector relative to the Earth (km) |
References earth_radiation(), and RADIUS_EARTH.
Referenced by earth_radiation(), and earth_radiation_total().
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.
pos | (3,1) position vector in ECI frame. |
jd | Julian date. |
References earth_rot(), and jd_to_jcent().
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.
position | (3,1) Position in planet-centered frame (km) |
jd | Julian date |
nMax | Maximum number of terms used |
mag_data | Structure containing magnetic field data |
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().
ml_matrix schmidt | ( | int | nMax, |
int | mMax | ||
) |
Schmidt normalization.
Schmidt normalization.
Used by MagField.
nMax | Maximum n coefficient |
mMax | Maximum m coefficient |
Referenced by mag_field().
double albedo_flux | ( | const ml_matrix & | r, |
const ml_matrix & | rPlanet, | ||
const ml_matrix & | rSun, | ||
double | radius, | ||
double | albedo | ||
) |
Albedo flux.
r | Position vector |
rPlanet | Location of the planet in the same frame |
rSun | Position vector of the sun |
radius | Planet radius |
albedo | Albedo fraction (0-1) |
References SOLAR_FLUX.