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

3 views (last 30 days)
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 Comment
Stephan
Stephan on 11 Nov 2018
Edited: Stephan on 11 Nov 2018
Please provide the code you have tried not pictures of code. Mark pasted code and use the
{Code}
Button

Sign in to comment.

Answers (1)

Torsten
Torsten on 12 Nov 2018
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.

Products

Community Treasure Hunt

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

Start Hunting!