lamberthub.universal_solvers.gooding
#
A module hosting all algorithms devised by Gooding
Module Contents#
Functions#
|
Lambert's problem solver using the method proposed by R. H. Gooding in 1990. |
|
Auxiliary routine for computing the non-dimensional time of flight as |
|
Auxiliary routine for finding the independent variable as function of the |
|
Auxiliary routine for computing the velocity vector components, both |
- lamberthub.universal_solvers.gooding.gooding1990(mu, r1, r2, tof, M=0, prograde=True, low_path=True, maxiter=35, atol=1e-05, rtol=1e-07, full_output=False)#
Lambert’s problem solver using the method proposed by R. H. Gooding in 1990.
- Parameters:
mu (float) – Gravitational parameter, equivalent to \(GM\) of attractor body.
r1 (numpy.array) – Initial position vector.
r2 (numpy.array) – Final position vector.
M (int) – Number of revolutions. Must be equal or greater than 0 value.
prograde (bool) – If True, specifies prograde motion. Otherwise, retrograde motion is imposed.
low_path (bool) – If two solutions are available, it selects between high or low path.
maxiter (int) – Maximum number of iterations.
atol (float) – Absolute tolerance.
rtol (float) – Relative tolerance.
full_output (bool) – If True, the number of iterations and time per iteration are also returned.
- Returns:
v1 (numpy.array) – Initial velocity vector.
v2 (numpy.array) – Final velocity vector.
numiter (int) – Number of iterations.
tpi (float) – Time per iteration in seconds.
Notes
This module holds the Lambert’s problem solver devised by R. H. Gooding in his technical report [1] originally published in 1988. However, the implementation corresponds to the one proposed by the author a couple of years later in his article [2] from 1990. Some improvements to the originally algorithm were also made by Klumpp in his performance comparison [3] between Lamberts problem solvers. Those have been added to this code to prevent failures for particular inputs. The result is a fully working algorithm for both single and multi-revolution orbits.
The code has been kept as close as possible to the original FORTRAN-77 one. However, some statements (like “goto line” ones) have been deprecated as they introduce “spaghetti code”. Since the original implementation imposed a relative tolerance together with the number of iterations, these parameters have been modified so the user can freely choose their values.
References
- lamberthub.universal_solvers.gooding.tlamb(m, q, qsqfm1, x, n)#
Auxiliary routine for computing the non-dimensional time of flight as function of the number of revolutions, the transfer parameter and the independent variable.
- Parameters:
m (float) – Number of revolutions.
q (float) – The transfer angle parameter.
qsqfm1 – Equivalent to \(1-q^2\).
x (float) – The independent variable.
n (float) – Number of output parameters to be returned.
- Returns:
t (float) – Non-dimensional time evaluated at \(x\).
dt (float) – First derivative of the non-dimensional time evaluated at \(x\).
d2t (float) – Second derivative of the non-dimensional time evaluated at \(x\).
d3t (float) – Third derivative of the non-dimensional time evaluated at \(x\).
- lamberthub.universal_solvers.gooding.xlamb(m, q, qsqfm1, tin, maxiter, atol, rtol)#
Auxiliary routine for finding the independent variable as function of the number of revolutions, the transfer angle parameter and the non-dimensional time of flight.
- Parameters:
m (float) – Number of revolutions.
q (float) – The transfer angle parameter.
qsqfm1 (float) – Equivalent to \(1-q^2\).
tin (float) – The actual non-dimensional time of flight.
maxiter (int) – Maximum number of iterations.
atol (float) – Desired absolute tolerance.
rtol (float) – Desired relative tolerance.
- Returns:
n_sol (int) – Number of solutions.
x (float) – First solution.
xpl (float) – Second solution, if available.
numiter (int) – Number of iterations.
- lamberthub.universal_solvers.gooding.vlamb(mu, r1_norm, r2_norm, dtheta, tof, low_path, maxiter, atol, rtol)#
Auxiliary routine for computing the velocity vector components, both radian and tangential ones.
- Parameters:
mu (float) – Gravitational parameter, equivalent to \(GM\) of attractor body.
r1_norm (float) – Norm of the initial position vector.
r2_norm (float) – Norm of the final position vector.
dtheta (float) – Transfer angle between initial and final vectors.
tof (float) – Time of flight between initial and final position vectors.
low_path (bool) – If two solutions are available, it selects between high or low path.
maxiter (int) – Maximum number of iterations.
atol (float) – Absolute tolerance \(abs(x_{i+1} - x_{i})\)
rtol (float) – Relative tolerance \(abs(\frac{x_{i+1}}{x_{i}} - 1)\)
- Returns:
n_sol (int) – Number of solutions
vri (float) – Radial velocity component at the initial position vector.
vti (float) – Tangential velocity component at the initial position vector.
vrf (float) – Radial velocity component at the final position vector.
vtf (float) – Tangential velocity component at the final position vector.
numiter (int) – Number of iterations required to compute solution.