Astro  0.0.0
A C++ library for space dynamics
Loading...
Searching...
No Matches
Astro::Body Class Reference

Astronomical body class container. More...

#include <Body.hh>

Public Types

using Anomaly = OrbitalElements::Anomaly

Public Member Functions

 Body ()
 Body (std::string const &t_name, Real const t_mass, Real const t_radius=0.0)
 Body (Body const &)=default
 Body (Body &&)=default
Bodyoperator= (const Body &)=default
Bodyoperator= (Body &&)=default
std::string name () const
void name (std::string const &t_name)
Orbit const & orbit () const
Orbitset_orbit ()
Anomaly const & epoch_anomaly () const
Anomalyset_epoch_anomaly ()
void set_epoch_anomaly (Anomaly const &t_epoch_anomaly)
Anomaly anomaly (Real const t) const
Real epoch () const
void set_epoch (Real const t_epoch)
Real mass () const
void mass (Real const t_mass)
Real radius () const
void radius (Real const t_radius)
Vector6 cartesian_state () const
Vector6 cartesian_state (Real const t) const
Vector3 cartesian_position (Real const t) const
Vector3 cartesian_velocity (Real const t) const
void set_cartesian_state (Vector6 const &cart)
Vector6 keplerian_state (Real const t) const
void set_keplerian_state (Vector6 const &state)
Vector6 equinoctial_state (Real const t) const
void set_equinoctial_state (Vector6 const &state)
template<typename T>
Eigen::Matrix< T, 6, 1 > cartesian_eom (Eigen::Matrix< T, 6, 1 > const &x, Eigen::Matrix< T, 3, 1 > const &thrust_rtn) const
Vector6 keplerian_eom (Vector6 const &x, Vector3 const &thrust) const
Vector6 equinoctial_eom (Vector6 const &x, Vector3 const &thrust) const
Vector6 equinoctial_eom (Vector6 const &x, Real thrust_rad, Real thrust_tan, Real thrust_nor) const
template<Coordinates IntCoords, Coordinates OutCoords = Coordinates::CARTESIAN, Integer S>
bool integrate (Sandals::RungeKutta< Real, S, 6, 0 > &rk, VectorX const &t_mesh, Vector6 const &ics, Sandals::Solution< Real, 6, 0 > &sol, bool const adaptive=false)

Private Attributes

std::string m_name {"(undefined)"}
Real m_epoch {0.0}
Anomaly m_epoch_anom
Orbit m_orbit
Real m_radius {QUIET_NAN}
Real m_mass {QUIET_NAN}

Detailed Description

The astronomical body class container is used to model the properties of an astronomical body in space. The class provides methods for setting and getting the mass of the body, as well as its orbit parameters.

Member Typedef Documentation

◆ Anomaly

Constructor & Destructor Documentation

◆ Body() [1/4]

Astro::Body::Body ( )
inline

Class constructor for the astronomical body object.

◆ Body() [2/4]

Astro::Body::Body ( std::string const & t_name,
Real const t_mass,
Real const t_radius = 0.0 )
inline

Class constructor for the astronomical body object with a given mass.

Parameters
[in]t_massThe mass of the astronomical body.

◆ Body() [3/4]

Astro::Body::Body ( Body const & )
default

Enable the default astronomical body copy constructor.

◆ Body() [4/4]

Astro::Body::Body ( Body && )
default

Enable the default astronomical body move constructor.

Member Function Documentation

◆ anomaly()

Anomaly Astro::Body::anomaly ( Real const t) const
inline

Compute the anomalies at a given time.

Parameters
[in]tThe time \( t \).
Returns
The anomalies at time \( t \).

◆ cartesian_eom()

template<typename T>
Eigen::Matrix< T, 6, 1 > Astro::Body::cartesian_eom ( Eigen::Matrix< T, 6, 1 > const & x,
Eigen::Matrix< T, 3, 1 > const & thrust_rtn ) const
inline

Compute the vector of the first-order cartesian equations of orbital motion given the thrust vector components \( \mathbf{t} = [t_{\text{rad}}, t_{\text{tan}}, t_{\text{nor}}]^\top \).

Parameters
[in]xThe cartesian state vector \( \mathbf{x} = [r_x, r_y, r_z, v_x, v_y, v_z]^\top \).
[in]thrust_rtnThe thrust components vector.
Returns
The vector of the first-order cartesian equations of orbital motion.

◆ cartesian_position()

