% Fig. 5.23  Feedback Control of Dynamic Systems, 8e 
%             Franklin, Powell, Emami
% script to generate Fig. 5.23 

clf;
s=tf('s');

figure(1)

sys2=(s+2)/(s*(s+1));
rlocus(sys2)
axis([-6 2 -3 3])
%hold on
title('Root locus of (s+2)/(s*(s+1))')


figure(2)

sys3=(s+2)/((s*(s+1))*(s+20));
rlocus(sys3,'--')
axis([-6 2 -3 3])
title('Root locus of (s+2)/((s*(s+1))*(s+20))')

figure(3)

sys4=(s+2)/((s*(s+1))*(s+10));
rlocus(sys4,':')
axis([-6 2 -3 3])
title('Root locus of (s+2)/((s*(s+1))*(s+10))')


figure(4)
rlocus(sys2)
axis([-6 2 -3 3])
hold on

rlocus(sys3,'--')

rlocus(sys4,':')

title('Root locus of p = X, 10, 20')


%title('Root locus with PD or lead compensation')

%z=0.1:.2:.9;
%wn=1:1:6;
%sgrid(z, wn)
%hold off