Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function dxdt = bot_susp_1d(t, xin, m, k, c, tspan, ground, groundp)
- %UNTITLED2 Summary of this function goes here
- % state xin = [ x(t) x'(t) y(t) y'(t) L(t) L'(t)]
- g = 9.8;
- % Divide up state into named variables
- x = xin(1);
- xp = xin(2); % dxdt(1)
- % get y(t) and y'(t)
- y = interp1(tspan, ground, t ,'cubic');
- yp = interp1(tspan, groundp, t ,'cubic');
- % Dynamics equation, mass-spring-damper
- xpp = (c*yp + k*y - (c*xp + k*x + m*g))/m; %dxdt(2)
- dxdt = [ xp ; xpp ];
- end
Advertisement
Add Comment
Please, Sign In to add comment