
First order LTI systems


In each program , you vary the value of time constant ‘ T ‘, & make different graphs for different values of ‘ T ‘.

Control System Engineering Scilab Programs:
1) To create transfer function using Scilab.
s = %s;
num = 1;
den = 1+s;
tf = syslin('c',num,den)

For theory in Control System, click HERE
2) Generate step response for first order LTI system.
clf;
t = linspace(0,10,5000);
s = %s;
sys = syslin('c', 1 , s+1);
y = csim('step' , t , sys);
plot(y);
xgrid();
xlabel('time');
ylabel('response');
title('step response for first order LTI system/palash-jain','fontsize',4);

For executing above code, click HERE
3) Generate impulse response for first order LTI system.
clf;
t = linspace(0,10,5000);
s = %s;
sys = syslin('c', 1 , s+1);
y = csim('impulse' , t , sys);
plot(y);
xgrid();
xlabel('time');
ylabel('response');
title('impulse response for first order LTI system/palash-jain','fontsize',4);

For executing above code, click HERE
4) Generate ramp response for first order LTI system.
clf;
r = linspace(0,10,5000);
t = linspace(0,10,5000);
s = %s;
sys = syslin('c', 1 , s+1);
y = csim(r , t , sys);
plot(y);
xgrid();
xlabel('time');
ylabel('response');
title('ramp response for first order LTI system/palash','fontsize',4);

For executing above code, click HERE
5) Generate sinusoidal response for first order LTI system.
clf;
s =%s;
t = linspace(0,10,5000);
f = 0.5; //frequency in Hz
u = cos(2*%pi*f*t);
plot(t,u);
sys = syslin('c',1,s+1);
y = csim(u, t, sys);
plot(t,y);
xgrid();
xlabel('time');
ylabel('response');
title('sinusoidal response for first order LTI system/palash-jain','fontsize',4);

For executing above code, click HERE
6) Sketch the Bode plot for the given system using Scilab.
clf;
s = %s;
num = 1;
den = s+1;
sys = syslin('c',num,den);
bode(sys);
title('Bode plot/palash-jain','fontsize',4);

For executing above code, click HERE