MATLAB: How to apply A bang-bang signal of amplitude 1 N and 1 s width as an input force in Matlab m file

MATLABode

I working a dynamic modeling and simulation of a mechanical system, after I obtained the equation of motion, in the form M qdd+C(q,qdot)qdot+G(g)=F, I want to solve for q, using Matlab ode in an mfile, I got the response for some initial conditions and zero input, but, I want to find the response, for the aforementioned control signal (A bang-bang signal of amplitude 1 N and 1 s width), any suggestion, how to so? Is that possible, or I need to go to Simulink may be 🙂

Best Answer

A very nice and comprehensive answer to this question is available on Robotics Stack Exchange: How to apply A bang-bang signal of amplitude 1 N and 1 s width as an input force to reproduce certain results in Matlab?
Related Question