diff options
Diffstat (limited to '1151/CH6')
-rwxr-xr-x | 1151/CH6/EX6.1/example1.sce | 17 | ||||
-rwxr-xr-x | 1151/CH6/EX6.10/example10.sce | 17 | ||||
-rwxr-xr-x | 1151/CH6/EX6.11/example11.sce | 23 | ||||
-rwxr-xr-x | 1151/CH6/EX6.12/example12.sce | 17 | ||||
-rwxr-xr-x | 1151/CH6/EX6.13/example13.sce | 17 | ||||
-rwxr-xr-x | 1151/CH6/EX6.14/example14.sce | 34 | ||||
-rwxr-xr-x | 1151/CH6/EX6.15/example15.sce | 29 | ||||
-rwxr-xr-x | 1151/CH6/EX6.16/example16.sce | 17 | ||||
-rwxr-xr-x | 1151/CH6/EX6.17/example17.sce | 17 | ||||
-rwxr-xr-x | 1151/CH6/EX6.18/example18.sce | 17 | ||||
-rwxr-xr-x | 1151/CH6/EX6.19/exmple19.sce | 18 | ||||
-rwxr-xr-x | 1151/CH6/EX6.2/example2.sce | 17 | ||||
-rwxr-xr-x | 1151/CH6/EX6.20/example20.sce | 7 | ||||
-rwxr-xr-x | 1151/CH6/EX6.3/example3.sce | 17 | ||||
-rwxr-xr-x | 1151/CH6/EX6.4/example4.sce | 17 | ||||
-rwxr-xr-x | 1151/CH6/EX6.5/example5.sce | 17 | ||||
-rwxr-xr-x | 1151/CH6/EX6.6/example6.sce | 17 | ||||
-rwxr-xr-x | 1151/CH6/EX6.7/example7.sce | 8 | ||||
-rwxr-xr-x | 1151/CH6/EX6.8/example8.sce | 8 | ||||
-rwxr-xr-x | 1151/CH6/EX6.9/example9.sce | 8 |
20 files changed, 339 insertions, 0 deletions
diff --git a/1151/CH6/EX6.1/example1.sce b/1151/CH6/EX6.1/example1.sce new file mode 100755 index 000000000..de96b9368 --- /dev/null +++ b/1151/CH6/EX6.1/example1.sce @@ -0,0 +1,17 @@ +s=%s;
+m=s^4+2*s^3+6*s^2+4*s +1;
+disp (m)
+r= coeff (m)
+n= length (r)
+routh = routh_t (m) // Thi s Func t ion g e n e r a t e s the Routht a b l e
+disp (routh ," r o u t h s t a b u l a t i o n=")
+c =0;
+for i =1: n
+if ( routh (i ,1) <0)
+c=c+1;
+end
+end
+if(c >=1)
+printf (" sys t em i s u n s t a b l e ")
+else printf (" sys t em i s s t a b l e ")
+end
diff --git a/1151/CH6/EX6.10/example10.sce b/1151/CH6/EX6.10/example10.sce new file mode 100755 index 000000000..69ada3df0 --- /dev/null +++ b/1151/CH6/EX6.10/example10.sce @@ -0,0 +1,17 @@ +s=%s;
+m=s ^5+2*s ^4+24*s^3+48*s^2-25*s-50;
+disp (m)
+r= coeff (m)
+n= length (r)
+routh = routh_t (m)
+disp (routh ," r o u t h s t a b u l a t i o n s=")
+c =0;
+for i =1: n
+ if ( routh (i ,1) <0)
+c=c+1;
+ end
+ end
+if(c >=1)
+printf (" sys t em i s u n s t a b l e ")
+else printf (" sys t em i s ma r g i n a l l y s t a b l e ")
+ end
diff --git a/1151/CH6/EX6.11/example11.sce b/1151/CH6/EX6.11/example11.sce new file mode 100755 index 000000000..d2e3bdec6 --- /dev/null +++ b/1151/CH6/EX6.11/example11.sce @@ -0,0 +1,23 @@ +// d e t e rmi n i n g c r i t i c a l v a l u e o f K
+s=%s
+syms K
+m=s ^3+6.5* s ^2+10* s +10* K
+cof_a_0 = coeffs (m, ' s ' ,0);
+cof_a_1 = coeffs (m, ' s ' ,1);
+cof_a_2 = coeffs (m, ' s ' ,2);
+cof_a_3 = coeffs (m, ' s ' ,3);
+ r=[ cof_a_0 cof_a_1 cof_a_2 cof_a_3 ]
+ n= length (r);
+ routh =[r ([4 ,2]) ;r ([3 ,1]) ];
+routh =[ routh ;- det ( routh )/ routh (2 ,1) ,0];
+t= routh (2:3 ,1:2) ; // e x t r a c t i n g the s qu a r e sub b l o c ko f r outh mat r ix
+ routh =[ routh ;- det (t)/t(2 ,1) ,0]
+disp (routh ," r o u t h s t a b u l a t i o n=")
+routh (3 ,1) =0 // For ma r g ina ly s t a b l e sys t em
+sys = syslin ( ' c ' ,10/(s ^3+6.5* s ^2+10* s ))
+k= kpure ( sys )
+disp (k,"K( ma r g ina l )=")
+disp ( '=0 ' ,routh (2 ,1) *(s^2) +1.5*10^7*k," a u x i l l a r y e q u a t i o n ")
+p= poly ([ 10* K,0 ,6.5] , ' s ' , ' c o e f f ' )
+s= roots (p)
+disp (s," Fr equency o f o s c i l l a t i o n ( i n rad / s e c )=")
diff --git a/1151/CH6/EX6.12/example12.sce b/1151/CH6/EX6.12/example12.sce new file mode 100755 index 000000000..ff846183c --- /dev/null +++ b/1151/CH6/EX6.12/example12.sce @@ -0,0 +1,17 @@ +s=%s;
+m=s^3+7*s^2+25*s+39;
+disp (m)
+r= coeff (m)
+n= length (r)
+routh = routh_t (m) // Thi s Func t ion g e n e r a t e s the Routht a b l e
+disp (routh ," r o u t h s t a b u l a t i o n=")
+c =0;
+for i =1: n
+if ( routh (i ,1) <0)
+c=c+1;
+end
+end
+if(c >=1)
+printf (" sys t em i s u n s t a b l e ")
+else printf (" sys t em i s s t a b l e ")
+end
diff --git a/1151/CH6/EX6.13/example13.sce b/1151/CH6/EX6.13/example13.sce new file mode 100755 index 000000000..ce50f5449 --- /dev/null +++ b/1151/CH6/EX6.13/example13.sce @@ -0,0 +1,17 @@ +s=%s;
+m=s^4+2*s^3+8*s^2+4*s +3;
+disp (m)
+r= coeff (m)
+n= length (r)
+routh = routh_t (m) // Thi s Func t ion g e n e r a t e s the Routht a b l e
+disp (routh ," r o u t h s t a b u l a t i o n=")
+c =0;
+for i =1: n
+if ( routh (i ,1) <0)
+c=c+1;
+end
+end
+if(c >=1)
+printf (" system is unstable ")
+else printf (" system is stable ")
+end
diff --git a/1151/CH6/EX6.14/example14.sce b/1151/CH6/EX6.14/example14.sce new file mode 100755 index 000000000..7407ef0aa --- /dev/null +++ b/1151/CH6/EX6.14/example14.sce @@ -0,0 +1,34 @@ + s=%s;
+ syms K
+ p=s^2 -(K +2) *s +((2* K) +5)
+cof_a_0 = coeffs (p, ' s ' ,0);
+ cof_a_1 = coeffs (p, ' s ' ,1);
+ cof_a_2 = coeffs (p, ' s ' ,2);
+ r=[ cof_a_0 cof_a_1 cof_a_2 ]
+ n= length (r);
+routh =[r ([3 ,1]) ;r (2) ,0];
+routh =[ routh ;- det ( routh )/ routh (2 ,1) ,0];
+ disp (routh ," r outh=")
+// f o r sys t em to be s t a b l e
+ routh (2 ,1) >0
+
+ K < -2;
+ routh (3 ,1) >0
+K > -2.5;
+disp ("For s t a b l e sys tem , 2>K>2.5")
+ // f o r l imi t e d s t a b i l i t y
+routh (2 ,1) =0
+ K=-2
+ routh (3 ,1) =0
+ K= -2.5
+ disp ("For l imt e d s t a b l e sys t em K=2 and K=2.5")
+ // f o r u n s t a b l e sys t em
+ disp ("For u n s t a b l e sys t em K<2 or K>2.5")
+ roots (p) // g i v e s the r o o t s o f the po l ynomi a l m
+// f o r c r i t i c a l l y damped c a s e
+28 g=(K+2) ^2 -4*((2* K) +5)
+ roots (g)
+ // f o r s t a b l i t y K=6.47 i s u n s t a b l e
+ // f o r c r i t i c a l damping K=2.47
+ disp ("For underdamded cas e , 2>K>2.47")
+disp (" f o r overdamped cas e , 2.47>K>2.5")
diff --git a/1151/CH6/EX6.15/example15.sce b/1151/CH6/EX6.15/example15.sce new file mode 100755 index 000000000..99f283036 --- /dev/null +++ b/1151/CH6/EX6.15/example15.sce @@ -0,0 +1,29 @@ +s=%s;
+ syms K a
+ p=s ^4+10* s ^3+32* s ^2+( K +32) *s+(K*a)
+cof_a_0 = coeffs (p, ' s ' ,0);
+cof_a_1 = coeffs (p, ' s ' ,1);
+ cof_a_2 = coeffs (p, ' s ' ,2);
+cof_a_3 = coeffs (p, ' s ' ,3);
+ cof_a_4 = coeffs (p, ' s ' ,4);
+r=[ cof_a_0 cof_a_1 cof_a_3 cof_a_4 ]
+ n= length (r);
+ routh =[r ([5 ,3 ,1]) ;r ([4 ,2]) ,0]
+routh =[ routh ;- det ( routh (1:2 ,1:2) )/ routh (2 ,1) ,-det (routh (1:2 ,2:3) )/ routh (2 ,2) ,0];
+routh =[ routh ;- det ( routh (2:3 ,1:2) )/ routh (3 ,1) ,-det (routh (2:3 ,2:3) )/ routh (3 ,2) ,0];
+routh =[ routh ;- det ( routh (3:4 ,1:2) )/ routh (4 ,1) ,0 ,0];
+disp (routh ," r outh=")
+// f o r the g i v e n sys t em to be s t a b l e
+routh (3 ,1) >0
+K <288;
+routh (4 ,1) >0
+(288 -K)*(K +32) -100(K*a) >0
+// l e t K=200
+K =200;
+a =((288 - K)*(K +32) ) /(100* K)
+// v e l o c i t y e r r o r
+Kv =(K*a) /(4*2*4) ;
+// % v e l o c i t y e r r o r
+Kvs =100/ Kv
+disp (a," c o n t r o l parame t e r=")
+disp (K,"Gain=")
diff --git a/1151/CH6/EX6.16/example16.sce b/1151/CH6/EX6.16/example16.sce new file mode 100755 index 000000000..ce50f5449 --- /dev/null +++ b/1151/CH6/EX6.16/example16.sce @@ -0,0 +1,17 @@ +s=%s;
+m=s^4+2*s^3+8*s^2+4*s +3;
+disp (m)
+r= coeff (m)
+n= length (r)
+routh = routh_t (m) // Thi s Func t ion g e n e r a t e s the Routht a b l e
+disp (routh ," r o u t h s t a b u l a t i o n=")
+c =0;
+for i =1: n
+if ( routh (i ,1) <0)
+c=c+1;
+end
+end
+if(c >=1)
+printf (" system is unstable ")
+else printf (" system is stable ")
+end
diff --git a/1151/CH6/EX6.17/example17.sce b/1151/CH6/EX6.17/example17.sce new file mode 100755 index 000000000..ce50f5449 --- /dev/null +++ b/1151/CH6/EX6.17/example17.sce @@ -0,0 +1,17 @@ +s=%s;
+m=s^4+2*s^3+8*s^2+4*s +3;
+disp (m)
+r= coeff (m)
+n= length (r)
+routh = routh_t (m) // Thi s Func t ion g e n e r a t e s the Routht a b l e
+disp (routh ," r o u t h s t a b u l a t i o n=")
+c =0;
+for i =1: n
+if ( routh (i ,1) <0)
+c=c+1;
+end
+end
+if(c >=1)
+printf (" system is unstable ")
+else printf (" system is stable ")
+end
diff --git a/1151/CH6/EX6.18/example18.sce b/1151/CH6/EX6.18/example18.sce new file mode 100755 index 000000000..79714d001 --- /dev/null +++ b/1151/CH6/EX6.18/example18.sce @@ -0,0 +1,17 @@ +s=%s;
+m=s^4+2*s^3+s^2+4*s +2;
+disp (m)
+r= coeff (m)
+n= length (r)
+routh = routh_t (m) // Thi s Func t ion g e n e r a t e s the Routht a b l e
+disp (routh ," r o u t h s t a b u l a t i o n=")
+c =0;
+for i =1: n
+if ( routh (i ,1) <0)
+c=c+1;
+end
+end
+if(c >=1)
+printf (" system is unstable ")
+else printf (" system is stable ")
+end
diff --git a/1151/CH6/EX6.19/exmple19.sce b/1151/CH6/EX6.19/exmple19.sce new file mode 100755 index 000000000..065bf8141 --- /dev/null +++ b/1151/CH6/EX6.19/exmple19.sce @@ -0,0 +1,18 @@ + // e l eme n t s i n one row o f r o u t h s t a b u l a t i o n s a r e a l lz e r o
+s=%s;
+m=s^6+3*s ^5+5* s ^4+9* s ^3+8* s ^2+6* s +4;
+disp (m)
+ r= coeff (m)
+ n= length (r)
+ routh = routh_t (m)
+ disp (routh ," r o u t h s t a b u l a t i o n s=")
+ c =0;
+for i =1: n
+ if ( routh (i ,1) <0)
+ c=c+1;
+end
+ end
+ if(c >=1)
+printf (" sys t em i s u n s t a b l e ")
+else printf("system is marginally stable")
+end
diff --git a/1151/CH6/EX6.2/example2.sce b/1151/CH6/EX6.2/example2.sce new file mode 100755 index 000000000..1c16de6eb --- /dev/null +++ b/1151/CH6/EX6.2/example2.sce @@ -0,0 +1,17 @@ +s=%s;
+m=2+3*s+s^2+2*s^3+2*s^4;
+disp (m)
+r= coeff (m)
+n= length (r)
+routh = routh_t (m) // Thi s Func t ion g e n e r a t e s the Routht a b l e
+disp (routh ," r o u t h s t a b u l a t i o n=")
+c =0;
+for i =1: n
+if ( routh (i ,1) <0)
+c=c+1;
+end
+end
+if(c >=1)
+printf (" sys t em i s u n s t a b l e ")
+else printf (" sys t em i s s t a b l e ")
+end
diff --git a/1151/CH6/EX6.20/example20.sce b/1151/CH6/EX6.20/example20.sce new file mode 100755 index 000000000..e87195501 --- /dev/null +++ b/1151/CH6/EX6.20/example20.sce @@ -0,0 +1,7 @@ +s=%s;
+num=1;
+den=s*(s+2)*(s^2+6*s+25);
+t=syslin('c',num/den);
+clf;
+evans(t);
+mtlb_axis([-5 5 -5 5]);
diff --git a/1151/CH6/EX6.3/example3.sce b/1151/CH6/EX6.3/example3.sce new file mode 100755 index 000000000..80a4e32da --- /dev/null +++ b/1151/CH6/EX6.3/example3.sce @@ -0,0 +1,17 @@ +s=%s;
+m=1+2*s+5*s^2+5*s^3+2*s^4;
+disp (m)
+r= coeff (m)
+n= length (r)
+routh = routh_t (m) // Thi s Func t ion g e n e r a t e s the Routht a b l e
+disp (routh ," r o u t h s t a b u l a t i o n=")
+c =0;
+for i =1: n
+if ( routh (i ,1) <0)
+c=c+1;
+end
+end
+if(c >=1)
+printf (" sys t em i s u n s t a b l e ")
+else printf (" sys t em i s s t a b l e ")
+end
diff --git a/1151/CH6/EX6.4/example4.sce b/1151/CH6/EX6.4/example4.sce new file mode 100755 index 000000000..160608b2c --- /dev/null +++ b/1151/CH6/EX6.4/example4.sce @@ -0,0 +1,17 @@ +s=%s;
+m=s^4+2*s^3+3*s^2+4*s +5;
+disp (m)
+r= coeff (m)
+n= length (r)
+routh = routh_t (m) // Thi s Func t ion g e n e r a t e s the Routht a b l e
+disp (routh ," r o u t h s t a b u l a t i o n=")
+c =0;
+for i =1: n
+if ( routh (i ,1) <0)
+c=c+1;
+end
+end
+if(c >=1)
+printf (" system is unstable ")
+else printf (" system is stable ")
+end
diff --git a/1151/CH6/EX6.5/example5.sce b/1151/CH6/EX6.5/example5.sce new file mode 100755 index 000000000..e0de7a8cf --- /dev/null +++ b/1151/CH6/EX6.5/example5.sce @@ -0,0 +1,17 @@ +clc;s=%s;
+m=s^3+4.5*s^2+3.5*s +1.5;
+disp (m)
+r= coeff (m)
+n= length (r)
+routh = routh_t (m) // Thi s Func t ion g e n e r a t e s the Routht a b l e
+disp (routh ," r o u t h s t a b u l a t i o n=")
+c =0;
+for i =1: n
+if ( routh (i ,1) <0)
+c=c+1;
+end
+end
+if(c >=1)
+printf (" system is unstable ")
+else printf (" system is stable ")
+end
diff --git a/1151/CH6/EX6.6/example6.sce b/1151/CH6/EX6.6/example6.sce new file mode 100755 index 000000000..faa5ef468 --- /dev/null +++ b/1151/CH6/EX6.6/example6.sce @@ -0,0 +1,17 @@ +clc;s=%s;
+m=s^5+6*s^4+3*s^3+2*s^2+s+1;
+disp (m)
+r= coeff (m)
+n= length (r)
+routh = routh_t (m) // Thi s Func t ion g e n e r a t e s the Routht a b l e
+disp (routh ," r o u t h s t a b u l a t i o n=")
+c =0;
+for i =1: n
+if ( routh (i ,1) <0)
+c=c+1;
+end
+end
+if(c >=1)
+printf (" system is unstable ")
+else printf (" system is stable ")
+end
diff --git a/1151/CH6/EX6.7/example7.sce b/1151/CH6/EX6.7/example7.sce new file mode 100755 index 000000000..c634a2606 --- /dev/null +++ b/1151/CH6/EX6.7/example7.sce @@ -0,0 +1,8 @@ +// f i r s t e l ement i n any row o f r o u t h s t a b u l a t i o n i s z e r o
+clc;s=%s
+m=s^4+s ^3+2* s ^2+2* s+3
+r= coeff (m); // Ex t r a c t s the c o e f f i c i e n t o f the po l ynomi a l
+n= length (r);
+routh = routh_t (m)
+disp (routh ," r outh=")
+printf (" since there are two sign changes the system is unstable")
diff --git a/1151/CH6/EX6.8/example8.sce b/1151/CH6/EX6.8/example8.sce new file mode 100755 index 000000000..fbb5ce9f5 --- /dev/null +++ b/1151/CH6/EX6.8/example8.sce @@ -0,0 +1,8 @@ +// f i r s t e l ement i n any row o f r o u t h s t a b u l a t i o n i s z e r o
+clc;s=%s
+m=s^5+2*s^4+2*s^3+4*s^2+11*s+10;
+r= coeff (m); // Ex t r a c t s the c o e f f i c i e n t o f the po l ynomi a l
+n= length (r);
+routh = routh_t (m)
+disp (routh ," r outh=")
+printf (" since there are two sign changes the system is unstable")
diff --git a/1151/CH6/EX6.9/example9.sce b/1151/CH6/EX6.9/example9.sce new file mode 100755 index 000000000..4b2bd1854 --- /dev/null +++ b/1151/CH6/EX6.9/example9.sce @@ -0,0 +1,8 @@ +// f i r s t e l ement i n any row o f r o u t h s t a b u l a t i o n i s z e r o
+clc;s=%s
+m=s^3+s+1;
+r= coeff (m); // Ex t r a c t s the c o e f f i c i e n t o f the po l ynomi a l
+n= length (r);
+routh = routh_t (m)
+disp (routh ," r outh=")
+printf (" since there are two sign changes the system is unstable")
|