elements.h

elements.h#

Functions

void kepler_solve_elliptic(const real &M, const real &e, real &E, const real &tol, const int &max_iter)#

Solve the Kepler equation for elliptic orbits.

Parameters:
  • M[in] Mean anomaly.

  • e[in] Eccentricity.

  • E[out] Eccentric anomaly.

  • tol[in] Tolerance.

  • max_iter[in] Maximum number of iterations.

void kepler_solve_hyperbolic(const real &M, const real &e, real &EHyp, const real &tol, const int &max_iter)#

Solve the Kepler equation for hyperbolic orbits.

Parameters:
  • M[in] Mean anomaly.

  • e[in] Eccentricity.

  • EHyp[out] Hyperbolic anomaly.

  • tol[in] Tolerance.

  • max_iter[in] Maximum number of iterations.

void kepler_solve(const real &epochMjD, const std::vector<real> &cometaryState, const real &GM, real &M, real &E, real &nu, const real &tol = 1.0e-12L, const int &max_iter = 100)#

Solve the Kepler equation.

Parameters:
  • epochMjD[in] Epoch in TDB Modified Julian Date.

  • cometaryState[in] Cometary elements.

  • GM[in] Gravitational parameter.

  • M[out] Mean anomaly.

  • E[out] Eccentric anomaly (elliptic orbits) or hyperbolic anomaly (hyperbolic orbits)

  • nu[out] True anomaly.

  • tol[in] Tolerance.

  • max_iter[in] Maximum number of iterations.

void cometary_to_keplerian(const real &epochMjd, const std::vector<real> &cometaryState, std::vector<real> &keplerianState, const real GM = 2.959122082855911e-4L)#

Convert Cometary elements to Keplerian elements.

Parameters:
  • epochMjd[in] Epoch in TDB Modified Julian Date.

  • cometaryState[in] Cometary elements.

  • keplerianState[out] Keplerian elements.

  • GM[in] Gravitational parameter (default Sun).

void keplerian_to_cometary(const real &epochMjd, const std::vector<real> &keplerianState, std::vector<real> &cometaryState, const real GM = 2.959122082855911e-4L)#

Convert Keplerian elements to Cometary elements.

Parameters:
  • epochMjd[in] Epoch in TDB Modified Julian Date.

  • keplerianState[in] Keplerian elements.

  • cometaryState[out] Cometary elements.

  • GM[in] Gravitational parameter (default Sun).

void keplerian_to_cartesian(const std::vector<real> &keplerianState, std::vector<real> &cartesianState, const real GM = 2.959122082855911e-4L)#

Convert Keplerian elements to Cartesian state.

Parameters:
  • keplerianState[in] Keplerian elements.

  • cartesianState[out] Cartesian state.

  • GM[in] Gravitational parameter (default Sun).

void cartesian_to_keplerian(const std::vector<real> &cartesianState, std::vector<real> &keplerianState, const real GM = 2.959122082855911e-4L)#

Convert Cartesian state to Keplerian elements.

Parameters:
  • cartesianState[in] Cartesian state.

  • keplerianState[out] Keplerian elements.

  • GM[in] Gravitational parameter (default Sun).

void cometary_to_cartesian(const real &epochMjd, const std::vector<real> &cometaryState, std::vector<real> &cartesianState, const real GM = 2.959122082855911e-4L)#

Convert Cometary elements to Cartesian state.

Parameters:
  • epochMjd[in] Epoch in TDB Modified Julian Date.

  • cometaryState[in] Cometary elements.

  • cartesianState[out] Cartesian state.

  • GM[in] Gravitational parameter (default Sun).

void cartesian_to_cometary(const real &epochMjd, const std::vector<real> &cartesianState, std::vector<real> &cometaryState, const real GM = 2.959122082855911e-4L)#

Convert Cartesian state to Cometary elements.

Parameters:
  • epochMjd[in] Epoch in TDB Modified Julian Date.

  • cartesianState[in] Cartesian state.

  • cometaryState[out] Cometary elements.

  • GM[in] Gravitational parameter (default Sun).

void get_elements_partials(const real &epochMjd, const std::vector<real> &elems, const std::string conversion, std::vector<std::vector<real>> &partials, const real GM = 2.959122082855911e-4L)#

Get the partial derivatives of the Cometary/Keplerian elements with respect to the Cartesian state.

Parameters:
  • epochMjd[in] Epoch in TDB Modified Julian Date.

  • elems[in] Elements.

  • conversion[in] Conversion type.

  • partials[out] Partials of the elements w.r.t. the Cartesian state.

  • GM[in] Gravitational parameter (default Sun).

void get_cartesian_partials(const real &epochMjd, const std::vector<real> &state, const std::string &conversion, std::vector<std::vector<real>> &partials, const real GM = 2.959122082855911e-4L)#

Get the partial derivatives of the Cartesian state with respect to the Cometary/Keplerian elements.

Parameters:
  • epochMjd[in] Epoch in TDB Modified Julian Date.

  • elems[in] Elements.

  • conversion[in] Conversion type.

  • partials[out] Partials of the Cartesian state w.r.t. the elements.

  • GM[in] Gravitational parameter (default Sun).