Spacecraft Control Framework 1.0
Spacecraft Control Library
sc_environs.h
Go to the documentation of this file.
1/*
2 * environs.h
3 *
4 * Programmers: Joseph Mueller, Mike Paluszek, Lavanya Swetharanyan, Stephanie Thomas, Wil Turner, David Wilson
5 *
6 * Copyright 1999-2006, Princeton Satellite Systems. All rights reserved.
7 *
8 * Environmental functions.
9 */
10
17#ifndef __SC_ENVIRONS__
18#define __SC_ENVIRONS__
19
20#ifdef AS_OS_WINDOWS
21#include "matrixlib.h"
22#else
23#include <MatrixLib/MatrixLib.h>
24#endif
25
26#include "sc_constants.h"
27
28extern "C++"
29{
30
32const double SOLAR_FLUX = 1367.0;
33
35enum { kMercury,
36 kVenus,
37 kEarth,
38 kMars,
39 kJupiter,
40 kSaturn,
41 kUranus,
42 kNeptune,
43 kPluto,
44 kMoon,
45 kPhobos,
46 kDeimos,
47 kSun };
48
51typedef struct mag_data_s {
52 ml_matrix g;
53 ml_matrix h;
54 ml_matrix gDot;
55 ml_matrix hDot;
56 double dateOfModel;
58
63double mol_wt_to_R( double mol_wt );
65double atm_dens_exp( double h, int planet=kEarth );
67double atm_dens_scale( double h );
69
74double earth_radiation_total( const ml_matrix& pos, const ml_matrix& u_sun );
76double earth_radiation( const ml_matrix& pos );
78
83ml_matrix b_dipole( const ml_matrix& pos, double jd );
85ml_matrix mag_field( const ml_matrix& position, double jd, int nMax, const mag_data_s& mag_data );
87ml_matrix schmidt( int nMax, int mMax );
89double albedo_flux( const ml_matrix& r, const ml_matrix& rPlanet, const ml_matrix& rSun, double radius = RADIUS_EARTH, double albedo = 0.34 );
91
92}
93
94#endif
struct mag_data_s mag_data_t
Structure for storing magnetic field data.
Physical and mathematical constants.
const double RADIUS_EARTH
Earth equatorial radius in km.
Definition: sc_constants.h:59
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.
Definition: sc_environs.cc:232
double atm_dens_scale(double h)
Atmospheric density using scale heights.
Definition: sc_environs.cc:106
double atm_dens_exp(double h, int planet=kEarth)
Atmospheric density using an exponential model.
Definition: sc_environs.cc:25
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.
Definition: sc_environs.cc:404
double earth_radiation_total(const ml_matrix &pos, const ml_matrix &u_sun)
Computes the total earth radiation including albedo.
Definition: sc_environs.cc:190
ml_matrix schmidt(int nMax, int mMax)
Schmidt normalization.
Definition: sc_environs.cc:365
const double SOLAR_FLUX
Value of solar flux at 1 AU, in W/m2.
Definition: sc_environs.h:32
ml_matrix b_dipole(const ml_matrix &pos, double jd)
Computes the magnetic field based on a tilted dipole model.
Definition: sc_environs.cc:152
double earth_radiation(const ml_matrix &pos)
Computes the earth radiation.
Definition: sc_environs.cc:211
double mol_wt_to_R(double mol_wt)
Compute gas constant R given the molecular weight.
Definition: sc_environs.cc:141
Structure for storing magnetic field data.
Definition: sc_environs.h:51
ml_matrix hDot
Coefficient derivatives [nT/yr].
Definition: sc_environs.h:55
ml_matrix h
Gaussian coefficients, sine terms [nT].
Definition: sc_environs.h:53
double dateOfModel
Julian date of model.
Definition: sc_environs.h:56
ml_matrix gDot
Coefficient derivatives [nT/yr].
Definition: sc_environs.h:54
ml_matrix g
Gaussian coefficients, cosine terms [nT].
Definition: sc_environs.h:52