








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Class: Intro to Aerospace Engineering; Subject: Aerospace Engineering; University: University of Illinois - Urbana-Champaign; Term: Spring 2008;
Typology: Assignments
1 / 14
This page cannot be seen from the preview
Don't miss anything!









Topics Covered
Matlab Logic
if (Condition)
commands
else
commands
end
while (condition)
commands
End
for (i=start:finish)
commands
end
If Statements are useful for running different parts of your code under different situations
Useful for looping your code until a certain condition is met
Useful for running the came code with an index that increases; continues looping until the index reaches a predetermined length
Example: Cart
0
0
2
d
We have a cart that starts on the line at distance = 0. It has a constant acceleration of 2 m/s^2, and an initial velocity of 0. How far will it have travelled by the time the velocity is at least 100m/s, and how long will that take?
Standard Atmosphere
256
04
29
04 0. 00649
T P
T h
P e h
T
65 1.^730.^000157
68
388
6
488
93 0. 00299
T P
T h
Kg K
J R
P RT
Standard Atmosphere: Function Example
function p = standard_atmosphere_pressure(h)
%This function takes in height in meters and returns
if h<
T=288.04-0.00649h; %deg K p=101.29(T/288.08)^(5.256); %kPa
elseif h >=11000 & h<
T=216.68; %deg K p=22.65exp(1.73-0.000157h); %kPa
elseif h>=
T=141.93+0.00299h; %deg K p=2.488((T/216.6)^(-11.388)); %kPa
end
end
Parachutes: Air Drag
g m
F a
m
F a
F ma
F c A v
Note: This is assuming that ‘up’ is positive acceleration!
Putting it Together: Matlab Programming
Homework
You are given an m-file script and some pre-made functions. The code calculates the rise in altitude of the balloon up until it bursts. You need to program in the descent by parachute and graph the results.
The code assumes a constant ascent velocity instead of worrying about all the issues about balloon volume changes.You are given assumptions of balloon mass, payload mass, external pressure at which the balloon will pop, size of the parachute, drag of the parachute.
Assignment:
Bonus: Modify one of the two standard atmosphere functions such that it outputs both values you need, and remove the other from your program.
More Code Snippets
while (Altitude > 0) % update time CurrentTime=CurrentTime+TimeStep;
%Calculate External Air Properties
%Calculate Drag
% update velocity, Acceleration and Altitude (with and without drag) Acceleration = VelocityDescent = Altitude=
% store new values for future display
end
My Graphs