Orekit Lambert Solver

Greetings! I’m new to using Orekit, having transitioned (for both infrastructure and maintenance reasons) from Pykep, and I was wondering: Is there a Lambert solver hidden somewhere? My Javadoc searches are coming up empty, but the Orekit package is certainly expansive!

For complete context, this chunk of the project is to generate transfer orbits from one planet to the other, in order to generate plausible-but-fictional porkchop plot data. If I need to reimplement a Lambert solver (for which departure and arrival delta-V, assuming impulsive maneuvers, can be calculated) I might but I’d hate to reinvent a wheel that’s already been created by people more talented than myself!

Thank you!

Hello @SenorPez,

Welcome to Orekit and its forum !
There is a Lambert solver but it’s hidden in the estimation.iod package under the name IodLambert.
I’m afraid it’s not as modern as the one from PyKep. We would benefit from implementing Izzo’s or Der’s method (or both) to improve the results.
Still, it should work for producing the porkchop plots.

Cheers,
Maxime

Thank you for your reply!

I have some experiencing implementing Izzo’s algorithm, so I might take a crack at it and see how it compares to the IOD package algorithm. I helped a game development team for a space-based game; ironically, once they learned what real orbits cost and look like, they opted for a more “space opera” style!

1 Like

Good to know @SenorPez :slight_smile: What’s the name of the game?

Don’t forget to contribute it to Orekit if you develop a new Lambert solver :wink:

Cheers,
Maxime

Just found this topic by chance! Was this implemented in the end? If not, I previously implemented in R a solver based on Dario Izzo’s paper but modified to follow the design choice described by Gim Der to attempt to find all possible solutions for a given problem set up, i.e., covering all combinations of high and low altitude paths, and for all possible number of complete revolutions. I found that combining the good rigorous mathematical theory by Izzo with Der’s design of finding all solutions brings the added value that users do not have to input constraints such as maximum number of revolutions (I also tried to implement Der’s approach on its own but found the algorithm to be unstable under quite a few starting conditions…)

So if this is still an open issue, I can easily port it :slight_smile:

1 Like

Hello everyone, I recently had the need for Izzo’s method in my project.

I implemented it in native Java following closely the pykep C++ implementation.
It gives all the solutions for all the number of orbits up to the maximum that is set as a parameter (or the maximum number possible given the orbital situation). The output is basically two lists of delta-V vectors : v1 and v2, just like the pykep implementation.

I also have a TwoImpulseTransfer class that stores everything needed to simulate the trajectory of a spacecraft before, during, and after the transfer.
An extra layer on top of the raw Izzo Lambert solver allows the generation and manipulation of the transfers directly.

I also have a quick way to generate 2D delta-V plots (porkchop plots), as well as 1D Pareto curves delta-V = f(arrival date), that allows a user to pick a suboptimal transfer according to other constraints (time-of-flight constraints, launch date constraints, etc).

Maybe you could take a look at my port of pykep’s implementation and see if any of your improvements could be added to it ?
Or maybe if you port your version directly it will perform better ? In that case I can then adapt my higher-level functions (TwoImpulseTransfer, Pareto, porkchop) to your version.

1 Like

Sounds good! I already started porting it so maybe you can have a look at it and see how it fits with your higher-level functions?

Issues 748 and 1027 are still open on the forge.
Basically, the current implementation only provides half of the solution (small semi major axis one I guess) and there is no Field equivalent.

2 Likes

Sure, we can do it like that, just point me to your code somewhere and I’ll take a look when I have some time.

1 Like

I have now achieved a first draft for this! Please find it in my hybrid Lambert solver branch. For the moment I just have a single test case but I will add more very soon, and will also compare against the current solver in Orekit!

Also, Izzo’s algorithm requires the calculation of hypergeometric 2F1 function. For now, I implemented this ad hoc in the temporary IodLambertHybridclass using simply a basic series expansion approach. But I’m not sure what the best place for these purely mathematical functions would be. Maybe Hipparchus is a better place for these? Also, the GNU Scientific Library provides functions for these. I could not find a native Java implementation though.

Let me know what you think! :slight_smile:

Hi Rafa,

Thanks for this. Yeah I would say that something very mathematical should go in Hipparchus. You can open a pull request on its GitHub.

Cheers,
Romain.

1 Like

Take care to not use the GNU scientific library as a model. Its licence is incompatible with Orekit and Hipparchus.

1 Like

Thanks! I have based the current implementation on my direct interpretation of the proposed series expansion, so that should avoid all license conflicts I hope.

Also, while working on the solver, I revisited Gim Der’s paper and remembered he also proposes a method to perform Vinti corrections to Lambert solutions for the non-perturbed case. Would this be something of interest as well? If so, I can add this to the new proposed Lambert solver as well :slight_smile:

2 Likes