Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Compute the values of bungee jumper velocity at givens times in MATLAB. Compute

ID: 3278935 • Letter: C

Question

Compute the values of bungee jumper velocity at givens times in MATLAB. Compute the velocity of a free-falling parachutist using Euler’s method for the case where m=80 kg and c_d=0.25 kg/m. Perform the calculation from t=0 to 20 sec with a step size of 1 sec. Use an initial condition that the parachutist has an upward velocity of 20 m/s at t=0. At t =10 sec, assume that the chute is instantaneously deployed so that the drag coefficient jumps to 1.5 kg/m [at 10 seconds].

CODE:

function v = Chapra_Problem_1p7(x,p,g)
% Usage: v = Chapra_Problem_1p7(x,p,g)
%
% Compute velocity of falling mass using Euler's method.
%
%% Input
% x: independent variables, vector of time values and initial velocity
% [dt; t0; t1; tf; v0]
% p: parameters, vector [m, c_d0, c_d1]
% g: gravitational constant for right-hand-side gravity force (scalar)
%
%% Output
% v: velocity vector (downward speeds at each time)

%% Parse input variables
dt = x(1); % time increment, delta-t
t0 = x(2); % initial time
t1 = x(3); % time when parachute deploys
tf = x(4); % final time
v0 = x(5); % initial velocity at time t=t0
m = p(1); % jumper's mass
c_d0 = p(2); % drag coefficient for jumper alone
c_d1 = p(3); % drag coefficient for jumper with parachute

%% Insert your code here.

T=t0:dt:tf;
for i=1:(length(T)-1)
v(i+t) = v(t)+(g-(cd/m)*(v*abs(v)))*t (this is the equation we are suppose to use)
end

Do I need an if loop for when the parachute deploys to take account of the drag at the time?

I'm not sure how to check for change c_d after t is greater than 10.

I get error messages saying that there is an 'Error using plot', and 'vectors must be the same length' and that the vectors are the wrong size, so I must be doing something wrong when a variable is assined a value.

Explanation / Answer

%% Parse input variables
dt = x(1); % time increment, delta-t
t0 = x(2); % initial time
t1 = x(3); % time when parachute deploys
tf = x(4); % final time
v0 = x(5); % initial velocity at time t=t0
m = p(1); % jumper's mass
c_d0 = p(2); % drag coefficient for jumper alone
c_d1 = p(3); % drag coefficient for jumper with parachute

T=t0:dt:tf

for i=1:(length(T)-1)

if i<=10

v(i+t) = v(i)+(g-(c_d0/m)*(v*abs(v)))*t

else

v(i+t) = v(i)+(g-(c_d1/m)*(v*abs(v)))*t

end

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote