下面的代码应该解决以下方程式: d2x / dt2 =(u + d)/ J
In mdlDerivatives why sys(1)=x(2)? Why not sys(1)=x(1)?
Does x(2) has different meanings in mdlDerivatives and mdlOutputs?
function sys=mdlDerivatives(t,x,u)
J=2;
dt=10*sin(2*pi*100*t);
ut=u(1);
sys(1)=x(2);
sys(2)=1/J*(ut+dt);
function sys=mdlOutputs(t,x,u)
sys(1)=x(1);
sys(2)=x(2);