Question 2 (MATLAB exercise - due at the end of tutorial) A bungee jumper with a
ID: 2259416 • Letter: Q
Question
Question 2 (MATLAB exercise - due at the end of tutorial) A bungee jumper with a mass of 68.1 kg leaps from a stationary hot air balloon. Compute the velocity of the jumper for the first 60 seconds of free fall (from t-0 to 60 seconds). Use a drag coefficient (Cd) of 0.25kg/m. Employ a step size of 0.1 sec for the calculation. where v-is velocity of the jumper (m/s), t-time (sec), g gravity (m/s), and Cd-the drag coefficient (kg/m) and m-mass (kg) Using the Euler's method, the solution to this problem can be approximated as Write a function based on the "for" loop structure to implement the Euler's method algorithm and solve the above problem. HINT * Write a function that has three inputs: "dt"(step size),"Ti"(start time), "Tf"(end time), and "Vi"(initial velocity) Cd, m and g are assumed to be constant and can be defined in the function * function name(input) %add comments add constants Use a for loop to compute the jumper velocity * o Determine the number of iterations Initialize o for...end * Use plot function to plot your results (velocity (y axis) and time (x axis)). Label your plots accordingly. NOTE: Test your function using function inputs: dt-0.5 seconds, Ti-0 seconds, Tf-60seconds and Vi-0 m/sExplanation / Answer
function [] = bungee_jump(dt,Ti,Tf,Vi)
Cd = 0.25; %initialising the constants
m=68.1;
g=10;
n= ((Tf-Ti)/dt); %n-number of iterations necessary
T=zeros(1,n); %T-making arrays of n size for time, Vf-velocity
Vf=zeros(1,n); %this will later be used for plotting the graph
for i= 1:n
T(i)=i*dt;
Vf(i) = Vi + (g-(Cd/m)*(Vi^2))*dt; %euler algorithm
Vi=Vf(i); %updating Vi value for next iteration
end
plot(T,Vf) %plotting
end
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.