Program in Scilab:
num=poly([25 0 0],'s','coeff');
den=poly([25 6 1],'s','coeff');
t=0:0.005:5;
g=syslin('c',num/den);
gs=csim('step',t,g);
r=1;
while gs(r)<1.0001;
r=r+1;
end;
risetime=(r-1)*0.005;
[gsmax,rp]=max(gs);
peaktime=(rp-1)*0.005;
Maxshoot=gsmax-1;
rmax=5/0.005;
k=rmax+1;
while gs(k)>0.98 & gs(k)<1.02;
k=k-1;
end;
settlingtime=(k-1)*0.005;
Maxshoot
risetime
peaktime
settlingtime
Result
-->Maxshoot
Maxshoot =
0.0947800
-->risetime
risetime =
0.555
-->peaktime
peaktime =
0.785
-->settlingtime
settlingtime =
1.185
|
| |