time.sleep(1) print('blastoff') if not test_run: ut0 = ut() time0 = time.time() vessel.control.activate_next_stage() stage = 1 from beluga.ivpsol import Trajectory gamma = Trajectory() gamma.t = np.array([ut()-ut0]) gamma.y = np.array([[altitude(), speed(), vessel.mass]]) gamma.u = np.array([[anglefun(0)]]) D = np.array([drag()]) T = np.array([vessel.thrust]) P = np.array([pitch()]) """ Main Running Loop """ while (ut() - ut0) < tf: vessel.auto_pilot.target_pitch_and_heading(float(anglefun(ut()-ut0)), 90) gamma.t = np.hstack((gamma.t, np.array([ut()-ut0]))) gamma.y = np.vstack((gamma.y, np.array([[altitude(), speed(), vessel.mass]]))) gamma.u = np.vstack((gamma.u, anglefun(ut()-ut0))) D = np.vstack((D, np.array(drag()))) T = np.vstack((T, np.array(vessel.thrust))) P = np.hstack((P, pitch()))
countdown -= 1 time.sleep(1) print('blastoff') if not test_run: ut0 = ut() time0 = time.time() vessel.control.activate_next_stage() from beluga.ivpsol import Trajectory gamma = Trajectory() gamma.t = np.array([ut() - ut0]) gamma.y = np.array([[altitude(), speed(), vessel.mass]]) gamma.u = np.array([[thrustfun(0)]]) D = np.array([drag()]) T = np.array([vessel.thrust]) while (ut() - ut0) < tf / 3: vessel.control.throttle = float(thrustfun(ut() - ut0)) gamma.t = np.hstack((gamma.t, np.array([ut() - ut0]))) gamma.y = np.vstack( (gamma.y, np.array([[altitude(), speed(), vessel.mass]]))) gamma.u = np.vstack((gamma.u, thrustfun(ut() - ut0))) D = np.vstack((D, np.array(drag()))) T = np.vstack((T, np.array(vessel.thrust))) time.sleep(0.1) print('mission complete boss')