% u21 p12 rlocus

clear all; close all;
clf

den=[1 -2 1];
num=[0 0.5 0.5];


sysC = tf( num, den )

figure(1)
rlocus( sysC )
axis( [ -6, 2, -3, 3 ])
set(findall(gcf,'type','line'),'linewidth',3);
title('Root locus of CT system')



sysD = tf( num, den, 1 )

figure(2)
rlocus( sysD )
axis( [ -6, 2, -3, 3 ])
set(findall(gcf,'type','line'),'linewidth',3);
title('Root locus of DT system')


% the PD system with T_d = 1.5

den=[1 -2 1];
num=[0 1 -0.25];

sysD = tf( num, den, 1 )

figure(3)
rlocus( sysD )
axis( [ -6, 2, -3, 3 ])
set(findall(gcf,'type','line'),'linewidth',3);
title('Root locus of DT system')


% the PD system with T_d = 1.5

den=[1 -2 1];
num=[0 2 -1];

sysD = tf( num, den, 1 )

figure(4)
rlocus( sysD )
axis( [ -6, 2, -3, 3 ])
set(findall(gcf,'type','line'),'linewidth',3);
title('Root locus of DT system')
