I am having trouble writing a ODE45 function for this bungee jumping problem.
3 views (last 30 days)
Show older comments
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
Answers (1)
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.
0 Comments
See Also
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!