I am having trouble writing a ODE45 function for this bungee jumping problem.

Having trouble with this ode45 function. How do I get the second order of this.
{code}
function [uprime] = ODE4550kg(t,u )
% Set known variables
uprime =[0;0];
m = 50;
g = 9.81;
W= m*g;
c= W/55^2;
D= c.*(u(1)).^2; %(u(1)) represents x prime
B= 100*(u(2)-8); % (u(2)) represents x
R= 3.*(u(1));
if u(2) >= 0 && u(2) <= 8
uprime(1) = (W-D)/m;
uprime(2) = u(1);
else
uprime(1) = (W-D-B-R)/m;
uprime(2) = u(1);
end

1 Commento

Please provide the code you have tried not pictures of code. Mark pasted code and use the
{Code}
Button

Accedi per commentare.

Risposte (1)

Take a look at the ballode example:
https://www.mathworks.com/examples/matlab/mw/matlab-ex84325677-simple-event-location-a-bouncing-ball
Best wishes
Torsten.

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by