Instruction
NUMBER 1; Write a small matlab program to compute the maximum height when
the rocket is fired straight up. Assume no wind.
In order to get reasonable consistency of answers, use dt = 0.1 second
. thrust= [0.0,6.0,14.0,5.3,4.9,4.2,4.2,4.5,4.5,4.6,4.5,4.5,4.5,4.5,4.6,4.6,4.5,4.5,0.0,0.0];
time= [0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0];
Estes Alpha III
Length 12.25 inches = 0.311 meters
Diameter 0.95 inches = 0.0241 meters
Body area 0.785 square inches = 0.506E-3 square meters cross section
Cd of body 0.45 dimensionless
Fins area 7.69 square inches = 0.00496 square meters total for 3 fins
Cd of fins 0.01 dimensionless
Weight/mass 1.2 ounce = 0.0340 kilogram without engine
Engine 0.85 ounce = 0.0242 kilogram initial engine mass
Engine 0.33 ounce = 0.0094 kilogram final engine mass
Thrust curve
Total impulse 8.82 newton seconds (area under curve)
Peak thrust 14.09 newton
Average thrust 4.74 newton
Burn time 1.86 second
Initial conditions:
t = 0 time
s = 0 height
v = 0 velocity
a = 0 acceleration
F = 0 total force not including gravity
m = 0.0340 + 0.0242 mass
Basic physics:
Fd = Cd*Rho*A*v^2 /2 two equations, body and fins
Fd is force of drag in newtons in opposite direction of velocity
Cd is coefficient of drag, dimensionless (depends on shape)
Rho is density of air, use 1.293 kilograms per meter cubed
A is total surface area in square meters
v is velocity in meters per second (v^2 is velocity squared)
Fg = m*g Fg is force of gravity toward center of Earth
m is mass in kilograms
g is acceleration due to gravity, 9.80665 meters per second squared
Ft = value from thrust curve at this time, you enter this data.
Do not copy! This is part of modeling and simulation.
start with first non zero thrust.
F = Ft - (Fd body + Fd fins + Fg) resolve forces
a = F/m a is acceleration we will compute from knowing
F, total force in newtons and
m is mass in kilograms of body plus engine mass that changes
dv = a*dt dv is velocity change in meters per second in time dt
a is acceleration in meters per second squared
dt is delta time in seconds
v = v+dv v is new velocity after the dt time step
(v is positive upward, stop when v goes negative)
v+ is previous velocity prior to the dt time step
dv is velocity change in meters per second in time dt
ds = v*dt ds is distance in meters moved in time dt
v is velocity in meters per second
dt is delta time in seconds
s = s+ds s is new position after the dt time step
s+ is previous position prior to the dt time step
ds is distance in meters moved in time dt
m = m -0.0001644*Ft apply each time step
t = t + dt time advances
print t, s, v, a, m
if v < 0 quit, else loop
Ft is zero at and beyond 1.9 seconds, rocket speed decreases
Published data estimates a height of 1100 feet, 335 meters to
1150 feet, 350 meters.
Your height will vary.
Your homework is to write a program that prints every 0.1 seconds:
the time in seconds
height in meters
velocity in meters per second
acceleration in meters per second squared
force in newtons
mass in kilograms (just numbers, all on one line)
and stop when the maximum height is reached.
NUMBER 2:
In a MATLAB, write a program that
does a least square fit of the thrust data used in NUMBER 1.
Use your data x = 0.0 0.1 0.2 ... 1.9
y = 0.0 6.0 14.1 ... 0.0
Be sure time 0.0 has value 0.0, time 1.9 has value 0.0
Do the least square fit with 3, 4, ... , 17 degree polynomials.
Compute the maximum error, the average error and RMS error
for each fit. If convenient, look at the plots of your fit
and compare to the input.
Print out your data. Remove excess printout, print:
Print out your polynomial order for each degree 3..17 and
print out maximum, average and RMS error for each.