# Problem 3: Rocket Recursion
from math import exp
# STAGE 1: surface to LEO = 9.4 km/s
# STAGE 2: LEO to moon capture = 3.26 km/s
# STAGE 3: moon capture to surface = 2.41 km/s
# Initialize the stages data
# A list containing multiple dictionaries
stages = xxxxxxxxxxxx
# WHERE
# d_v = delta velocity
# v_e = exhaust velocity
# sdm = dry mass of that specific stage
def wet_mass(stages):
"""Recursive solution for finding the wet mass
of a series of stages
Input: list of dictionaries with defined values:
Example:
stages = [{'d_v': 9.4, 'v_e': 2.3, 'sdm': 16000},
{'d_v': 3.26, 'v_e': 2.3, 'sdm': 8000},
{'d_v': 2.41, 'v_e': 2.3, 'sdm': 4500}]
"""
# if there are no more stages, return 0
if xxxxxxxxxxxxx
# otherwise, return the wet mass, and calculate
# the next stage
else:
# index the first dictionary in the list
xxxxxxxxx
xxxxxxxxx
# m_o = m_f * exp(d_v/v_e)
return xxxxxxxxxxxxxxxxxxxxx
# our above return statement indexes and passes the
# rest of our dictionaries in the list
# for the next recursion.
# Find the initial wet launch mass needed and print it.
launch_mass = xxxxxxxxxxxxxxxxxxx
print(xxxxxxxxx)