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

clf;

s=tf('s');
t=0:0.05:10;

set_KI = [ 0 1 5];
set_K = [ 1 10 ];

for i = 1:3
for j = 1:2
KI = set_KI(i);
K = set_K(j);

sysCL = (K*s+KI)/(s^3+3*s^2+(2+K)*s+KI);
y = step( sysCL, t );


figure(1)

plot( t, y,'LineWidth',2);

axis([0 10 -0.2 1.5]);
grid on;
hold on;

xlabel('Time (sec)'); 
axis('normal');
%text(2,.25,'K = 1, K_I = 0');
%text(3,0.75,'K= 1, K_I = 1');
%text(1.5,1.1,'K = 10, K_I = 5');

pause(2)
end
end
