diff options
author | prashantsinalkar | 2018-02-03 10:59:42 +0530 |
---|---|---|
committer | prashantsinalkar | 2018-02-03 10:59:42 +0530 |
commit | d1e070fe2d77c8e7f6ba4b0c57b1b42e26349059 (patch) | |
tree | 612077a22c8142c0ae754ec11882a4e7d5dc25a4 /1340/CH6 | |
parent | f35ea80659b6a49d1bb2ce1d7d002583f3f40947 (diff) | |
download | Scilab-TBC-Uploads-d1e070fe2d77c8e7f6ba4b0c57b1b42e26349059.tar.gz Scilab-TBC-Uploads-d1e070fe2d77c8e7f6ba4b0c57b1b42e26349059.tar.bz2 Scilab-TBC-Uploads-d1e070fe2d77c8e7f6ba4b0c57b1b42e26349059.zip |
Modified the code
Diffstat (limited to '1340/CH6')
-rwxr-xr-x | 1340/CH6/EX6.1/6_1.sce | 28 | ||||
-rwxr-xr-x | 1340/CH6/EX6.10/6_10.sce | 24 | ||||
-rwxr-xr-x | 1340/CH6/EX6.11/6_11.sce | 11 | ||||
-rwxr-xr-x | 1340/CH6/EX6.2/6_2.sce | 36 | ||||
-rwxr-xr-x | 1340/CH6/EX6.3/6_3.sce | 27 | ||||
-rwxr-xr-x | 1340/CH6/EX6.4/6_4.sce | 40 | ||||
-rwxr-xr-x | 1340/CH6/EX6.5/6_5.sce | 15 | ||||
-rwxr-xr-x | 1340/CH6/EX6.6/6_6.sce | 22 | ||||
-rwxr-xr-x | 1340/CH6/EX6.7/6_7.sce | 12 | ||||
-rwxr-xr-x | 1340/CH6/EX6.8/6_8.sce | 24 | ||||
-rwxr-xr-x | 1340/CH6/EX6.9/6_9.sce | 25 |
11 files changed, 0 insertions, 264 deletions
diff --git a/1340/CH6/EX6.1/6_1.sce b/1340/CH6/EX6.1/6_1.sce deleted file mode 100755 index a430983d7..000000000 --- a/1340/CH6/EX6.1/6_1.sce +++ /dev/null @@ -1,28 +0,0 @@ -//routh hurwitz criterion for system transfer function given by:
-// g(s)=1000/(s^3+10*s^2+31*s+1030)
-s = poly(0,'s');
-po = syslin('c',1000/(s^3+10*s^2+31*s+1030));//creates LTI system
-m = denom(po);//extracts the denominator of the transfer function
-co = coeff(m);//extracts the coefficients of the denominator
-
-
- routh=[co([4,2]); co([3,1])] ;
-
- D = det(routh)/routh(2,1);
- routh =[routh ;-D 0];
-
- t=routh (2:3 ,1:2) ;
- M = det(t)/t(2,1);
- routh =[routh ;-M 0];
- c=0;
- disp(routh);
- n = length(co);
- for i =1:n
- if(routh(i,1)<0) then
- c= c+1;
- end
- end
- if (c>=1) then
- printf("system is unstable because there is sign change in the 1st row");
- else printf("system is stable");
- end
\ No newline at end of file diff --git a/1340/CH6/EX6.10/6_10.sce b/1340/CH6/EX6.10/6_10.sce deleted file mode 100755 index 955139be6..000000000 --- a/1340/CH6/EX6.10/6_10.sce +++ /dev/null @@ -1,24 +0,0 @@ -clc;
-s = %s;
-G = s^4+3*s^3+30*s^2+30*s+200;
-disp(G);
-co = coeff(G);
-routh = [co([5,3,1]);co([4,2]) 0];
-routh = [routh;-det(routh(1:2,1:2))/routh(2,1) routh(1,3) 0];
-routh = [routh;-det(routh(2:3,1:2))/routh(3,1) (routh(3,1)*routh(2,3)-routh(2,1)*routh(3,3))/routh(3,1) 0];
-routh= [routh;-det(routh(3:4,1:2))/routh(4,1) 0 0];
-disp(routh,"routh table:");
-printf("\n routh table contains a row of all zeroes.");
-//creating an auxillary polynomial
-temp = routh(3,:);
-coef = coeff(temp);
-aux = poly([coef(2) 0 coef(1)],"s","coeffs")/coef(1);
-disp(aux,"auxillary polynomial:");
-z = roots(G);
-disp(z,"roots of polynomial:")
-for i = 1:4
- A(i)=s+z(i);
- disp(A(i),"=",i,"factor");
-end
-
-//can be done by using factors(G) and roots(G) directly
\ No newline at end of file diff --git a/1340/CH6/EX6.11/6_11.sce b/1340/CH6/EX6.11/6_11.sce deleted file mode 100755 index c235cba25..000000000 --- a/1340/CH6/EX6.11/6_11.sce +++ /dev/null @@ -1,11 +0,0 @@ -clc;
-s=%s;
-A = [0 3 1;2 8 1;-10 -5 -2];
-B = [10;0;0];
-C = [1 0 0];
-ss = syslin('c',A,B,C,0);
-tf = ss2tf(ss);disp(tf);
-H = denom(tf);
-routh = routh_t(H);
-disp(routh);
-printf("one sign change hence one pole in RHP");
diff --git a/1340/CH6/EX6.2/6_2.sce b/1340/CH6/EX6.2/6_2.sce deleted file mode 100755 index 1044abd6d..000000000 --- a/1340/CH6/EX6.2/6_2.sce +++ /dev/null @@ -1,36 +0,0 @@ -clc;
-
-s = poly(0,'s');//defines a polynomial
-po = syslin('c',10/(s^5+2*s^4+3*s^3+6*s^2+5*s+3));//defines a transfer function
-m = denom(po);//extraction of the denominator polynomial of the transfer function
-co = coeff(m);//extraction of the coefficients of the denominator polynomial
-n = length(co);
-syms eps ;
-flag = 0;
-
-routh = [co([6,4,2]);co([5,3,1])];//generates the first two rows of the routh table
-
-for j=1:n-2
- t = routh(j:j+1,1:3);
- t1 = t(1:2,1:2);
- Dt1 = det(t1)/t(2,1);
- Dt2 = (t(2,1)*t(1,3)-t(1,1)*t(2,3))/t(2,1);
-
- if(flag == 0) then
- if(Dt1==0) then
- Dt1= -eps;
- flag = 1;
- end
- end
- temp = [-Dt1 Dt2 0];
- routh = [routh;temp];
-end
-disp(routh);
-routh(3,1)= limit(routh(3,1),eps,0);
-routh(4,1) = -limit(routh(4,1),eps,0);//problem getting -infinity
-routh(5,1) = limit(routh(4,1),eps,0);
-disp(routh);
-printf("routh table has one negative sign in the s^2 row");
-printf("\nhence 2 poles in RHP");
-
-//does not recognize infinity
\ No newline at end of file diff --git a/1340/CH6/EX6.3/6_3.sce b/1340/CH6/EX6.3/6_3.sce deleted file mode 100755 index 847ad066b..000000000 --- a/1340/CH6/EX6.3/6_3.sce +++ /dev/null @@ -1,27 +0,0 @@ -
-clc;
-//stability via reversing coefficients
-s = poly(0,'s');
-tf = syslin('c',10/(s^5+2*s^4+3*s^3+6*s^2+5*s+3));
-deno = denom(tf);
-coef = coeff(deno);
-
-//reversing coefficients of tf
-tf2 = poly([coef(6) coef(5) coef(4) coef(3) coef(2) coef(1)],"s","coeff");
-disp(tf2);
-x = routh_t(tf2);//using routh_t function to generate the routh table
-disp(x);
-c = 0;
-for i=1:length(coef)
- if(x(i,1)<0)
- c = c+1;
- end
-end
-if (c>=1)
- printf("system is unstable");
- else printf("system is stable")
-
-end
-//since there is sign change in the first column of the table
-// the system is unstable
-//note: the first column does not contain any zeroes
diff --git a/1340/CH6/EX6.4/6_4.sce b/1340/CH6/EX6.4/6_4.sce deleted file mode 100755 index 0c494884e..000000000 --- a/1340/CH6/EX6.4/6_4.sce +++ /dev/null @@ -1,40 +0,0 @@ -clc;// in-built fuction routh_t can be used to generate the routh table
-s = poly(0,'s');
-tf = syslin('c',10/(s^5+7*s^4+6*s^3+42*s^2+8*s+56));
-deno = denom(tf);
-coef = coeff(deno);
-routh = [coef([6,4,2]);coef([5,3,1])];
-// we will get a row of all zeroes
-T = routh(2,:)/7;
-coef1 = coeff(T);
-// auxillary polynomial s^2+6*s+8 generation
-second = poly([coef1(3) 0 coef1(2) 0 coeff(1)],"s","coeff");disp(second);
-
-aux = derivat(second);//auxillary polynomial
-len = coeff(aux);
-routh = [routh;len(4) len(2) 0];
-disp(routh);
-t = routh(2:3,1:3);
-det1 = det(t(1:2,1:2))/t(2,1);
-det2 = -(t(1,1)*t(2,3)-t(2,1)*t(1,3))/t(2,1);
-routh = [routh;-det1 det2 0];
-t1 = routh(3:4,1:2);
-det3 = det(t1(1:2,1:2))/t1(2,1);
-routh = [routh;-det3 0 0];
-t2 = routh(4:5,1:2);
-det4 = det(t2(1:2,1:2))/t2(2,1);
-routh = [routh;-det4 0 0];
-disp(routh)
-c = 0;
-for k = 1:length(coef)
- if(routh(k,1)<0)
- c =c +1;
- end
-end
-
-if(c>=1)
- printf("system is unstable")
-else printf("system is stable,hence no poles in RHP")
- end
-
-
diff --git a/1340/CH6/EX6.5/6_5.sce b/1340/CH6/EX6.5/6_5.sce deleted file mode 100755 index 1c930dbed..000000000 --- a/1340/CH6/EX6.5/6_5.sce +++ /dev/null @@ -1,15 +0,0 @@ -clc;
-s = %s;
-G = s^8+s^7+12*s^6+22*s^5+39*s^4+59*s^3+48*s^2+38*s+20;
-x = routh_t(G);
-disp(x);c = 0;
-for i = 1:length(coeff(G))
- if(x(i,1)<0)
- c=c+1;
- end
- end
-
- if(c>=1)
- printf("poles in RHP,thus unstable");
- else printf("stable system") ;
- end
\ No newline at end of file diff --git a/1340/CH6/EX6.6/6_6.sce b/1340/CH6/EX6.6/6_6.sce deleted file mode 100755 index a24cca1f8..000000000 --- a/1340/CH6/EX6.6/6_6.sce +++ /dev/null @@ -1,22 +0,0 @@ -clc;
-s = poly(0,"s");
-G = syslin('c',200/(s*(s^3+11*s^2+11*s+6)));disp(G,"G(s)=");
-CL = G/(1+G);disp(CL,"Closed-loop transfer function:")
-deno = denom(CL);
-coef = coeff(deno);
-routh = routh_t(deno);
-disp(routh,"routh:");
-c = 0;
-for i = 1:length(coef)
- if(routh(i,1)<0)
- c = c+1;
- end
-end
-disp(c,"Number of negative signs in 1st column:");
-if(c >=1)
- disp(c+1,"poles in RHP");
- printf("no poles on jw- axis,no rows of all zeroes");
- printf("\n rest of the poles in LHP");
-else
- printf("stable system")
- end
\ No newline at end of file diff --git a/1340/CH6/EX6.7/6_7.sce b/1340/CH6/EX6.7/6_7.sce deleted file mode 100755 index 52a1e61cb..000000000 --- a/1340/CH6/EX6.7/6_7.sce +++ /dev/null @@ -1,12 +0,0 @@ -clc;
-s = %s;
-G = 1/(s*(2*s^4+3*s^3+2*s^2+3*s+2));
-den = denom(G);
-num = numer(G);
-tf = den+num;
-disp(tf,"closed loop transfer function characteristic polynomial is");
-routh = routh_t(tf);
-disp(routh);
-printf("since the entire row of s^3 is not zero");
-printf("\n putting eps = 0 we get one negative sign in 1st row \n");
-printf(" \nhence 2 poles in RHP \n");
diff --git a/1340/CH6/EX6.8/6_8.sce b/1340/CH6/EX6.8/6_8.sce deleted file mode 100755 index f89058d48..000000000 --- a/1340/CH6/EX6.8/6_8.sce +++ /dev/null @@ -1,24 +0,0 @@ -clc;
-s = %s;
-G = syslin('c',128/(s*(s^7+3*s^6+10*s^5+24*s^4+48*s^3+96*s^2+128*s+192)));
-CL = denom(G)+numer(G);
-disp(CL);
-routh = routh_t(CL);
-disp(routh,"routh table:");
-printf("fourth row is a row of all zeroes substituted by the coefficients of the auxillary polynomial");
-
-c = 0;
-for i =1:length(coeff(CL))
- if(routh(i,1)<0)
- c = c+1;
- end
-end
-
-
-if(c >=1)
- disp(c+1,"number of poles in RHP:");
- printf("2 poles on jw-axis due to row of all zeroes and rest in LHP");
-else
- printf("stable system");
- end
-
diff --git a/1340/CH6/EX6.9/6_9.sce b/1340/CH6/EX6.9/6_9.sce deleted file mode 100755 index 7665d7370..000000000 --- a/1340/CH6/EX6.9/6_9.sce +++ /dev/null @@ -1,25 +0,0 @@ -
-clc;s=%s;
-syms K ;
-G = s^3+18*s^2+77*s+K;
-disp(G);
-co0 = coeffs(G,'s',0);
-co1 = coeffs(G,'s',1);
-co2 = coeffs(G,'s',2);
-co3 = coeffs(G,'s',3);
-R =[co0 co1 co2 co3];
-N = length(R);
-routh = [R([4,2]);R([3,1])];
-
-routh = [routh;-det(routh(1:2,1:2))/routh(2,1) 0];
-routh = [routh;-det(routh(2:3,1:2))/routh(3,1) 0];
-disp(routh);
-printf("For K>1386 system is unstable. \n");
-printf("For K = 1386 system is marginally stable. \n");
-printf("For 0<K<1386 system is stable.")
-routh(3,1)=0;//for marginally stable
-K = 1386;
-disp(K,"Marginal value of K:")
-aux = 18*s^2+1386;
-Wn = roots(aux);
-disp(abs(Wn(1)),"frequency of oscillation in rad/sec:");
|