Cep Control
Cep Control
Code:
clear all
clc
A=[0 1;-0.152 -0.152];
B=[0;0.017];
C=[1 0];
D=0;
sys=ss2tf(A,B,C,D);
[num,denum]=ss2tf(A,B,C,D);
g=tf(num,denum)
Result:
Step Response:
Code:
clear all
clc
A=[0 1;-0.152 -0.152];
B=[0;0.017];
C=[1 0];
D=0;
sys=ss2tf(A,B,C,D);
[num,denum]=ss2tf(A,B,C,D);
g=tf(num,denum)
stepinfo(g);
h=feedback(g,1);
stepinfo(h);
hold on
s=tf('s');
P=0.017/(s^2+0.152*s+0.152)
step(P)
Result:
VZ
Step Info:
Simulink Result:
Ramp Response:
Impulse Response:
Canonical Form:
Code:
num=[0 0.017 0];
denum=[1 0.152 0.152];
Gp=tf(num,denum);
GpssObs = canon(Gp,'companion');
GpssObsA = GpssObs.A
GpssObsB = GpssObs.B
GpssObsC = GpssObs.C
GpssObsD = GpssObs.D
Result:
Roots of Transfer Function:
if m(j-1,1)==0
m(j-1,1)=0.001;
end
for i=1:rows-1
m(j,i)=(-1/m(j-1,1))*det([m(j-2,1) m(j-2,i+1);m(j-1,1) m(j-1,i+1)]);
end
end
disp('--------The Routh-Hurwitz array is:--------'),m
% --------------------End of Bulding array--------------------------------
% Checking for sign change
Temp=sign(m);a=0;
for j=1:cols
a=a+Temp(j,1);
end
if a==cols
disp(' ----> System is Stable <----')
else
disp(' ----> System is Unstable <----')
end
Results: