%% MAE 425 Vibrations %% %% Saw tooth function Y=0.2 %% inches tau=3.0 %% sec dt=0.01 nt=6 t=(0:dt:(nt*tau))'; %% time variable n=round(tau/dt) y=Y/n*(1:n)' y=[0;y;y;zeros((nt-2)*n,1)]; plot(t,y) xlabel('Time (s)') ylabel('Ground Motion') %%%%%%%%%%%mass-spring damper ground motion of y k=500 m=50 c=30 NUM=[c k] DEN=[m c k] figure printsys(NUM,DEN,'s') lsim(NUM,DEN,y,t)