%Tan Nguyen, Trang Pham, Nhan Phan
%ECE 460 Lab
%WINTER 2003
%Lab #2
%Part C (c)
clear;
clc;
z=0.4;
t=[0:0.01:60];
b=[0.2,0.4,0.6,0.8,1,2,5,10,20]';
a=[0.08,0.16,0.24,0.32,0.4,0.8,2,4,8];
figure(1)
for i=1:9
    num=[1/a(i) 1];
    den=[1 0.8 1];
    sys=tf(num,den);
    ys=step(sys,t)
    hold on
    plot(t,ys)
    xlabel('t axis')
    ylabel('ys axis')
    title('Part C (c): Step response of the Normalized Second Order System with Added Zero')
    grid on
    [tp(i),os(i),ts(i)]=tposts(t,ys)
end

%Plot tp, os , ts
figure(2)
hold off
subplot(3,1,1);
plot(b,tp);
title('Peak time');
grid on;

subplot(3,1,2);
plot(b,os)
title('Overshoot');
grid on

subplot(3,1,3);
plot(b,ts)
title('Settling Time');
grid on