The equations of motion for a rocket in purely vertical flight are given by
\begin{align} \frac{dh}{dt} &= v\\ (m_s+m_p) \frac{dv}{dt}& = -(m_s+m_p)g + \dot{m}_pv_e - \frac{1}{2}\rho v|v|AC_D \end{align}$h$ is the altitude of the rocket
$m_s = 50kg$ is the weight of the rocket shell
$g = 9.81 \frac{m}{s^2}$
$\rho = 1.091 \frac{kg}{m^3}$ is the average air density (assumed constant throughout flight)
$A = \pi r^2$ is the maximum cross sectional area of the rocket, where $r = 0.5 m$
$v_e = 325 \frac{m}{s}$ is the exhaust speed
$C_D = 0.15 $ is the drag coefficient
$m_{po} = 100 kg$ at time $t = 0$ is the initial weight of the rocket propellant
The mass of the remaining propellant is given by:
$$m_p = m_{po} - \int^t_0 \dot{m}_p d\tau$$where $\dot{m}_p$ is the time-varying burn rate given by the following figure:
Propellant Burn Rate
Using Euler's method with a timestep of $\Delta t=0.1s$, create a Python script to calculate the altitude and velocity of the rocket from launch until crash down.
To check your answers, you can register for MAE 6286: Practical Numerical Methods with Python.
At time $t=3.2s$, what is the mass (in kg) of rocket propellant remaining in the rocket?
What is the maximum speed of the rocket in $\frac{m}{s}$? At what time does this occur (in seconds)? What is the altitude at this time (in meters)?
What is the rocket's maximum altitude during flight (in meters)? At what time (in seconds) does this occur?
At what time (in seconds) does the rocket impact the ground? What is the velocity of the rocket (in $\frac{m}{s}$) at time of impact?
In case you are kind of confused about the rocket equations, here we show how to get to them.
Newton's second law states that the acceleration of the vehicle times its mass is equal to all the forces acting on it. Therefore,
\begin{equation} (m_s + m_p)\frac{d\bf{v}}{dt}=\sum {\bf F}. \end{equation}In the above formula we have assumed that the propellant inside the rocket and the rocket move at the same velocity (in other words, their relative velocity is negligible).
Two of the external forces acting on the rocket are,
\begin{align} {\bf F}_g&= (m_s+m_p)\bf{g} \quad (\rm{Gravity}),\\ {\bf F}_d&= - \frac{1}{2} \rho_a \mathbf{v} |\mathbf{v}| A C_D \quad (\rm{Drag}). \end{align}We also need to consider the force resulting from the ejection of the propellant. During an interval $dt$, the engine of the rocket ejects downwards a mass of propellant given by $\dot m_p dt$. Relative to the rocket, the speed of the ejected burning gas is assumed constant and equal to $v_e$ (the exhaust speed). The momentum variation induced on the exhaust gas by the engine during that interval is therefore, $d{\bf p}_{gas} = \dot m_p {\bf v}_e dt$. Again using Newton's second law we conclude that the force applied by the rocket on the gas is,
\begin{align} {\bf F}_{rocket\rightarrow gas} = \frac{d{\bf p}_{gas}}{dt} = \dot m_p {\bf v}_e \end{align}Using Newton's third law (|action| = |reaction|), the force exerted by the exhaust gas on the rocket is then,
\begin{align} {\bf F}_{gas\rightarrow rocket} = -{\bf F}_{rocket\rightarrow gas} = -\dot m_p {\bf v}_e \end{align}If we collect all the forces acting on the rocket we finally have:
\begin{align} (m_s + m_p)\frac{d\bf{v}}{dt}=(m_s+m_p){\bf g}- \frac{1}{2} \rho_a \mathbf{v} |v| A C_D -\dot m_p {\bf v}_e \end{align}
In [1]:
from IPython.core.display import HTML
css_file = '../../styles/numericalmoocstyle.css'
HTML(open(css_file, "r").read())
Out[1]:
In [ ]: