%%% II order system - define the parameters and run the relative simulink file %%% define the parameters for the mass-spring-damper system m=1; % Kg k=4; %N/m b=4; % N/m*s % implement in Simulink the y_ddot +a1*y_dot+a0*y=b0*u a0=k/m; a1=b/m; b0=1/m; % % define the tf % W=1/m/(s^2+ b/m*s + k/m); %%% run the simulink file sim('ex_II_ord_sys') %%% and then plot y and ydot (the speed) %%% simulink returns the time vector and %%% the variables defined by the block simout figure hold on grid on plot(tout, simout.data,'linewidth',2) xlabel('time') ylabel('y and dy/dt') legend('y','dy/dt')