Skip to content

Instantly share code, notes, and snippets.

@ChrisAndre
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChrisAndre/42bd5682b282cea27b30 to your computer and use it in GitHub Desktop.
Save ChrisAndre/42bd5682b282cea27b30 to your computer and use it in GitHub Desktop.
Lambert Exposin Test
import PyKEP as pk
import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
r1 = [149.0e9, 0.0, 0.0]
r2 = [300.0e9, -100.0e9, 0.0]
mu = 1.32e20
tof = 86400 * 550.0
lw = True
isp = 5000
mass = 4000
prob = pk.lambert_exposin(r1,r2,tof,mu,lw)
print prob
exp1 = prob.get_exposins()[0]
print 'Final mass: %.1f kg' % exp1.get_final_mass(mu, isp, mass)
print 'Maximum thrust needed: %.3f N' % exp1.get_maximum_thrust(mu, isp, mass)
fig = plt.figure()
axis = fig.gca(projection='3d')
axis.scatter([0],[0],[0],color='y')
axis.scatter([r1[0]],[r1[1]],[r1[2]],color='b')
axis.scatter([r2[0]],[r2[1]],[r2[2]],color='b')
pk.orbit_plots.plot_lambert_exposin(prob,axis,sol=0)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment