0% found this document useful (0 votes)
53 views1 page

Exp 4

The document contains MATLAB code to analyze the step response of a system. It calculates the percent overshoot, rise time, and contains code to determine the natural frequency and damping ratio from the system parameters.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views1 page

Exp 4

The document contains MATLAB code to analyze the step response of a system. It calculates the percent overshoot, rise time, and contains code to determine the natural frequency and damping ratio from the system parameters.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

clc;

clear all;
num=[1];
den=[1 0.4 1];
[y,x,t]=step(num,den);
plot(t,y);
yss=polyval(num,0)/polyval(den,0);
[yp,r]=max(y);
tp=t(r);
os=((yp-yss)/yss)*100;
n=1;
while y(n)<0.1*yss
n=n+1;
end
m=1
while y(m)<0.9*yss
m=m+1;
end
tr=t(m)-t(n)

exp-3
clc
clear all
n=[50 69];
d=[35 15 22];
wn=sqrt(d(3));
zeta=d(2)/(2*wn);
r=roots(d);
fprintf('\nThe natural frequency omega_n=%f',wn);
fprintf('\nThe damping ratio zeta =%f\n',zeta);
fprintf('\nThe poles are');

You might also like