Crates.io | lambert-bate |
lib.rs | lambert-bate |
version | 0.1.0 |
source | src |
created_at | 2022-06-14 15:05:05.233792 |
updated_at | 2022-06-14 15:05:05.233792 |
description | A fast solver for Lambert's problem |
homepage | |
repository | https://github.com/jack-dinsmore/lambert-bate |
max_upload_size | |
id | 605879 |
size | 17,034 |
A lightweight Lambert's problem solver. The Universal Variables method introduced in "Fundamentals of Astrodynamics" (Bate, Mueller, and White, 1971) is used. This method was found to be the quickest to converge among those investigated in the review article "Review of Lambert's Problem" (Sangrà and Fantino, 2021).
Lambert's problem is to compute the orbit of a satellite given two points in its orbit and the time of flight between them. It has many uses, from planning spacecraft rendezvous to orbit determination. No formula exists for the orbital parameters as a function for these parameters, but a fairly straightforward formulation exists in which the solution can be found using Newton's method.
Here, we solve only for the satellite's velocities at the two known points in the orbit. If other orbital parameters are required, they can be easily computed from this. For example, the orbital energy is readily available from position and velocity at fixed time, which gives a semi-major axis. The orbital angular momentum is also determined, yielding the semi-latus rectum.
10,000 calls of get_velocities
were run for randomly chosen positions distributed in the cube centered on the origin with side length of 1e11 meters for times of flight between zero and 1e8 seconds. The time of execution and time per function call are compared to algorithms implemented in the Python lamberthub
library (version 0.1) for reference.
Due to the speed advantages of Rust over Python, lambert-bate
is more than 50 times faster than the Python implementation.
Algorithm name | Total time (ms) | Time per function call (μs) |
---|---|---|
lambert-bate (this crate) |
36 | 3.6 |
lamberthub.izzo2015 (Python) |
2,700 | 270 |
lamberthub.gooding1990 (Python) |
3,700 | 370 |
lamberthub.avanzini2008 (Python) |
14,000 | 1,400 |
lambert-bate
released.