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

clear all;
close all;
clf

w = logspace(-3,3,100);

num = [1 0 3];
den = conv([1 1],[1 1]);

figure(1)

rlocus( tf(num, den ) )

axis([-3 3 -3 3]);
axis('equal')

set(findall(gcf,'type','line'),'linewidth',3);
%grid
 
figure(2)

bode( num, den )

set(findall(gcf,'type','line'),'linewidth',3);
grid


figure(3)

[re,im] = nyquist( num, den, w );
plot( re, im, re, -im, 'LineWidth',2 );

set(findall(gcf,'type','line'),'linewidth',3);

axis([-2 4 -3 3]);
axis('square')
xlabel('Re(G(s))');
ylabel('Im(G(s))');
title('Nyquist plot for Example 6.11');
grid on


figure(4)

s = tf( 's' );
sysG = (s^2 + 3)/(s+1)^2;


nyquist( sysG );
axis([-2 4 -3 3]);
%axis('square')

set(findall(gcf,'type','line'),'linewidth',3);

set(gco,'LineWidth',4)
