Skip to content

Instantly share code, notes, and snippets.

@jonpsy
Created February 23, 2020 21:16
Show Gist options
  • Select an option

  • Save jonpsy/aada9bc4e514b851908c4d845a5623cc to your computer and use it in GitHub Desktop.

Select an option

Save jonpsy/aada9bc4e514b851908c4d845a5623cc to your computer and use it in GitHub Desktop.
Izzo and Vallado algorithm are used for the Lambert Problem. Both yield different answers
from poliastro.iod.vallado import lambert as lambert_v
from poliastro.iod.izzo import lambert as lambert_i
from astropy import units as u, constants as c
if __name__ == "__main__":
k = (c.GM_earth.to(u.km ** 3/ u.s ** 2))
r0 = ([10000., 0, 0] * u.km)
rf = ([8000., -5000, 0] * u.km)
tof = 2*u.hour
v_vallado = lambert_v(k, r0, rf, tof,short=True) #This is the correct answer
v_iz = lambert_i(k,r0,rf,tof,0)
print(next(v_vallado))
print(next(v_iz))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment