%%% mass- spring-damper system %%% evaluate the free evolution and the step response clear all close all clc %%% define the parameters b=1 ; % N/m*s m=1; % Kg k=4; %N/m % with these parameters zita=1/4 and omega_n=2 % define A, B, C and D A=[0 1; -k/m -b/m]; B=[0;1/m]; C=[1 0]; D=0; % define the sys by state space representation sys=ss(A,B,C,D); % evaluate static gain k0=dcgain(sys); % evaluate zita and omega_n [wn,zeta,p] = damp(sys); omega_n=wn(1); zita=zeta(1); % define the intial condition x1_0=1; x2_0=0; x0=[x1_0; x2_0]; % open the simulink file with the implemented scheme for such system mass_spring_damper_sys_scheme figure(1) hold on initial(sys,x0) grid on figure (2) hold on step(sys) grid on % parameters for the qualitative step response for zita<<1 if zita<=sqrt(2)/2 s_=exp(-pi*zita/sqrt(1-zita^2)); t_max=pi/(omega_n*sqrt(1-zita^2)); n_oscil=1/2/zita; ta5=3/zita/omega_n; T_oscil=2*pi/(omega_n*sqrt(1-zita^2)); u0=1; y_ss=k0*u0; y_max=y_ss*(1+s_); end