Experiment # 14 Analysis and Design by Root Locus Using MATLAB
Experiment # 14 Analysis and Design by Root Locus Using MATLAB
den = [1 5 20 16 0];
rlocus(h)
v=[-6 6 -6 6];
axis(v);
>> grid;
>>
6.2
>> rlocus(h)
>> grid
>>
6.3
num = [1];
den = [1 1.1 10.3 5 0];
K1 = 0:0.2:20;
K2 = 20:0.1:30;
K3 = 30:5:1000;
K = [K1 K2 K3];
r = rlocus(num,den,K);
plot(r, 'o')
v = [-4 4 -4 4]; axis(v)
grid
title('Root-Locus Plot of G(s) = K/[s(s + 0.5)(s^2
+ 0.6s + 10)]')
6.4
B = [0;1;-14];
C = [1 0 0];
D = [0];
K = 0:0.1:400;
rlocus(A,B,C,D,K);
grid
6.5
>> sgrid
xlabel('Real Axis')
ylabel('Imag Axis')
6.6:
>> num = [1];
den = [1 4 5 0];
K = 0:0.01:1000;
r = rlocus(num,den,K);
>> plot(r,'-'); v = [-3 1 -2 2]; axis(v);
>> sgrid([0.5,0.707], [0.5,1,2])
grid
title('Root-Locus Plot with \zeta = 0.5 and 0.707 Lines and \omega_n = 0.5,1, and 2 Circles')
xlabel('Real Axis'); ylabel('Imag Axis')
gtext('\omega_n = 2')
gtext('\omega_n = 1')
gtext('\omega_n = 0.5')
% Place 'x' mark at each of 3 open-loop poles.
gtext('x')
gtext('x')
gtext('x')
6.7
>> num = [1 2 4];
den = conv(conv([1 4 0],[1 6]), [1 1.4 1]);
rlocus(num, den)
v = [-7 3 -5 5]; axis(v);
grid
title('Root-Locus Plot of G(s) = K(s^2 + 2s +
4)/[s(s + 4)(s + 6)(s^2 + 1.4s + 1)]')
text(1.0, 0.55,'K = 12')
text(1.0,3.0,'K = 73')
text(1.0,4.15,'K = 154')
6.8
num = [-0.5 1];
den = [1 1 0];
k1 = 0:0.01:30;
k2 = 30:1:100;
K3 = 100:5:500;
K = [k1 k2 k3];
rlocus(num,den,K)
v = [-2 6 -4 4]; axis(v); axis('square')
grid
title('Root-Locus Plot of G(s) = K(1 - 0.5s)/[s(s + 1)]')
% Place 'x' mark at each of 2 open-loop poles.
% Place 'o' mark at open-loop zero.
gtext('x')
gtext('x')
gtext('o')
6.9
6.10
num1 = [12.287 23.876];
den1 = [1 5.646 16.933 23.876 0];
num2 = [9];
den2 = [1 3 9 0];
t = 0:0.05:5;
c1 = step(num1,den1,t);
c2 = step(num2,den2,t);
plot(t,c1,'-',t,c2,'.',t,t,'-')
grid
title('Unit-Ramp Responses of Compensated Systems')
xlabel('t Sec')
ylabel('Unit-Ramp Input and Outputs c1 and c2')
text(2.55,3.8,'Input')
text(0.55,2.8,'Compensated System (Method 1)')
text(2.35,1.75,'Compensated System (Method 2)')
6.11
numc = [1 0.05];
denc = [1 3.005 2.015 0.01 0];
num = [1.06];
den = [1 3 2 0];
% ***** Enter rlocus command. Plot the root loci of
both
% systems *****
rlocus(numc,denc)
hold
Current plot held
rlocus(num,den)
v = [-3 1 -2 2]; axis(v); axis('square')
grid
text(-2.8,0.2,'Compensated system')
text(-2.8,1.2,'Uncompensated system')
text(-2.8,0.58,'Original closed-loop pole')
text(-0.1,0.85,'New closed-')
text(-0.1,0.62,'loop pole')
title('Root-Locus Plots of Compensated and
Uncompensated Systems')
hold
Current plot released
% ***** Plot root loci of the compensated system near the origin *****
rlocus(numc,denc)
v = [-0.6 0.6 -0.6 0.6]; axis(v); axis('square')
grid
title('Root-Locus Plot of Compensated System near the Origin')
6.12
6.14
num1 = [20];
den1 = [1 5 12.98 20];
num2 = [20];
den2 = [1 5 32.26 20];
t = 0:0.1:10;
c1 = step(num1,den1,t);
c2 = step(num2,den2,t);
plot(t,c1,t,c2)
text(2.5,1.12,'k = 0.4490')
text(3.7,0.85,'k = 1.4130')
grid
title('Unit-step Responses of Two Systems')
xlabel('t Sec')
ylabel('Outputs c1 and c2')
6.15
num = [1];
den = [1 3 2 0];
numa = [1];
dena = [1 3 3 1];
K1 = 0:0.1:0.3;
K2 = 0.3:0.005:0.5;
K3 = 0.5:0.5:10;
K4 = 10:5:100;
K = [K1 K2 K3 K4];
r = rlocus(num,den,K);
a = rlocus(numa,dena,K);
y = [r a];
plot(y,'-')
v = [-4 4 -4 4]; axis(v)
grid
title('Root-Locus Plot of G(s) = K/[s(s + 1)(s + 2)] and Asymptotes')
xlabel('Real Axis')
ylabel('Imag Axis')
6.16
num = [1];
den = [1 3 2 0];
numa = [1];
dena = [1 3 3 1];
K1 = 0:0.1:0.3;
K2 = 0.3:0.005:0.5;
K3 = 0.5:0.5:10;
K4 = 10:5:100;
K = [K1 K2 K3 K4];
r = rlocus(num,den,K);
a = rlocus(numa,dena,K);
plot(r,'o')
hold
Current plot held
plot(a,'-')
v = [-4 4 -4 4]; axis(v)
grid
title('Root-Locus Plot of G(s) = K/[s(s+1)(s+2)] and
Asymptotes')
xlabel('Real Axis')
ylabel('Imag Axis')
6.17
num = [1];
den = [1 4 11 14 10];
numa = [1];
dena = [1 4 6 4 1];
r = rlocus(num,den);
plot(r,'-')
hold
Current plot held
plot(r,'o')
rlocus(numa,dena);
v = [-6 4 -5 5]; axis(v); axis('square')
grid
title('Plot of Root Loci and Asymptotes')
6.18
num = [1 1];
den = [1 4 11 14 10];
K1 = 0:0.1:2;
K2 = 2:0.0.2:2.5;
K3 = 2.5:0.5:10;
K4 = 10:1:50;
K = [K1 K2 K3 K4]
r = rlocus(num,den,K);
plot(r, 'o')
v = [-8 2 -5 5]; axis(v); axis('square')
grid
title('Root-Locus Plot of G(s) = K(s+1)/[(s^2+2s+2)
(s^2+2s+5)]')
xlabel('Real Axis')
ylabel('Imag Axis')