poliastro.core.iod

Module Contents

Functions

vallado(k, r0, r, tof, short, numiter, rtol)

Solves the Lambert’s problem.

izzo(k, r1, r2, tof, M, numiter, rtol)

Aplies izzo algorithm to solve Lambert’s problem.

_reconstruct(x, y, r1, r2, ll, gamma, rho, sigma)

Reconstruct solution velocity vectors.

_find_xy(ll, T, M, numiter, rtol)

Computes all x, y for given number of revolutions.

_compute_y(x, ll)

Computes y.

_compute_psi(x, y, ll)

Computes psi.

_tof_equation(x, T0, ll, M)

Time of flight equation.

_tof_equation_y(x, y, T0, ll, M)

Time of flight equation with externally computated y.

_tof_equation_p(x, y, T, ll)

_tof_equation_p2(x, y, T, dT, ll)

_tof_equation_p3(x, y, _, dT, ddT, ll)

_compute_T_min(ll, M, numiter, rtol)

Compute minimum T.

_initial_guess(T, ll, M)

Initial guess.

_halley(p0, T0, ll, tol, maxiter)

Find a minimum of time of flight equation using the Halley method.

_householder(p0, T0, ll, M, tol, maxiter)

Find a zero of time of flight equation using the Householder method.

poliastro.core.iod.vallado(k, r0, r, tof, short, numiter, rtol)

Solves the Lambert’s problem.

The algorithm returns the initial velocity vector and the final one, these are computed by the following expresions:

\[\begin{split}\vec{v_{o}} &= \frac{1}{g}(\vec{r} - f\vec{r_{0}}) \\ \vec{v} &= \frac{1}{g}(\dot{g}\vec{r} - \vec{r_{0}})\end{split}\]

Therefore, the lagrange coefficients need to be computed. For the case of Lamber’s problem, they can be expressed by terms of the initial and final vector:

\[\begin{split}\begin{align} f = 1 -\frac{y}{r_{o}} \\ g = A\sqrt{\frac{y}{\mu}} \\ \dot{g} = 1 - \frac{y}{r} \\ \end{align}\end{split}\]

Where y(z) is a function that depends on the poliastro.core.stumpff coefficients:

\[\begin{split}y = r_{o} + r + A\frac{zS(z)-1}{\sqrt{C(z)}} \\ A = \sin{(\Delta \nu)}\sqrt{\frac{rr_{o}}{1 - \cos{(\Delta \nu)}}}\end{split}\]

The value of z to evaluate the stump functions is solved by applying a Numerical method to the following equation:

\[z_{i+1} = z_{i} - \frac{F(z_{i})}{F{}'(z_{i})}\]

Function F(z) to the expression:

\[F(z) = \left [\frac{y(z)}{C(z)} \right ]^{\frac{3}{2}}S(z) + A\sqrt{y(z)} - \sqrt{\mu}\Delta t\]
Parameters
  • k (float) – Gravitational Parameter

  • r0 (array) – Initial position vector

  • r (array) – Final position vector

  • tof (~float) – Time of flight

  • numiter (int) – Number of iterations to

  • rtol (int) – Number of revolutions

Returns

  • v0 (~np.array) – Initial velocity vector

  • v (~np.array) – Final velocity vector

Examples

>>> from poliastro.core.iod import vallado
>>> from astropy import units as u
>>> import numpy as np
>>> from poliastro.bodies import Earth
>>> k = Earth.k.to(u.km**3 / u.s**2)
>>> r1 = np.array([5000, 10000, 2100])*u.km #Initial position vector
>>> r2 = np.array([-14600, 2500, 7000])*u.km #Final position vector
>>> tof = 3600*u.s #Time of fligh
>>> v1, v2 = vallado(k.value, r1.value, r2.value, tof.value, short=True, numiter=35, rtol=1e-8)
>>> v1 = v1*u.km / u.s
>>> v2 = v2*u.km / u.s
>>> print(v1, v2)
[-5.99249503  1.92536671  3.24563805] km / s [-3.31245851 -4.19661901 -0.38528906] km / s

Note

This procedure can be found in section 5.3 of Curtis, with all the theoretical description of the problem. Analytical example can be found in the same book under name Example 5.2.

poliastro.core.iod.izzo(k, r1, r2, tof, M, numiter, rtol)

Aplies izzo algorithm to solve Lambert’s problem.

Parameters
  • k (float) – Gravitational Constant

  • r1 (array) – Initial position vector

  • r2 (array) – Final position vector

  • tof (float) – Time of flight between both positions

  • M (int) – Number of revolutions

  • numiter (int) – Numbert of iterations

  • rtol (float) – Error tolerance

Returns

  • v1 (~numpy.array) – Initial velocity vector

  • v2 (~numpy.array) – Final velocity vector

poliastro.core.iod._reconstruct(x, y, r1, r2, ll, gamma, rho, sigma)

Reconstruct solution velocity vectors.

poliastro.core.iod._find_xy(ll, T, M, numiter, rtol)

Computes all x, y for given number of revolutions.

poliastro.core.iod._compute_y(x, ll)

Computes y.

poliastro.core.iod._compute_psi(x, y, ll)

Computes psi.

“The auxiliary angle psi is computed using Eq.(17) by the appropriate inverse function”

poliastro.core.iod._tof_equation(x, T0, ll, M)

Time of flight equation.

poliastro.core.iod._tof_equation_y(x, y, T0, ll, M)

Time of flight equation with externally computated y.

poliastro.core.iod._tof_equation_p(x, y, T, ll)
poliastro.core.iod._tof_equation_p2(x, y, T, dT, ll)
poliastro.core.iod._tof_equation_p3(x, y, _, dT, ddT, ll)
poliastro.core.iod._compute_T_min(ll, M, numiter, rtol)

Compute minimum T.

poliastro.core.iod._initial_guess(T, ll, M)

Initial guess.

poliastro.core.iod._halley(p0, T0, ll, tol, maxiter)

Find a minimum of time of flight equation using the Halley method.

Note

This function is private because it assumes a calling convention specific to this module and is not really reusable.

poliastro.core.iod._householder(p0, T0, ll, M, tol, maxiter)

Find a zero of time of flight equation using the Householder method.

Note

This function is private because it assumes a calling convention specific to this module and is not really reusable.