Question: Problem 3 : A model rocket ( with mass m = 1 0 kg ) initially at rest on the ground ( Zo = 0

Problem 3: A model rocket (with mass m =10 kg) initially at rest on the ground (Zo
=0) is launched upward. The motion of the rocket is described by the following differential
equations:
dw
dt =g + T h
m ,(2)
dz
dt = w,
where t is time, z is altitude, w is velocity, and T h is the upward thrust due to the propulsion
of the rocket and g is gravity. In this exercise, the upward thrust Th varies with time as
follows:
T h(t)=670N f or 0<= t <2(s),
T h(t)=1366.5N f or 2<= t <4(s),
T h(t)=0N f or t >=4(s),
and the gravity g varies with altitude z as follows:
g(z)=9.81
1
z
10000
3
(m/s2) f or 0<= z <10,000(m),
g =0(m/s2) f or z >=10,000(m),
Using Euler-Cromer method, the differential equations can be approximated by
Wn+1= Wn +
gn + T hn
m
t,
Zn+1= Zn + Wn+1t,
where t is the time step and capital letters are used to denote approximated quantities.
In this exercise, you will create a file rocket.m to include 3 functions. The primary
function should be named rocket and two subfunctions should be named gravity and
thrust.
The rocket function solves the governing equations for the projectile motion of the rocket.
It should have the following header: function [T, Z, W]= rocket( Tf, dt) where the
input Tf is the duration of the flight of the rocket and dt is the time step. The output
vectors T, Z and W are the time, altitude and velocity of the rocket, respectively.
The thrust subfunction computes the thrust at a given time during the flight. It should
have the following header: function [Th]= thrust(t) where the input t is the time and
the output Th is the upward thrust given above. Both input and output are single numbers.
The gravity subfunction computes the value of gravity at a given time during the flight.
It should have the following header: function [g]= gravity(z) where the input z is the
altitude of the rocket and the output g is the altitude-dependent gravity given above. Both
input and output are single numbers.
Give all functions a description.
(a) Set p3a = evalc('help rocket').
(b) Set p3b = evalc('help gravity').
(c) Set p3c = evalc('help thrust').
(d) Set p3d = evalc('help rocket>gravity').
(e) Set p3e = evalc('help rocket>thrust').
(f,g) Compute the altitude and velocity of the rocket at 120 s using t =0.1s. Put the
answers in p3f and p3g, respectively. The answers should be single numbers, not vectors.
(h) Create figure 2. Use function subplot to include 2 panels with one on top of the
other. The top panel shows how the altitude of the rocket changes with time during the
120-second flight. The bottom panel shows velocity versus time. Set p3h = 'See figure 2'.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!