Vector3 Astro::Body::cartesian_position ( Real const t) const
inline

Get the cartesian position vector of the astronomical body.

Parameters
[in]tThe time \( t \).
Returns
The cartesian position vector of the astronomical body.

◆ cartesian_state() [1/2]

Vector6 Astro::Body::cartesian_state ( ) const
inline

Get the cartesian state vector of the astronomical body.

Returns
The cartesian state vector of the astronomical body.

◆ cartesian_state() [2/2]

Vector6 Astro::Body::cartesian_state ( Real const t) const
inline

Get the cartesian state vector of the astronomical body.

Parameters
[in]tThe time \( t \).
Returns
The cartesian state vector of the astronomical body.

◆ cartesian_velocity()

Vector3 Astro::Body::cartesian_velocity ( Real const t) const
inline

Get the cartesian velocity vector of the astronomical body.

Parameters
[in]tThe time \( t \).
Returns
The cartesian velocity vector of the astronomical body.

◆ epoch()

Real Astro::Body::epoch ( ) const
inline

Get the epoch of the orbital elements (in days).

Returns
The epoch of the orbital elements (in days).

◆ epoch_anomaly()

Anomaly const & Astro::Body::epoch_anomaly ( ) const
inline

Get the orbital anomalies at the epoch.

Returns
The orbital anomalies at the epoch.

◆ equinoctial_eom() [1/2]

Vector6 Astro::Body::equinoctial_eom ( Vector6 const & x,
Real thrust_rad,
Real thrust_tan,
Real thrust_nor ) const
inline

Compute the system of first-order modified equinoctial equations of orbital motion given the thrust vector components \( \mathbf{t} = [t_{\text{rad}}, t_{\text{tan}}, t_{\text{nor}}]^\top \).

Parameters
[in]xThe modified equinoctial state vector \( \mathbf{x} = [p, f, g, h, k, L]^\top \).
[in]thrust_radThe radial component of the thrust.
[in]thrust_tanThe tangential component of the thrust.
[in]thrust_norThe normal component of the thrust.
Returns
The system of first-order modified equinoctial equations of orbital motion.

◆ equinoctial_eom() [2/2]

Vector6 Astro::Body::equinoctial_eom ( Vector6 const & x,
Vector3 const & thrust ) const
inline

Compute the system of first-order modified equinoctial equations of orbital motion given the thrust vector components \( \mathbf{t} = [t_{\text{rad}}, t_{\text{tan}}, t_{\text{nor}}]^\top \).

Parameters
[in]xThe modified equinoctial state vector \( \mathbf{x} = [p, f, g, h, k, L]^\top \).
[in]thrustThe components (radial, tangential, normal) of the thrust.
Returns
The system of first-order modified equinoctial equations of orbital motion.

◆ equinoctial_state()

Vector6 Astro::Body::equinoctial_state ( Real const t) const
inline

Get the equinoctial state vector of the astronomical body.

Parameters
[in]tThe time \( t \).
Returns
The equinoctial state vector of the astronomical body.

◆ integrate()

template<Coordinates IntCoords, Coordinates OutCoords = Coordinates::CARTESIAN, Integer S>
bool Astro::Body::integrate ( Sandals::RungeKutta< Real, S, 6, 0 > & rk,
VectorX const & t_mesh,
Vector6 const & ics,
Sandals::Solution< Real, 6, 0 > & sol,
bool const adaptive = false )
inline

Integrate the equations of motion using the Runge-Kutta method.

Parameters
[in]rkThe Runge-Kutta integrator.
[in]t_meshThe time mesh for the integration.
[in]icsThe initial conditions for the integration (initial modified equinoctial state).
[out]solThe solution object to store the results of the integration.
Template Parameters
SThe stages of the Runge-Kutta method.
IntCoordsThe coordinate system for the integration.
OutCoordsThe coordinate system for the output of the integration.
Returns
The integrated modified equinoctial state vectors.
Note
The IntCoords and OutCoords parameters are used to specify the coordinate systems for the integration and output, respectively. The IntCoords parameter is used to specify the coordinate system in which the equations of motion are integrated, while the OutCoords parameter is used to specify the coordinate system in which the results of the integration are output.

◆ keplerian_eom()

Vector6 Astro::Body::keplerian_eom ( Vector6 const & x,
Vector3 const & thrust ) const
inline

Compute the vector of the first-order keplerian equations of orbital motion given the thrust vector components \( \mathbf{t} = [t_{\text{rad}}, t_{\text{tan}}, t_{\text{nor}}]^\top \).

