Spacecraft Control Framework 1.0
Spacecraft Control Library
Public Member Functions | List of all members
gravity_earth Class Reference

Earth gravity model. More...

#include <sc_gravity_earth.h>

Public Member Functions

 gravity_earth (void)
 Constructor.
 
void initialize (char *filename)
 Initialize with a filename.
 
void initialize (void)
 Initialize with GEMT1. More...
 
ml_matrix compute_accel (const ml_matrix &r_eci, double julian_date)
 Update the model with the input position in ECI (Earth Centered Inertial) coordinates. More...
 
ml_matrix compute_accel_ef (const ml_matrix &r_ef, double julian_date)
 Update the model with the input position in EF (earth fixed) coordinates. More...
 
void set_order (int n)
 Set the order (See description)
 
void set_degree (int n)
 Set the degree (See description)
 
void include_moon_accel (void)
 Include the lunar gravitational perturbations.
 
void include_sun_accel (void)
 Include the solar gravitational perturbations.
 
ml_matrix get_point_accel (void)
 Get the point source acceleration.
 
ml_matrix get_tesseral_accel (void)
 Get the tesseral acceleration.
 
ml_matrix get_zonal_accel (void)
 Get the zonal acceleration.
 

Detailed Description

Earth gravity model.

This uses a table of data passed in from a file. This model supports GEMT1, JGM-2 and JGM-3. The SCControl project copies these models into your Library. You can initialize(char * filename) or initialize() which automatically gives you GEMT1. If you don't initialize you get a point mass model. There are accessors to set the order and to set the degree. You can include solar and lunar perturbations.

The subscript n is the degree of the model and m is the order. The harmonic terms are classified as zonal, sectorial and tesseral. Terms having m = 0 are zonals and depend only on latitude. Terms have m = n are call sectorials and depend on longitude. Tesseral terms depend on latitude and longitude and are terms where n > m and m != 0

The class outputs the total acceleration and has methods for the point mass, tesseral and zonal harmonic contributions.

Member Function Documentation

◆ initialize()

void gravity_earth::initialize ( void  )

Initialize with GEMT1.

Initialize the model from an ASCII text file.

◆ compute_accel()

ml_matrix gravity_earth::compute_accel ( const ml_matrix &  r_eci,
double  julian_date 
)

Update the model with the input position in ECI (Earth Centered Inertial) coordinates.

Update the gravitational acceleration given the ECI position vector and the Julian date.

Parameters
r_eciECI position vector
julian_dateJulian day number

References accel_planet(), jd_to_jcent(), moon_vector(), MU_MOON, MU_SUN, sun_vector(), and true_earth().

◆ compute_accel_ef()

ml_matrix gravity_earth::compute_accel_ef ( const ml_matrix &  r_ef,
double  julian_date 
)

Update the model with the input position in EF (earth fixed) coordinates.

Update the gravitational acceleration given the ECI position vector and the Julian date.

Parameters
r_efEF position vector
julian_dateJulian day number