Program in Scilab:
clf;
s=%s;
g=1.06/(s*(s+1)*(s+2));
gc=0.9656*(s+0.05)/(s+0.005);
gt=gc*g;
gc=g /. 1;
gct=gt /. 1;
t=0:0.1:50;
gs=syslin('c',gc);
gcs=syslin('c',gct);
y=csim(t,t,gs);
yt=csim(t,t,gcs);
plot(t,y);
plot(t,yt,'g');
plot(t,t,'r');
xgrid;
xtitle('response to a unit-ramp input of a lag conpensated system'
,'t','output');
legend(['no compensated';'compensated';'unit-ramp'],style=4);
|
|