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

clf;

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

set_K = [ 25 13 7.5 5];

for i = 1:4
k = set_K(i);
sysCL = k*(s+1)/(s^3+5*s^2+(k-6)*s+k)
y = step( sysCL, t);

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

hold on;
axis([0 12 -5 5]); 
axis('normal');
grid on;
xlabel('Time (sec)');
%ylabel('$y(t)$','Interpreter','LaTex');
%title('Fig. 3.41: Transient responses')
%text(3,2,'K = 7.5');
%text(2.1,1.5,'K = 13');
%text(1.4,1.2,'K = 25'); 

pause(3)
end