% Fig. 5.16   Feedback Control of Dynamic Systems, 8e 
%             Franklin, Powell, Emami
% 

clear all; close all;

s=tf('s');

% zeros at 6, poles at 6.6
sysG1 = (((s+0.1)^2)+(6)^2)/((s^2)*(((s+0.1)^2)+(6.6)^2));

% zeros at 6.6, poles at 6
sysG2 = (((s+0.1)^2)+(6.6)^2)/((s^2)*(((s+0.1)^2)+(6)^2));

sysD = (s+1)/((s+12));

figure(1)

rlocus( sysG1*sysD )

title(' Fig. 5.16 Root locus for collocated system')

axis([-15, 5, -8, 8])

% zoom in 
%axis([-2, 1, 5, 7])


z=0.1:.2:.9;
 wn=1:2:18;
% sgrid(z, wn)
 hold off 
 
 set(findall(gcf,'type','line'),'linewidth',3);

% set(gco,'LineWidth',4)   % For example


figure(2)

rlocus( sysG2*sysD )

title(' Root locus: zeros at 6.6, poles at 6')

axis([-15, 5, -8, 8])

% zoom in 
%axis([-2, 1, 5, 7])


z=0.1:.2:.9;
 wn=1:2:18;
% sgrid(z, wn)
 hold off 
 
 set(findall(gcf,'type','line'),'linewidth',3);

% set(gco,'LineWidth',4)   % For example