Bungee Jump Position Plotting

Hello, I am trying to make a program that models the position of a bungee jumper that starts at 90m with the rope hanging at 100m, the jumper needes to reach equilibrium at the end of the rope from 25 to 45 seconds. My intention was to change the damping ratio and natural frequency until I found a spring constant and damping constant that would fulfil the requirements. I was able to get the solution plotted for the SDOF case if it was to be damped the entire time. However, as the cord is shorter than the length of the rope, or when the jumper is above equilibrium, there will be no force applied by the cord. I'm trying to incorporate this into a while loop that will have the natural frequency and damping ratio change with regard to the position with respect to L, but I am getting an error "Conversion to logical from sym is not possible". Any help would be greatly appreciated! Thank you.
clc
clear all
m = 100
zeta = .5
wn = .23
wf = wn*sqrt(1-zeta^2)
k = (wn^2)*m
c = 2*zeta*wn*m
L = 45
syms x(t)
xdotdot = diff(x,t,2)
xdot = diff(x,t,1)
cond = [x(0) == 90, xdot(0) == 0]
while t < 50
sol = dsolve(xdotdot + wn*xdot + zeta*x, cond)
if sol > L
wn == 0
zeta == 0
if sol < L
wn == wn
zeta == zeta
end
end
end
ezplot(sol)

2 Comments

Since there are 2 values for wn and zeta, we can have two solutions: sol(t) and sol2(t). We can have variable ‘y’ which represents output.
syms x(t)
xdotdot = diff(x,t,2)
xdot = diff(x,t,1)
cond = [x(0) == 90, xdot(0) == 0]
y = [];
sol(t) = dsolve(xdotdot + wn*xdot + zeta*x, cond);
sol2(t) = dsolve(xdotdot, cond); % wn and zeta are zero
for t = 0:0.1:100
if sol(t) > L
y = [y sol2(t)];
else
y = [y sol(t)];
end
end
plot(0:0.1:100, y);
The answer obtained is similar to the one if we considered only the 1st solution.
sol = dsolve(xdotdot + wn*xdot + zeta*x, cond);
ezplot(sol, 0:100);
You have the physics description wrong. The force from the chord will not be zero when the jumper is above the equilibrium position. The force will be zero when the jumper is above the length of the chord without the extra weight from the jumper. Your code was not commented enough for me to try to interpret what it models, so you might have the physics right there.

Sign in to comment.

Answers (0)

Categories

Find more on Mathematics in Help Center and File Exchange

Products

Release

R2022b

Asked:

on 18 Dec 2022

Commented:

on 20 Dec 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!