%Niveen Bazaraa
%ECE 460 Control Systems
%Lab 3
%Tuesday 23 Sept 2003
%File name  Lab3C_c

clear all
home
t=[0:0.01:60]';
z=.4;
beta1=[.2 .4 .6 .8 1 2 5 10 20];
a=0.4.*beta1;

for i = 1 : 9;            % This loop shows how increasing damping ratio causes the output signal
    num=[0 1/a(i) 1];     % to have less ocillations about the steady state
    den=[1 .8 1];
    sys=tf(num,den);
    ys=step(sys,t);
    [tp(i), os(i), ts(i) ] = tposts(t,ys);
    plot(t,ys)
    pause
end

for i = 1 : 9;            % This loop shows how increasing damping ratio causes the output signal
    num=[0 1/a(i) 1];                 % to have less ocillations about the steady state
    den=[1 .8 1];
    sys=tf(num,den);
    ys=step(sys,t);
    [tp(i), os(i), ts(i) ] = tposts(t,ys);
    plot(t,ys)
    pause
    hold on
end

xlabel('The t axis')
ylabel('The y axis')
title('The normalized unit step response')
grid on
pause


subplot(3,1,1)
plot(beta1,tp);
xlabel('The beta1 axis')
ylabel('The peak time axis')
title('Peak time vs Beta1')
grid on

subplot(3,1,2)
plot(beta1,os);
xlabel('The beta1 axis')
ylabel('The overshoot axis')
title('Overshoot vs Beta1')
grid on

subplot(3,1,3)
plot(beta1,ts);
xlabel('The damping axis')
ylabel('The settling time axis')
title('Settling time vs Beta1')
grid on

beta1=beta1'
tp=tp'
os=os'
ts=ts'
