MATLAB program-To study phase trajectory for mass damper spring system:

 

%study frequency response of second order system
clc
clf
close all
x=1
num=[1];
den=[1 2 1];
c=tf(num,den);           %Specify transfer functions or convert LTI model to transfer function form
w=0:0.1:10;
H=freqresp(c,w);
for i=1:1:101
    p(i)=abs(H(:,:,i))
end
plot(w,p)
grid;
title('frequency response of sencond order system')
xlabel('w')
ylabel('Amplitude')

output:

Click on image to enlarge:

mass damper op

Click here to download all MATLAB program.. SEM 7 Advance control system Instrumentation