# -*- coding: utf-8 -*- """ Template for the main solution code in Part 7 of the project. The objective of the template files is to give you an idea of the most important functions that you have to implement, what input they will need and what output they should produce. To make things work in practice you will have to add more functionalities than the ones outlined, and you might have to adapt the interfaces to fit your specific approach. You are of course free (and encouraged) to structure the code in any way you want! """ import ast2000tools.constants as const import ast2000tools.utils as utils from ast2000tools.space_mission import SpaceMission import part_6 def compute_drag_force(system, planet_idx, mean_molecular_mass, lander_position, lander_velocity, cross_sectional_area): """ Here you can implement the drag force function for challenge A of Part 7 of the project. """ # Insert awesome code here... # You will need the following method: # part_6.compute_atmospheric_profiles # You will probably also need these quantities: # const.pi # const.day # system.radii # system.rotational_periods return drag_force def run_landing_planning_simulation(mission, planet_idx, mean_molecular_mass, initial_time, initial_position, initial_velocity, duration, time_of_lander_launch, lander_launch_delta_v, parachute_area, parachute_deployment_height, thruster_force, thruster_activation_height): """ Here you can implement the landing planning simulation for challenge B of Part 7 of the project. """ # Insert awesome code here... # You will probably also need these quantities: # const.G # const.m_sun # system.masses # system.radii # mission.spacecraft_mass # mission.spacecraft_area # mission.lander_mass # mission.lander_area # You might want to generate some plots to inspect the results. def land_spacecraft(landing_sequence, duration, time_of_lander_launch, lander_launch_delta_v, parachute_area, parachute_deployment_height, thruster_force, thruster_activation_height): """ Here you can implement the commanding of the spacecraft for challenge C of Part 7 of the project. """ # Insert awesome code here... # You might want to generate some cool videos and pictures # to view in MCAst. # Prevent the following code from executing when calling `import part_7` if __name__ == '__main__': # Print a message if a newer version of ast2000tools is available utils.check_for_newer_version() # Load the mission instance saved after completing Part 6 mission = SpaceMission.load('mission_after_part_6.pickle') # Obtain the ongoing landing sequence landing_sequence = mission.ongoing_landing_sequence # Obtain the initial conditions for the landing simulation initial_time, initial_position, initial_velocity = landing_sequence.orient() # Run planning simulations to determine landing parameters here... # Land the lander safely on the surface of the planet land_spacecraft(landing_sequence, duration, time_of_lander_launch, lander_launch_delta_v, parachute_area, parachute_deployment_height, thruster_force, thruster_activation_height)