Spacecraft Control Framework 1.0
Spacecraft Control Library
sc_gravity_earth.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------------------
2// Earth orbit gravity model.
3//-----------------------------------------------------------------------------------------
4// Copyright (c) 2011 Princeton Satellite Systems. All rights reserved.
5//-----------------------------------------------------------------------------------------
10#ifndef __GRAVITY_EARTH__
11#define __GRAVITY_EARTH__
12
13#ifdef AS_OS_WINDOWS
14 #include "matrixlib.h"
15#else
16 #include <MatrixLib/MatrixLib.h>
17#endif
18
19
37{
38
39 private:
41 int harmonics;
42
43 void initialize_from_file( char * filename );
44 double factorial( int k );
45 ml_matrix harmonic_accel( const ml_matrix& rG );
46
47 ml_matrix c;
48 ml_matrix s;
49
50 int nM;
51 int nN;
52
53 int nMUse;
54 int nNUse;
55
56 double mu;
57 double a;
58
59 int use_moon;
60 int use_sun;
61
62 ml_matrix aP;
63 ml_matrix aZ;
64 ml_matrix aT;
65
66
67 public:
69 gravity_earth( void );
70
72 void initialize( char * filename );
74 void initialize( void );
75
77 ml_matrix compute_accel( const ml_matrix& r_eci, double julian_date );
79 ml_matrix compute_accel_ef( const ml_matrix& r_ef, double julian_date );
80
82 void set_order( int n ){nMUse = n;};
84 void set_degree( int n ){nNUse = n;};
86 void include_moon_accel( void ){use_moon = 1;};
88 void include_sun_accel( void ){use_sun = 1;};
89
90
92 ml_matrix get_point_accel( void ){ return aP;};
94 ml_matrix get_tesseral_accel( void ){ return aT;};
96 ml_matrix get_zonal_accel( void ){ return aZ;};
97
98
99};
100
101
102#endif
Earth gravity model.
Definition: sc_gravity_earth.h:37
void initialize(void)
Initialize with GEMT1.
Definition: sc_gravity_earth.cc:36
void set_degree(int n)
Set the degree (See description)
Definition: sc_gravity_earth.h:84
void include_moon_accel(void)
Include the lunar gravitational perturbations.
Definition: sc_gravity_earth.h:86
void include_sun_accel(void)
Include the solar gravitational perturbations.
Definition: sc_gravity_earth.h:88
ml_matrix get_zonal_accel(void)
Get the zonal acceleration.
Definition: sc_gravity_earth.h:96
gravity_earth(void)
Constructor.
Definition: sc_gravity_earth.cc:19
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.
Definition: sc_gravity_earth.cc:175
ml_matrix get_point_accel(void)
Get the point source acceleration.
Definition: sc_gravity_earth.h:92
ml_matrix get_tesseral_accel(void)
Get the tesseral acceleration.
Definition: sc_gravity_earth.h:94
void set_order(int n)
Set the order (See description)
Definition: sc_gravity_earth.h:82
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.
Definition: sc_gravity_earth.cc:150