function f = rhs_smd(t,x,xd); % RHS of ODE for forced SDOF spring-mass-damper system m = 500; % mass c = 200; % damping coefficient k = 750; % spring constant omega = 5; % forcing frequency (rad/s) F0 = 2000; % forcing magnitude % use this for testing if (t > 2) & (t < 15) F = F0; else F = 0; end %F = F0*sin(omega*t); % forcing function f = (F - c*xd - k*x)/m;