I'm currently trying to make a script in MatLab that, given the acceleration formula, returns the velocity and displacement over time.
I have the following:
$\frac{dv}{dt} = g - C * |v| * v -max(0, K(y - L))$
where:
$H = 74m, D = 31m, C = 0.9/m, m = 80kg, L = 25m, K = 90/m, g = 9.8m/s^2$
The question is in relation to a bungee jump model. L refers to the length of the rope, y is the displacement from the platform, where y = 0 = the platform, and it increases when falling. K is the spring constant of the rope, and C is the drag.
How do I utilise Runge Kutta to determine the velocity and displacement from the above acceleration formula?
You have to convert this second order equation into a first order system
Then call any ODE solver like ode45, or ode4 from this tutorial for the classical RK4 method.
or