summaryrefslogtreecommitdiff
path: root/773/CH10/EX10.04/10_04.sci
blob: f000c8819312fb205761fb0321d9e316b7043cc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//equation//
s=%s;
m=s^3+2*s^2+3*s+10;
r=coeff(m)
n=length(r);
routh=[r([4,2]);r([3,1])];
routh=[routh;-det(routh)/routh(2,1),0];
t=routh(2:3,1:2); //extracting the square sub block of routh matrix
routh=[routh;-det(t)/t(2,1),0]
c=0;
for i=1:n
if (routh(i,1)<0)
c=c+1;
end 
end
if(c>=1)
printf("system is unstable")
else ("system is stable")
end