Solution
D = [1 3 2 3];
L=length (D);
m=zeros(L,L/2);
[rows,cols]=size(m);
for i=1:cols
m(1,i)=D(1,(2*i)-1);
m(2,i)=D(1,(2*i));
end
for j=3:rows
if m(j-1,1)==0
m(j-1,1)=0.001;
end
for i=1:cols-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:--------'),disp(m);
signMat=sign(m);a=0;
for j=1:rows
a=a+signMat(j,1);
end
if a==rows
disp(' ----> System is Stable <----')
else
disp(' ----> System is Unstable <----')
end
% Calculating Number of Sign Changes
rhpPoles=0;
for k=1:rows-1,
if(signMat(k,1)~=signMat(k+1,1)),
rhpPoles=rhpPoles+1;
end
end
disp(sprintf('--> There are %2d Poles in Right Half Plane <-- ',rhpPoles))
OUTPUT
--------The Routh-Hurwitz array is:--------
1 2
3 3
1 0
3 0
----> System is Stable <----
--> There are 0 Poles in Right Half Plane <-
*****************************************************************************************************
Solution
D = [3 9 6 4 7 8 2 6];
L=length (D);
m=zeros(L,L/2);
[rows,cols]=size(m);
for i=1:cols
m(1,i)=D(1,(2*i)-1);
m(2,i)=D(1,(2*i));
end
for j=3:rows
if m(j-1,1)==0
m(j-1,1)=0.001;
end
for i=1:cols-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:--------'),disp(m);
signMat=sign(m);
a=0;
for j=1:rows
a=a+signMat(j,1);
end
if a==rows
disp(' ----> System is Stable <----')
else
disp(' ----> System is Unstable <----')
end
% Calculating Number of Sign Changes
rhpPoles=0;
for k=1:rows-1,
if(signMat(k,1)~=signMat(k+1,1)),
rhpPoles=rhpPoles+1;
lhpPoles = 8-rhpPoles;
end
end
disp(sprintf('--> There are %2d Poles in Right Half Plane <-- ',rhpPoles))
disp(sprintf('--> There are %2d Poles in Left Half Plane <-- ',lhpPoles))
OUTPUT
--------The Routh-Hurwitz array is:--------
3.0000 6.0000 7.0000 2.0000
9.0000 4.0000 8.0000 6.0000
4.6667 4.3333 0 0
-4.3571 8.0000 6.0000 0
12.9016 6.4262 0 0
10.1703 6.0000 0 0
-1.1852 0 0 0
6.0000 0 0 0
----> System is Unstable <----
--> There are 4 Poles in Right Half Plane <--
--> There are 4 Poles in Left Half Plane <--
*****************************************************************************************************
Solution
R=1000;
L=0.001;
C=0.000006;
A=[1 0; -1/(L*C) -R/L];
[rows,cols]=size(A);
eigVal=eig(A);
signMat=sign(eigVal);
temp=0;
for j=1:rows,
if(real(signMat(j))<0);
temp=temp+1;
end
end
if temp==rows
disp(' ----> System is Stable <----')
else
disp(' ----> System is Unstable <----')
end
OUTPUT
----> System is Unstable <----