Created
July 15, 2019 08:35
-
-
Save jorgepiloto/76579262d741ce1b4d88d55f6c912d09 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
from astropy import units as u | |
from astropy.time import Time | |
from poliastro.bodies import Earth, Mars | |
from poliastro.maneuver import Maneuver | |
from poliastro.plotting.static import StaticOrbitPlotter | |
from poliastro.twobody import Orbit | |
# Departure and time of flight for the mission | |
EPOCH_DPT = Time("2018-12-01") | |
EPOCH_ARR = EPOCH_DPT + 2 * u.year | |
# Origin and target orbits | |
ss_earth = Orbit.from_body_ephem(Earth, epoch=EPOCH_DPT) | |
ss_mars = Orbit.from_body_ephem(Mars, epoch=EPOCH_ARR) | |
man = Maneuver.lambert(ss_earth, ss_mars, short=False, M=1) | |
ss_trans, ss_target = ss_earth.apply_maneuver(man, intermediate=True) | |
op = StaticOrbitPlotter() | |
op.plot(ss_earth, label="Earth", color="navy") | |
op.plot(ss_mars, label="Mars", color="darkred") | |
op.plot(ss_trans, label="Long transfer", color="green") | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment