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.
Public Member Functions | Private Member Functions | Private Attributes | List of all members
cqsp::common::systems::lambert::Izzo Class Reference

#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
 

Detailed Description

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.

Author
Dario Izzo (dario.izzo AT googlemail.com)

Constructor & Destructor Documentation

◆ Izzo()

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.

Parameters
[in]R1first cartesian position
[in]R2second cartesian position
[in]toftime of flight
[in]mugravity parameter
[in]cwwhen 1 a retrograde orbit is assumed
[in]multi_revsmaximum number of multirevolutions to compute

Member Function Documentation

◆ dTdx()

void cqsp::common::systems::lambert::Izzo::dTdx ( double &  DT,
double &  DDT,
double &  DDDT,
const double  x0,
const double  tof 
)
private

◆ get_iters()

const std::vector< int > & cqsp::common::systems::lambert::Izzo::get_iters ( ) const
Returns
an std::vector containing the iterations taken to compute each one of the solutions

◆ get_mu()

const double & cqsp::common::systems::lambert::Izzo::get_mu ( ) const
Returns
the gravitational parameter

◆ get_Nmax()

int cqsp::common::systems::lambert::Izzo::get_Nmax ( ) const
Returns
the maximum number of revolutions. The number of solutions to the problem will be Nmax*2 +1

◆ get_r1()

const glm::dvec3 & cqsp::common::systems::lambert::Izzo::get_r1 ( ) const
Returns
a 3-d array with the cartesian components of r1

◆ get_r2()

const glm::dvec3 & cqsp::common::systems::lambert::Izzo::get_r2 ( ) const
Returns
a 3-d array with the cartesian components of r2

◆ get_tof()

const double & cqsp::common::systems::lambert::Izzo::get_tof ( ) const
Returns
the time of flight

◆ get_v1()

const std::vector< glm::dvec3 > & cqsp::common::systems::lambert::Izzo::get_v1 ( ) const
Returns
an std::vector containing 3-d arrays with the cartesian components of the velocities at r1 for all 2N_max+1 solutions

◆ get_v2()

const std::vector< glm::dvec3 > & cqsp::common::systems::lambert::Izzo::get_v2 ( ) const
Returns
an std::vector containing 3-d arrays with the cartesian components of the velocities at r2 for all 2N_max+1 solutions

◆ get_x()

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)

Returns
the x variables in an std::vector

◆ householder()

int cqsp::common::systems::lambert::Izzo::householder ( const double  T,
double &  x0,
const int  N,
const double  eps,
const int  iter_max 
)
private

◆ hypergeometricF()

double cqsp::common::systems::lambert::Izzo::hypergeometricF ( double  z,
double  tol 
)
private

◆ solve()

void cqsp::common::systems::lambert::Izzo::solve ( )

◆ x2tof()

void cqsp::common::systems::lambert::Izzo::x2tof ( double &  tof,
const double  x0,
const int  N 
)
private

◆ x2tof2()

void cqsp::common::systems::lambert::Izzo::x2tof2 ( double &  tof,
const double  x0,
const int  N 
)
private

Member Data Documentation

◆ cw

bool cqsp::common::systems::lambert::Izzo::cw
private

◆ m_c

double cqsp::common::systems::lambert::Izzo::m_c
private

◆ m_has_converged

bool cqsp::common::systems::lambert::Izzo::m_has_converged
private

◆ m_iters

std::vector<int> cqsp::common::systems::lambert::Izzo::m_iters
private

◆ m_lambda

double cqsp::common::systems::lambert::Izzo::m_lambda
private

◆ m_multi_revs

int cqsp::common::systems::lambert::Izzo::m_multi_revs
private

◆ m_Nmax

int cqsp::common::systems::lambert::Izzo::m_Nmax
private

◆ m_s

double cqsp::common::systems::lambert::Izzo::m_s
private

◆ m_v1

std::vector<glm::dvec3> cqsp::common::systems::lambert::Izzo::m_v1
private

◆ m_v2

std::vector<glm::dvec3> cqsp::common::systems::lambert::Izzo::m_v2
private

◆ m_x

std::vector<double> cqsp::common::systems::lambert::Izzo::m_x
private

◆ mu

const double cqsp::common::systems::lambert::Izzo::mu
private

◆ r1

const glm::dvec3 cqsp::common::systems::lambert::Izzo::r1
private

◆ r2

const glm::dvec3 cqsp::common::systems::lambert::Izzo::r2
private

◆ tof

const double cqsp::common::systems::lambert::Izzo::tof
private

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