![]() |
Conquer Space 0.0.0
A space themed grand strategy game set in the near future, with realistic orbital mechanics, and an emphasis on economics and politics.
|
#include <izzo.h>
Public Member Functions | |
Izzo (const glm::dvec3 &r1, const glm::dvec3 &r2, const double &tof=3.1415926535/2, const double &mu=1., const bool cw=false, const int &multi_revs=5) | |
const std::vector< glm::dvec3 > & | get_v1 () const |
const std::vector< glm::dvec3 > & | get_v2 () const |
const glm::dvec3 & | get_r1 () const |
const glm::dvec3 & | get_r2 () const |
const double & | get_tof () const |
const double & | get_mu () const |
const std::vector< double > & | get_x () const |
const std::vector< int > & | get_iters () const |
int | get_Nmax () const |
void | solve () |
Private Member Functions | |
int | householder (const double T, double &x0, const int N, const double eps, const int iter_max) |
void | dTdx (double &DT, double &DDT, double &DDDT, const double x0, const double tof) |
void | x2tof (double &tof, const double x0, const int N) |
void | x2tof2 (double &tof, const double x0, const int N) |
double | hypergeometricF (double z, double tol) |
Private Attributes | |
const glm::dvec3 | r1 |
const glm::dvec3 | r2 |
const double | tof |
const double | mu |
std::vector< glm::dvec3 > | m_v1 |
std::vector< glm::dvec3 > | m_v2 |
std::vector< int > | m_iters |
std::vector< double > | m_x |
double | m_s |
double | m_c |
double | m_lambda |
int | m_Nmax |
bool | m_has_converged |
int | m_multi_revs |
bool | cw |
This class represent a Lambert's problem. When instantiated it assumes a prograde orbit (unless otherwise stated) and evaluates all the solutions up to a maximum number of multiple revolutions. After the object is instantiated the solutions can be retreived using the appropriate getters. Note that the number of solutions will be N_max*2 + 1, where N_max is the maximum number of revolutions.
NOTE: The class has been tested extensively via monte carlo runs checked with numerical propagation. Compared to the previous Lambert Solver in the keplerian_toolbox it is 1.7 times faster (on average as defined by lambert_test.cpp). With respect to Gooding algorithm it is 1.3 - 1.5 times faster (zero revs - multi revs). The algorithm is described in detail in the publication below and its original with the author.
cqsp::common::systems::lambert::Izzo::Izzo | ( | const glm::dvec3 & | r1, |
const glm::dvec3 & | r2, | ||
const double & | tof = 3.1415926535 / 2 , |
||
const double & | mu = 1. , |
||
const bool | cw = false , |
||
const int & | multi_revs = 5 |
||
) |
Constructs and solves a Lambert problem.
[in] | R1 | first cartesian position |
[in] | R2 | second cartesian position |
[in] | tof | time of flight |
[in] | mu | gravity parameter |
[in] | cw | when 1 a retrograde orbit is assumed |
[in] | multi_revs | maximum number of multirevolutions to compute |
|
private |
const std::vector< int > & cqsp::common::systems::lambert::Izzo::get_iters | ( | ) | const |
const double & cqsp::common::systems::lambert::Izzo::get_mu | ( | ) | const |
int cqsp::common::systems::lambert::Izzo::get_Nmax | ( | ) | const |
const glm::dvec3 & cqsp::common::systems::lambert::Izzo::get_r1 | ( | ) | const |
const glm::dvec3 & cqsp::common::systems::lambert::Izzo::get_r2 | ( | ) | const |
const double & cqsp::common::systems::lambert::Izzo::get_tof | ( | ) | const |
const std::vector< glm::dvec3 > & cqsp::common::systems::lambert::Izzo::get_v1 | ( | ) | const |
const std::vector< glm::dvec3 > & cqsp::common::systems::lambert::Izzo::get_v2 | ( | ) | const |
const std::vector< double > & cqsp::common::systems::lambert::Izzo::get_x | ( | ) | const |
Gets the x variable for each solution found (0 revs, 1,1,2,2,3,3 .... N,N)
|
private |
|
private |
void cqsp::common::systems::lambert::Izzo::solve | ( | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |