Problem 3 Solve the falling parachutist problem from Example 1.1 in your book 3
ID: 668195 • Letter: P
Question
Problem 3 Solve the falling parachutist problem from Example 1.1 in your book 3 ways: a) Write the entire code in a single program b) Use another M file c) Use a function file In the results document just provide the plot Hint: Refer to Section 2.5 in your book or the function example in the Lecture 1 folder. For those of you who do not have your book yet here is the problem statement: A parachutist of mass 68.1 kg jumps out of a stationary hot air balloon. The drag coefficient, c, is 12.5 kg. Compute the velocity prior to opening the chute using the equation below. v(t) = mg/c( 1 - e^-c/mt)Explanation / Answer
Solution for Part 1:
m = 68.1;
g = 9.81;
c = 12.5;
t = [0 1 2 3 4 5 6 7 8 9];
v = ( (m*g) / c) * ( 1 - exp( -(c * t) / m) );
plot(t, v), xlabel('time(s)'), ylabel('velocity'), title('velocity graph');
Solution for part 2 :
Go to File (or Home in newer Matlab versions) - > New - > Script (or M file)
A new file will be opened.
1. Copy the entire code given in part 1 into the file.
2. Save the file with a name, lets say testfile.m
3. to run the .m file, just type testfile in matlab console.
4. Done, plot will be displayed in a figure.
Solution for part 3 :
Step 1 : Save the below code in a file and name it same as your function name. (in my case, it will be func_velo.m).
function [v] = func_velo(m, c, t);
% Matlab implementation of velocity function
%
%
% input: m : Mass
% c : drag coefficient
% t : time
%
%
% output: v : velocity
%
%
m = 68.1;
g = 9.81;
c = 12.5;
v = ( (m*g) / c) * ( 1 - exp( -(c * t) / m) );
Step 2 :
m = 68.1;
c = 12.5;
take variable t.
t = [0 1 2 3 4 5 6 7 8 9]; or t = [0 : 1 : 10]; where 0 is starting number, 1 is step size and 10 is maximum size.
then call the function
[v] = func_velo(m,c,t);
and finally
plot(t, v), xlabel('time(s)'), ylabel('velocity'), title('velocity graph');
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.