Here we'll solve for the motion of a rocket.
The shell of the rocket has a mass and it contains fluid with mass .
The mass of the fluid in the rocket as a function of time follows the functional form:
The mass flow rate of fuel from the rocket due to combustion, , is
The velocity of the rocket exhaust, , follows the form
We want to find the velocity and altitude of the rocket in the instant when the fuel is exhausted given the following constants:
Constant | Value |
---|---|
From a momentum balance, we know that
where , , and are the instantaneous acceleration, velocity, and position of the rocket and is the total mass of the rocket ().
Note that , , and are functions of time; to solve this numerically, we will use standard ordinary differential equation methods. Most commonly, these methods take some set of equations and initial values and integrate them forward over time.
First, we input our constants and equations governing the system:
To put these into a form usable by ODE solvers, we will let our vector of values
then our derivative vector
To pass these into an equation for the integration method we use, we supply . Note that in matlab, the ode45 function takes .
We should also find the time it takes for the tank to be emptied by solving the second-order polynomial for when
Now we can integrate this using odeint
to get as follows:
Finally, we can plot the time evolution of and as follows: