24#include <MatrixLib/MatrixLib.h>
44gravity_t *
init_gravity(
int z_harm,
int t_harm,
int spherical,
double p_radius,
double mu,
const ml_matrix& c_dist,
const ml_matrix& s_dist,
const ml_matrix& j);
56ml_matrix
gravity_n_body(
const ml_matrix& r,
const ml_matrix& mass,
double eps = 0 );
59ml_matrix
accel_planet(
const ml_matrix& r, ml_matrix& mu, ml_matrix& rho );
62ml_matrix
accel_planet(
const ml_matrix& r,
double mu, ml_matrix& rho );
struct gravity_s gravity_t
Structure for storing gravitational properties of a planet, used to compute the gravitational matrix ...
ml_matrix accel_planet(const ml_matrix &r, ml_matrix &mu, ml_matrix &rho)
Compute the gravity for n bodies.
Definition: sc_gravity.cc:110
gravity_t * init_gravity(int z_harm, int t_harm, int spherical, double p_radius, double mu, const ml_matrix &c_dist, const ml_matrix &s_dist, const ml_matrix &j)
Allocate and initialize a gravity structure.
Definition: sc_gravity.cc:150
ml_matrix compute_gravity(gravity_t *gravity, const ml_matrix &x_eci, const ml_matrix &m_eci_to_ef)
Compute the gravity matrix at a location and time.
Definition: sc_gravity.cc:186
void destroy_gravity(gravity_t *gravity)
Deallocate a gravity structure.
Definition: sc_gravity.cc:174
double total_energy_n_body(const ml_matrix &r, const ml_matrix &v, const ml_matrix &mass)
Compute the total energy for n bodies.
Definition: sc_gravity.cc:23
ml_matrix gravity_n_body(const ml_matrix &r, const ml_matrix &mass, double eps=0)
Compute the gravity for n bodies.
Definition: sc_gravity.cc:50
Structure for storing gravitational properties of a planet, used to compute the gravitational matrix ...
Definition: sc_gravity.h:30
ml_matrix s_coef
The sine term coefficients.
Definition: sc_gravity.h:33
ml_matrix l_coef
Legendre coefficients.
Definition: sc_gravity.h:37
ml_matrix c_coef
The cosine term coefficients.
Definition: sc_gravity.h:34
int z_harm
Number of zonal harmonics.
Definition: sc_gravity.h:38
double p_radius
Planet equatorial radius.
Definition: sc_gravity.h:31
double mu
Planet spherical gravity coefficient.
Definition: sc_gravity.h:32
ml_matrix s_dist
Functions of distance from the planet center that multiply the s terms.
Definition: sc_gravity.h:36
int t_harm
Number of tesseral harmonics.
Definition: sc_gravity.h:39
int spherical
If non-zero, include the spherical gravity term in the output force.
Definition: sc_gravity.h:40
ml_matrix c_dist
Functions of distance from the planet center that multiply the c terms.
Definition: sc_gravity.h:35