Professional Documents
Culture Documents
UID: 2021200115
Experiment 9
Root Locus
syms s;
k=1;
gnum=k;
gden=sym2poly(s*(s+4)*(s+2));
disp('The transfer function is:')
g=tf(gnum,gden)
g =
1
---------------- s^3 + 6 s^2 +
8 s Continuous-time transfer
function.
Model Properties
rlocus(g)
1
Bode Plot
gnum=sym2poly(10*(-s+1));
gden=sym2poly(s*(s+2)*(s^2+2*s+27));
disp('The transfer function is:')
g=tf(gnum,gden)
g =
-10 s + 10
-------------------------- s^4
+ 4 s^3 + 31 s^2 + 54 s
Continuous-time transfer function.
Model Properties
wgc
wgc = 0.1878
wpc
wpc = 1.2718
gain_margin
gain_margin = 13.5389
phase_margin
phase_margin = 73.1989
2
bode(g)
if(gain_margin>0&&phase_margin>0&&wgc<wpc)
disp('system is STABLE');
elseif(gain_margin<0&&phase_margin<0&&wgc>wpc)
disp('system is UNSTABLE') ;
elseif (wgc==wpc)
disp('system is MARGINALLY STABLE') ;
end
system is STABLE
Nyquist Plot
num=50; %num=60.........marginally stable and num>60.........unstable
den=[1 6 11 6];
disp('the transfer function is: ')
g=tf(num,den)
g =
50
--------------------- s^3 + 6
s^2 + 11 s + 6 Continuous-time
transfer function.
Model Properties
3
nyquist(g)
wgc
wgc = 3.0476
wpc
wpc = 3.3166
gain_margin
gain_margin = 1.5836
4
phase_margin
phase_margin = 5.9903
system is STABLE