#!/usr/bin/env python # coding: utf-8 # # Utilities module usage # In[ ]: from rocketpy.utilities import ( calculate_equilibrium_altitude, compute_cd_s_from_drop_test, ) # In[ ]: get_ipython().run_line_magic('matplotlib', 'widget') # ### 1. Estimations for your cd_s # In[ ]: compute_cd_s_from_drop_test( terminal_velocity=10, # The desired terminal velocity (m/s) rocket_mass=20, # kg air_density=1.225, g=9.80665, ) # ### 2. Altitude of Terminal Velocity being reached # In[ ]: a, b, c = calculate_equilibrium_altitude( rocket_mass=20, cd_s=5, z0=1000, v0=-20, env=None, eps=1e-3, max_step=0.1, see_graphs=True, g=9.80665, estimated_final_time=10, ) altitude_function, velocity_function, final_sol = a, b, c # In[ ]: final_sol # In[ ]: print( f"The terminal velocity of {final_sol['velocity']:.3} m/s is reached after {final_sol['time']:.3} seconds at altitude of {final_sol['altitude']:.6} meters." )