summaryrefslogtreecommitdiff
path: root/104/CH9/EX9.17/9_17.sce
blob: d9741847a72acd59b86c2663f11126f7e2b8461e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//relative stability
s=%s;
sys=syslin('c',(100)*(s+5)*(s+40)/(s^3*(s+100)*(s+200)))//K=1
bode(sys)
show_margins(sys,'bode')
gm=g_margin(sys)
pm=p_margin(sys)
disp(gm,"gain margin=")
disp(pm,"phase margin=")
if (gm<=0 | pm<=0)
  printf("system is unstable")
else 
  printf("system is stable")
  end