Parameters
[in]xThe keplerian state vector \( \mathbf{x} = [a, e, i, \Omega, \omega, M]^\top \).
[in]thrustThe components (radial, tangential, normal) of the thrust.
Returns
The vector of the first-order keplerian equations of orbital motion.

◆ keplerian_state()

Vector6 Astro::Body::keplerian_state ( Real const t) const
inline

Get the keplerian state vector of the astronomical body at time \( t \).

Parameters
[in]tThe time \( t \).
Returns
The keplerian state vector of the astronomical body.

◆ mass() [1/2]

Real Astro::Body::mass ( ) const
inline

Get the mass of the astronomical body.

Returns
The mass of the astronomical body.

◆ mass() [2/2]

void Astro::Body::mass ( Real const t_mass)
inline

Set the mass of the astronomical body.

Parameters
[in]t_massThe mass of

◆ name() [1/2]

std::string Astro::Body::name ( ) const
inline

Get the name of the astronomical body.

Returns
The name of the astronomical body.

◆ name() [2/2]

void Astro::Body::name ( std::string const & t_name)
inline

Set the name of the astronomical body.

Parameters
[in]t_nameThe name of the astronomical body.

◆ operator=() [1/2]

Body & Astro::Body::operator= ( Body && )
default

Enable the default astronomical body move assignment operator.

◆ operator=() [2/2]

Body & Astro::Body::operator= ( const Body & )
default

Enable the default astronomical body assignment operator.

◆ orbit()

Orbit const & Astro::Body::orbit ( ) const
inline

Get the orbit parameters of the astronomical body.

Returns
The orbit parameters of the astronomical body.

◆ radius() [1/2]

Real Astro::Body::radius ( ) const
inline

Get the radius of the astronomical body.

Returns
The radius of the astronomical body.

◆ radius() [2/2]

void Astro::Body::radius ( Real const t_radius)
inline

Set the radius of the astronomical body.

Parameters
[in]t_radiusThe radius of the astronomical body.

◆ set_cartesian_state()

void Astro::Body::set_cartesian_state ( Vector6 const & cart)
inline

Set the cartesian state vector of the astronomical body.

Parameters
[in]cartThe cartesian state vector of the astronomical body.

◆ set_epoch()

void Astro::Body::set_epoch ( Real const t_epoch)
inline

Set the epoch of the orbital elements (in days).

Parameters
[in]t_epochThe epoch of the orbital elements (in days).

◆ set_epoch_anomaly() [1/2]

Anomaly & Astro::Body::set_epoch_anomaly ( )
inline

Set the orbital anomalies at the epoch.

Returns
The orbital anomalies at the epoch.

◆ set_epoch_anomaly() [2/2]

void Astro::Body::set_epoch_anomaly ( Anomaly const & t_epoch_anomaly)
inline

Set the orbital anomalies at the epoch.

Parameters
[in]t_epoch_anomalyThe orbital anomalies at the epoch.

◆ set_equinoctial_state()

void Astro::Body::set_equinoctial_state ( Vector6 const & state)
inline

Set the equinoctial state vector of the astronomical body.

Parameters
[in]stateThe equinoctial state vector of the astronomical body.

◆ set_keplerian_state()

void Astro::Body::set_keplerian_state ( Vector6 const & state)
inline

Set the keplerian state vector of the astronomical body.

Parameters
[in]stateThe keplerian state vector of the astronomical body.

◆ set_orbit()

Orbit & Astro::Body::set_orbit ( )
inline

Set the orbit parameters of the astronomical body.

Returns
The orbit parameters of the astronomical body.

Member Data Documentation

◆ m_epoch

Real Astro::Body::m_epoch {0.0}
private

Epoch of the orbital elements (in days).

◆ m_epoch_anom

Anomaly Astro::Body::m_epoch_anom
private

Orbital anomalies at the epoch.

◆ m_mass

Real Astro::Body::m_mass {QUIET_NAN}
private

Mass of the astronomical body.

◆ m_name

std::string Astro::Body::m_name {"(undefined)"}
private

Name of the astronomical body.

◆ m_orbit

Orbit Astro::Body::m_orbit
private

Orbit parameters of the astronomical body.

◆ m_radius

Real Astro::Body::m_radius {QUIET_NAN}
private

Occupancy radius of the astronomical body (in AU).


The documentation for this class was generated from the following file: