Scilab 5TH Semester
Scilab 5TH Semester
Scilab 5TH Semester
Soln: clc;
clear all;
clf();
t=0:0.01:3;
K=3;
T=1;
num=poly([K],"s","c");
den=poly([0,T],"s","c");
P=syslin('c',num,den);
Ps1=csim('impulse',t,P);
plot2d(t,Ps1,style=1);
Ps2=csim('step',t,P);
plot2d(t,Ps2,style=2);
deff('u=tf(t)','u=(t)');
Ps3=csim(tf,t,P);
plot2d(t,Ps3,style=3);
xgrid(1);
title(['Time Response of type 0 System'],'fontsize',5);
xlabel('Time(second)','fontsize',5);
ylabel('Amplitude of c(t)','fontsize',5);
legends(['for Unit step','for Ramp','for Parabolic'],[1 2 3], opt=2,fontsize_size=5);
Ans:
Q2. To study the Time Response of Type – 1.
Soln: clc;
clear all;
clf();
t=0:0.01:2;
K=3;
T=1;
num=poly([K],"s","c");
den=poly([1,T],"s","c");
P=syslin('c',num,den);
Ps1=csim('impulse',t,P);
plot2d(t,Ps1,style=1);
Ps2=csim('step',t,P);
plot2d(t,Ps2,style=2);
deff('u=timefun(t)','u=(t^2)');
Ps3=csim(timefun,t,P);
plot2d(t,Ps3,style=5);
xgrid(6);
title(['Time Response of type 1 System'],'fontsize',5);
xlabel('Time(seconds)','fontsize',5);
ylabel('Amplitude of c(t)','fontsize',5);
legends(['for impulse','for Unit step','for Ramp'],[1 2 5], opt=2,fontsize_size=5);
Ans:
Q3. To study the Time Response of Type – II.
Soln: clc;
clear all;
clf();
t=0:0.01:3;
K=3;
T=1;
num=poly([K],"s","c");
den=poly([20,3*T,T],"s","c");
P=syslin('c',num,den);
Ps1=csim('impulse',t,P);
plot2d(t,Ps1,style=1);
Ps2=csim('step',t,P);
plot2d(t,Ps2,style=2);
deff('u=timefun(t)','u=(t^2)');
Ps3=csim(timefun,t,P);
plot2d(t,Ps3,style=5);
xgrid(6);
title(['Time Response of type II System'],'fontsize',5);
xlabel('Time(Second)','fontsize',5);
ylabel('Amplitude of c(t)','fontsize',5);
legends(['for impulse','for Unit step','for Ramp'],[1 2 5], opt=2,fontsize_size=5);
Ans:
ASSIGNMENT 2
Soln: clc;
clear all;
clf();
num=poly([100],"s","c");
den=poly([10,1],"s","c");
s1=syslin('c',num,den);
subplot(2,2,1);
bode(s1,0.01,100);
subplot(2,2,2)
evans(s1,100)
subplot(2,2,4)
evans(s1,100)
sgrid()
subplot(2,2,3)
nyquist(s1)
Ans:
Q5. To study the Frequency Response of Second Order systems.
Soln: clc;
clear all;
clf();
num=poly([100],"s","c");
den=poly([10,1,1.2,1],"s","c");
s1=syslin('c',num,den);
subplot(2,2,1);
bode(s1,0.01,100);
subplot(2,2,2)
evans(s1,100)
subplot(2,2,4)
evans(s1,100)
sgrid()
subplot(2,2,3)
nyquist(s1)
Ans: