Advertisement
GregroxMun

Liftoff Calculator Python

Mar 12th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. #Liftoff Calculator v1.0.
  2.  
  3.  
  4. print("Gregrox's Liftoff Calculator v1.0. New Year's Day Edition.")
  5. print("Thanks to Nyrath and his Atomic Rockets website.")
  6.  
  7. Mass = float(input("Mass of the planet in Earth masses: ")) * 5.9721986e24
  8. Radius = float(input("Radius of the planet in kilometers: ")) * 1000
  9. Atmosphere = float(input("Atmospheric Pressure in atmospheres: "))
  10. AtmosphereHeight = float(input("Atmosphere Height in kilometers (Earth = 100): ")) * 1000
  11. AtmosphericDensity = float(input("Atmospheric Density Multiplier (default = 1): "))
  12. Acceleration = float(input("Acceleration of spacecraft in Gees: ")) * 9.81
  13.  
  14. BigG = 6.673e-11
  15.  
  16. DeltaV_Liftoff = ((BigG * Mass) / (Radius))**0.5
  17.  
  18. Gravity = ((Mass/5.9721986e24) / ((Radius/6371000)**2))
  19.  
  20. Liftoff_Duration = DeltaV_Liftoff / Acceleration
  21.  
  22. DeltaV_GravityDrag = Gravity * Liftoff_Duration
  23.  
  24. DeltaV_AtmosphereDrag = 700 * Atmosphere * AtmosphericDensity * (AtmosphereHeight/100000)
  25.  
  26. DeltaV_Total = DeltaV_Liftoff + DeltaV_GravityDrag + DeltaV_AtmosphereDrag
  27.  
  28. print("Delta V to orbit is approximately ",round(DeltaV_Total,4),"m/s")
  29.  
  30. DontStopCommandLine = input(".")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement