def circularization_phase(body, angle, thrust): simulation = ThrustSimulation( body, thrust / PROPELLANT_SPECIFIC_VELOCITY, f_gravity + f_drag + (lambda b: f_thrust(b, angle, thrust))) simulation.run( 300, dt=DELTA_T, condition=lambda b: abs(b.radial_speed) < 1) return simulation
def launch_phase(body, angle, thrust): simulation = ThrustSimulation( body, thrust / PROPELLANT_SPECIFIC_VELOCITY, f_gravity + f_drag + (lambda b: f_thrust(b, angle, thrust))) simulation.run( 300, dt=DELTA_T, condition=lambda b: b.radius > 1000 + MARS_RADIUS) return simulation
def phase_2(body, thrust_y, h_3=0): body.area = pi * 2.25 ** 2 body.c_drag = 2.8 body.r_nose = 16.7 simulation = ThrustSimulation( body, abs(thrust_y / c), f_gravity + f_drag + (lambda b: b.position.unit * thrust_y)) r_3 = radius_mars + h_3 simulation.run(1000, small_delta_t, condition=lambda b: b.radius <= r_3) return simulation
def phase_1(body, thrust_x, h_2=400): body.area = pi * 2.25 ** 2 body.c_drag = 2.8 body.r_nose = 16.7 simulation = ThrustSimulation( body, thrust_x / c, f_gravity + f_drag + (lambda b: - b.direction * thrust_x)) r_2 = radius_mars + h_2 simulation.run(3000, small_delta_t, condition=lambda b: b.radius <= r_2) if simulation is not None: body.mass -= simulation.engine_mass return simulation