summaryrefslogtreecommitdiff
path: root/28/CH12
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /28/CH12
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '28/CH12')
-rwxr-xr-x28/CH12/EX12.12/ex12_12.sce10
-rwxr-xr-x28/CH12/EX12.13/ex12_13.sce10
-rwxr-xr-x28/CH12/EX12.14/ex12_14.sce11
-rwxr-xr-x28/CH12/EX12.17/ex12_17.sce23
-rwxr-xr-x28/CH12/EX12.3/ex12_3.sce4
-rwxr-xr-x28/CH12/EX12.4/ex12_4.sce26
-rwxr-xr-x28/CH12/EX12.5/ex12_5.sce28
-rwxr-xr-x28/CH12/EX12.6/ex12_6.sce14
-rwxr-xr-x28/CH12/EX12.7/ex12_7.sce27
9 files changed, 153 insertions, 0 deletions
diff --git a/28/CH12/EX12.12/ex12_12.sce b/28/CH12/EX12.12/ex12_12.sce
new file mode 100755
index 000000000..f7cd81d4b
--- /dev/null
+++ b/28/CH12/EX12.12/ex12_12.sce
@@ -0,0 +1,10 @@
+A=[0 1 0;0 0 1;-6 -11 -6];
+B=[0;0;1];
+P=cont_mat(A,B);
+disp(P,"Controllability Matrix=")
+d=det(P)
+if d==0
+ printf("matrix is singular, so system is uncontrollable");
+else
+ printf("system is controllable");
+end; \ No newline at end of file
diff --git a/28/CH12/EX12.13/ex12_13.sce b/28/CH12/EX12.13/ex12_13.sce
new file mode 100755
index 000000000..3ae89cbf6
--- /dev/null
+++ b/28/CH12/EX12.13/ex12_13.sce
@@ -0,0 +1,10 @@
+A=[0 1;-1 -2];
+B=[1;-1];
+P=cont_mat(A,B);
+disp(P,"Controllability Matrix=")
+d=determ(P)
+if d==0
+ printf("matrix is singular, so system is uncontrollable");
+else
+ printf("system is controllable");
+end; \ No newline at end of file
diff --git a/28/CH12/EX12.14/ex12_14.sce b/28/CH12/EX12.14/ex12_14.sce
new file mode 100755
index 000000000..7e1584261
--- /dev/null
+++ b/28/CH12/EX12.14/ex12_14.sce
@@ -0,0 +1,11 @@
+A=[0 1 0;0 0 1;0 -2 -3];
+B=[0;0;1];
+C=[3 4 1];
+P=obsv_mat(A,C);
+disp(P,"Observability Matrix=");
+d=det(P)
+if d==0
+ printf("matrix is singular, so system is unobservable");
+else
+ printf("system is observable");
+end; \ No newline at end of file
diff --git a/28/CH12/EX12.17/ex12_17.sce b/28/CH12/EX12.17/ex12_17.sce
new file mode 100755
index 000000000..58765bab1
--- /dev/null
+++ b/28/CH12/EX12.17/ex12_17.sce
@@ -0,0 +1,23 @@
+syms g1 g2 g3
+poly(0,"l");
+A=[1 2 0;3 -1 1;0 2 0];
+C=[0;0;1];
+G=[g1;g2;g3];
+p=A-G*C;
+[r c]=size(A);
+I=eye(r,c);
+q=lI-p; // lI-(A-G*C) where I is identity matrix
+r=det(q) // detrminant of lI-(A-G*C)
+// on equating r=0 we get
+// characteristic equation
+l^3+g3*(l)^2+(2*g2-9)l+2+6*g1-2*g2-7*g3=0;
+printf("desired characteristic equation given is\n")
+l^3+10*(l)^2+34*l+40=0;
+// on comparing the coefficients og the two equations
+// we get g1=25.2 g2=21.5 g3=10
+g1=25.2;
+g2=21.5;
+g3=10;
+disp(G)
+
+
diff --git a/28/CH12/EX12.3/ex12_3.sce b/28/CH12/EX12.3/ex12_3.sce
new file mode 100755
index 000000000..5a578a5c4
--- /dev/null
+++ b/28/CH12/EX12.3/ex12_3.sce
@@ -0,0 +1,4 @@
+s=%s;
+H=syslin('c',(2*s^2+6*s+7)/((s+1)^2*(s+2)))
+SS=tf2ss(H)
+[Ac,Bc,U,ind]=canon(SS(2),SS(3))
diff --git a/28/CH12/EX12.4/ex12_4.sce b/28/CH12/EX12.4/ex12_4.sce
new file mode 100755
index 000000000..53d1dcd68
--- /dev/null
+++ b/28/CH12/EX12.4/ex12_4.sce
@@ -0,0 +1,26 @@
+syms m11 m12 m13 m21 m22 m23 m31 m32 m33 ^
+s=%s;
+poly(0,"l");
+A=[0 1 0;3 0 2;-12 -7 -6]
+[r c]=size(A)
+I=eye(r,c);
+p=l*I-A;
+q=det(p); // determinant of li-p
+// roots of q are
+l1=-1;
+l2=-2;
+l3=-3;
+x1=[m11;m21;m31];
+q1=(l1*I-A)*1
+// on solving we find m11=1 m21=-1 31=-1
+m11=1;m21=-1;m31=-1;
+x2=[m12;m22;m32];
+q2=(l2*I-A)*1
+// on solving we find m12=2 m22=-4 m32=1
+m12=2;m22=-4;m32=1;
+x3=[m13;m23;m33];
+q3=(l3*I-A)*1
+// on solving we get m13=1 m23=-3 m33=3
+m13=1;m23=-3;m33=3;
+// modal matrix is
+M=[m11 m12 m13;m21 m22 23;m31 m32 m33]
diff --git a/28/CH12/EX12.5/ex12_5.sce b/28/CH12/EX12.5/ex12_5.sce
new file mode 100755
index 000000000..ca6971d60
--- /dev/null
+++ b/28/CH12/EX12.5/ex12_5.sce
@@ -0,0 +1,28 @@
+syms t m
+s=%s;
+A=[1 0;1 1];
+B=[1;1];
+x=[1;0];
+[r c]=size(A)
+p=s*eye(r,c)-A // s*I-A
+q=inv(p)
+for i=1:r
+for j=1:c
+ // inverse laplace of each element of Matrix q
+q(i,j)=ilaplace(q(i,j),s,t);
+end
+end
+disp(q,"phi(t)=") // State Transition Matrix
+t=t-m;
+q=eval(q)
+// Integrate q w.r.t m
+r=integrate(q*B,m)
+m=0 // Upper limit is t
+g=eval(r) // Puting upper limit in q
+m=t // Lower limit is 0
+h=eval(r) // Putting lower limit in q
+y=(h-g);
+disp(y,"y=")
+printf("x(t)=phi(t)*x(0)+integrate(phi(t-m*B) w.r.t m from 0 to t)")
+y1=(q*x)+y;
+disp(y1,"x(t)=")
diff --git a/28/CH12/EX12.6/ex12_6.sce b/28/CH12/EX12.6/ex12_6.sce
new file mode 100755
index 000000000..fca4f854b
--- /dev/null
+++ b/28/CH12/EX12.6/ex12_6.sce
@@ -0,0 +1,14 @@
+syms t
+s=%s;
+A=[1 0;1 1];
+[r c]=size(A)
+p=s*eye(r,c)-A
+// resolvent matrix
+q=inv(p)
+disp(q,"phi(s)=")
+for i=1:r
+for j=1:c
+q(i,j)=ilaplace(q(i,j),s,t)
+end
+end
+disp(q,"phi(t)=") // state transition matrix \ No newline at end of file
diff --git a/28/CH12/EX12.7/ex12_7.sce b/28/CH12/EX12.7/ex12_7.sce
new file mode 100755
index 000000000..c71d70e84
--- /dev/null
+++ b/28/CH12/EX12.7/ex12_7.sce
@@ -0,0 +1,27 @@
+syms t m
+s=%s;
+A=[0 1;-2 -3];
+B=[0;2];
+x=[0;1];
+[r c]=size(A)
+p=s*eye(r,c)-A
+q=inv(p)
+for i=1:r
+for j=1:c
+q(i,j)=ilaplace(q(i,j),s,t)
+end
+end
+disp(q,"phi(t)=") // state transition matrix
+t=t-m;
+q=eval(q)
+// Integrate q w.r.t m
+r=integrate(q*B,m)
+m=0 // Upper limit is t
+g=eval(r) // Puting upper limit in q
+m=t // Lower limit is 0
+h=eval(r) // Putting lower limit in q
+y=(h-g);
+disp(y,"y=")
+printf("x(t)=phi(t)*x(0)+integrate(phi(t-m*B) w.r.t m from 0 to t)")
+y1=(q*x)+y;
+disp(y1,"x(t)=")