Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Liftoff Calculator v1.0.
- print("Gregrox's Liftoff Calculator v1.0. New Year's Day Edition.")
- print("Thanks to Nyrath and his Atomic Rockets website.")
- Mass = float(input("Mass of the planet in Earth masses: ")) * 5.9721986e24
- Radius = float(input("Radius of the planet in kilometers: ")) * 1000
- Atmosphere = float(input("Atmospheric Pressure in atmospheres: "))
- AtmosphereHeight = float(input("Atmosphere Height in kilometers (Earth = 100): ")) * 1000
- AtmosphericDensity = float(input("Atmospheric Density Multiplier (default = 1): "))
- Acceleration = float(input("Acceleration of spacecraft in Gees: ")) * 9.81
- BigG = 6.673e-11
- DeltaV_Liftoff = ((BigG * Mass) / (Radius))**0.5
- Gravity = ((Mass/5.9721986e24) / ((Radius/6371000)**2))
- Liftoff_Duration = DeltaV_Liftoff / Acceleration
- DeltaV_GravityDrag = Gravity * Liftoff_Duration
- DeltaV_AtmosphereDrag = 700 * Atmosphere * AtmosphericDensity * (AtmosphereHeight/100000)
- DeltaV_Total = DeltaV_Liftoff + DeltaV_GravityDrag + DeltaV_AtmosphereDrag
- print("Delta V to orbit is approximately ",round(DeltaV_Total,4),"m/s")
- DontStopCommandLine = input(".")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement