Skip to content

Lambert Solver

Solves Lambert's two-point boundary value problem with the algorithm of Izzo (2015); see the Lambert's Problem guide for the formulation.

lambert(r1, r2, tof, mu=None, prograde=None)

Solve Lambert's problem using Izzo's algorithm (2015).

Given two position vectors and a time of flight, find the velocity vectors for transfer orbits connecting them.

Parameters:

Name Type Description Default
r1 ArrayLike

Departure position, meters: any real numeric 3-element array-like (numpy array, list or tuple)

required
r2 ArrayLike

Arrival position, meters (likewise)

required
tof float | duration | timedelta

Time of flight, must be positive: a number of seconds, a satkit.duration or a datetime.timedelta

required
mu float | None

Gravitational parameter in m³/s² (default: Earth µ = 3.986e14)

None
prograde bool | None

If True (default), prograde transfer (angular momentum h_z >= 0); if False, retrograde (h_z <= 0). This picks the short or long way around.

None

Returns:

Type Description
list[tuple[NDArray[float64], NDArray[float64]]]

List of (v1, v2) tuples. Each v1 and v2 is a 3-element numpy array in m/s. The first element is the zero-revolution solution; additional elements are multi-revolution solutions if they exist.

Raises:

Type Description
TypeError

If r1 or r2 is not a real numeric array-like, tof is not a number, duration or timedelta, or mu is not a number

ValueError

If inputs are invalid (r1 or r2 not 3 elements, non-finite values, tof or mu not positive, zero position, r1 == r2), or if the solver fails to converge

Example
import satkit
import numpy as np

r1 = np.array([7000e3, 0, 0])
r2 = np.array([0, 7000e3, 0])
solutions = satkit.lambert(r1, r2, 3600.0)
v1, v2 = solutions[0]