Lab Report - Exp 7 - 1913145
Lab Report - Exp 7 - 1913145
Submitted by:
Guided by:
DR. Rajeeb Dey
a. Plot P.M vs M P
b. Plot b vs t r
c. Plot GCF vs t r
1) Code:
clc
clear all
close all
zeta=[0.1:0.2:0.9];
wn=2;
for i=1:length(zeta)
z=[];
p=[0 -(2*zeta(i)*wn)]
k=wn^2;
[num,den]=zp2tf(z,p,k);
sys1(i)=zpk(z,p,k)
G=tf(num,den);
sys(i)=feedback(G,1);
fdata(i)=allmargin(sys1(i));
Pm(i)=fdata(i).PhaseMargin;
time(i)=stepinfo(sys(i));
Mp(i)=time(i).Overshoot;
end
subplot(2,1,1)
plot(zeta,Pm)
title('phase margin vs damping ratio')
xlabel('zeta')
ylabel('PhaseMargin')
grid on
subplot(2,1,2)
plot(Mp,Pm)
title('Phase margin vs phase margin
peakovershoot')
xlabel('peak overshoot')
ylabel('PhaseMargin')
grid on
Output:
p =0 -0.4000
sys1 =
4
---------
s (s+0.4)
p =0 -1.2000
p =0 -2.8000
4
---------
s (s+1.2)
Graph:
3)Code:
clc;
clear all;
close all;
k=[0.1:0.1:5.5]
for i=1:length(k)
num=k(i);
den=[1 3 2 0];
G=tf(num,den);
sys(i)=feedback(G,1);
fd(i)=allmargin(G);
pm(i)=fd(i).PhaseMargin;
t(i)=stepinfo(sys(i));
tr(i)=t(i).RiseTime;
mp(i)=t(i).Overshoot;
wb(i)=bandwidth(sys(i));
wgc(i)=getGainCrossover(G,1);
end
subplot(3,1,1)
plot(mp,pm)
xlabel("Overshoot")
ylabel('Phas Margin')
title("Phase Margin vs Overshoot")
grid
subplot(3,1,2)
plot(tr,wb)
xlabel("Rise Time")
ylabel('Bandwidth')
title("Badwidth vs Rise Time")
grid
subplot(3,1,3)
plot(tr,wgc)
xlabel("Rise Time")
ylabel('Gain Crossover Frequency')
title("Gain Crossover Frequency vs Rise Time")
grid
Output:
K
Fig-4:Plot the following for a unity feedback system with OLTF G (s) =
s( s + 1)( s + 2)