blob: 183ea422e5012b6840e5dfd249ce5e84a9b93a85 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
//Example 14.2
clear;
clc
h=poly([2,4,5,3,1],'s','coeff');
r=routh_t(h)
//Since there is no change in sign in the first column, there are no roots having positive real parts, and the system is stable.
y=coeff(h);
n=length(y);
c=0;
for i=1:n
if (r(i,1)<0)
c=c+1;
end
end
if(c>=1)
printf("system is unstable")
else ("system is stable")
end
|