Skip to content

Instantly share code, notes, and snippets.

@jonpsy
Created February 23, 2020 21:21
Show Gist options
  • Save jonpsy/2ea302bf40bf8fdd1e154e813b06ea11 to your computer and use it in GitHub Desktop.
Save jonpsy/2ea302bf40bf8fdd1e154e813b06ea11 to your computer and use it in GitHub Desktop.
Highlighting the issue #840 , tof provided by the user ( 2 hr or 7200.0 secs ) exceeds the upper bound tof( 1989.6321243010739 secs ) for the given r0,rf.
from poliastro.iod.vallado import lambert as vallado
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
numiter = 10**3
rtol = 1e-6
print("\nLong\n")
v_long = vallado(k, r0, rf, tof, short=False, numiter=numiter, rtol=rtol)
print(next(v_long))
print("\nShort\n")
v_short = vallado(k, r0, rf, tof, short=True, numiter=numiter, rtol=rtol)
print(next(v_short))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment