summaryrefslogtreecommitdiff
path: root/104/CH5
diff options
context:
space:
mode:
Diffstat (limited to '104/CH5')
-rwxr-xr-x104/CH5/EX5.1/5_1.sce22
-rwxr-xr-x104/CH5/EX5.12/5_12.sce22
-rwxr-xr-x104/CH5/EX5.13/5_13.sce24
-rwxr-xr-x104/CH5/EX5.14/5_14.sce6
-rwxr-xr-x104/CH5/EX5.18/5_18.sce9
-rwxr-xr-x104/CH5/EX5.19/5_19.sce9
-rwxr-xr-x104/CH5/EX5.20/5_20.sce9
-rwxr-xr-x104/CH5/EX5.21/5_21.sce10
-rwxr-xr-x104/CH5/EX5.7/5_7.sce5
-rwxr-xr-x104/CH5/EX5.8/5_8.sce9
-rwxr-xr-x104/CH5/EX5.9/5_9.sce4
11 files changed, 129 insertions, 0 deletions
diff --git a/104/CH5/EX5.1/5_1.sce b/104/CH5/EX5.1/5_1.sce
new file mode 100755
index 000000000..c1e789448
--- /dev/null
+++ b/104/CH5/EX5.1/5_1.sce
@@ -0,0 +1,22 @@
+//state transition equation
+//as seen from state equation A=[0 1;-2 -3] B=[0;1] E=0;
+A=[0 1;-2 -3]
+B=[0;1]
+s=poly(0,'s');
+[Row Col]=size(A) //Size of a matrix
+m=s*eye(Row,Col)-A //sI-A
+n=det(m) //To Find The Determinant of si-A
+p=inv(m) ; // To Find The Inverse Of sI-A
+U=1/s
+p=p*U
+syms t s;
+disp(p,"phi(s)=") //Resolvent Matrix
+for i=1:Row
+for j=1:Col
+//Taking Inverse Laplace of each element of Matrix phi(s)
+q(i,j)=ilaplace(p(i,j),s,t);
+end;
+end;
+disp(q,"phi(t)=")//State Transition Matrix
+y=q*B; //x(t)=phi(t)*x(0)
+disp(y,"Solution To The given eq.=")
diff --git a/104/CH5/EX5.12/5_12.sce b/104/CH5/EX5.12/5_12.sce
new file mode 100755
index 000000000..66458ac0f
--- /dev/null
+++ b/104/CH5/EX5.12/5_12.sce
@@ -0,0 +1,22 @@
+//OCF form
+s=%s
+A=[1 2 1;0 1 3;1 1 1]
+B=[1;0;1]
+[row,col]=size(A)
+c=s*eye(row,col)-A
+x=det(c)
+r=coeff(x)
+M=[r(1,2) r(1,3) 1;r(1,3) 1 0;1 0 0]
+S=[B A*B A^2*B]
+disp(S,"controllability matrix=")
+if (det(S)==0) then
+ printf("system cannot be transformed into ccf form")
+else
+ printf("system can be transformed into ccf form")
+end
+P=S*M
+disp(P,"P=")
+Accf=inv(P)*A*P
+Bccf=inv(P)*B
+disp(Accf,"Accf=")
+disp(Bccf,"Bccf=") \ No newline at end of file
diff --git a/104/CH5/EX5.13/5_13.sce b/104/CH5/EX5.13/5_13.sce
new file mode 100755
index 000000000..02f1f03b0
--- /dev/null
+++ b/104/CH5/EX5.13/5_13.sce
@@ -0,0 +1,24 @@
+//OCF form
+A=[1 2 1;0 1 3;1 1 1]
+B=[1;0;1]
+C=[1 1 0]
+D=0
+[row,col]=size(A)
+c=s*eye(row,col)-A
+x=det(c)
+r=coeff(x)
+M=[r(1,2) r(1,3) 1;r(1,3) 1 0;1 0 0]
+V=[C;C*A;C*A^2]
+disp(V,"observability matrix=")
+if (det(V)==0) then
+ printf("system cannot be transformed into ocf form")
+else
+ printf("system can be transformed into ocf form")
+end
+Q=inv(M*V)
+disp(Q,"Q=")
+Aocf=inv(Q)*A*Q
+Cocf=C*Q
+B=inv(Q)*B
+disp(Aocf,"Aocf=")
+disp(Cocf,"Cocf=") \ No newline at end of file
diff --git a/104/CH5/EX5.14/5_14.sce b/104/CH5/EX5.14/5_14.sce
new file mode 100755
index 000000000..90d768aa7
--- /dev/null
+++ b/104/CH5/EX5.14/5_14.sce
@@ -0,0 +1,6 @@
+//DCF form
+A=[0 1 0;0 0 1;-6 -11 -6]
+x=spec(A)
+T=[1 1 1;x(1,1) x(2,1) x(3,1);(x(1,1))^2 (x(2,1))^2 (x(3,1))^2]
+Adcf=inv(T)*A*T
+disp(Adcf,"Adcf=") \ No newline at end of file
diff --git a/104/CH5/EX5.18/5_18.sce b/104/CH5/EX5.18/5_18.sce
new file mode 100755
index 000000000..927ccf898
--- /dev/null
+++ b/104/CH5/EX5.18/5_18.sce
@@ -0,0 +1,9 @@
+//system with identical eigen values
+A=[1 0;0 1] //lamda1=1
+B=[2;3] //b11=2 b21=3
+S=[B A*B]
+if det(S)==0 then
+ printf("system is uncontrollable")
+else
+ printf("system is contollable")
+ end \ No newline at end of file
diff --git a/104/CH5/EX5.19/5_19.sce b/104/CH5/EX5.19/5_19.sce
new file mode 100755
index 000000000..2c18ebb8b
--- /dev/null
+++ b/104/CH5/EX5.19/5_19.sce
@@ -0,0 +1,9 @@
+//controllability
+A=[-2 1;0 -1]
+B=[1;0]
+S=[B A*B]
+if det(S)==0 then
+ printf("system is uncontrollable")
+else
+ printf("system is contollable")
+ end \ No newline at end of file
diff --git a/104/CH5/EX5.20/5_20.sce b/104/CH5/EX5.20/5_20.sce
new file mode 100755
index 000000000..179a185bb
--- /dev/null
+++ b/104/CH5/EX5.20/5_20.sce
@@ -0,0 +1,9 @@
+//controllability
+A=[1 2 -1;0 1 0;1 -4 3]
+B=[0;0;1]
+S=[B A*B A^2*B]
+if det(S)==0 then
+ printf("system is uncontrollable")
+else
+ printf("system is contollable")
+ end \ No newline at end of file
diff --git a/104/CH5/EX5.21/5_21.sce b/104/CH5/EX5.21/5_21.sce
new file mode 100755
index 000000000..f109bb2b8
--- /dev/null
+++ b/104/CH5/EX5.21/5_21.sce
@@ -0,0 +1,10 @@
+//observability
+A=[-2 0;0 -1]
+B=[3;1]
+C=[1 0]
+V=[C;C*A]
+if det(V)==0 then
+ printf("system is unobservable")
+else
+ printf("system is observable")
+ end \ No newline at end of file
diff --git a/104/CH5/EX5.7/5_7.sce b/104/CH5/EX5.7/5_7.sce
new file mode 100755
index 000000000..18106c0f1
--- /dev/null
+++ b/104/CH5/EX5.7/5_7.sce
@@ -0,0 +1,5 @@
+//characteristic equation from transfer function
+s=%s
+sys=syslin('c',1/(s^3+5*s^2+s+2))
+c=denom(sys)
+disp(c,"characteristic equation=") \ No newline at end of file
diff --git a/104/CH5/EX5.8/5_8.sce b/104/CH5/EX5.8/5_8.sce
new file mode 100755
index 000000000..9ff9bb379
--- /dev/null
+++ b/104/CH5/EX5.8/5_8.sce
@@ -0,0 +1,9 @@
+//characteristic equation from state equation
+A=[0 1 0;0 0 1;-2 -1 -5]
+B=[0;0;1]
+C=[1 0 0]
+D=[0]
+[Row Col]=size(A)
+Gr=C*inv(s*eye(Row,Col)-A)*B+D
+c=denom(Gr)
+disp(c,"characteristic equation=") \ No newline at end of file
diff --git a/104/CH5/EX5.9/5_9.sce b/104/CH5/EX5.9/5_9.sce
new file mode 100755
index 000000000..369b6ae42
--- /dev/null
+++ b/104/CH5/EX5.9/5_9.sce
@@ -0,0 +1,4 @@
+//eigen values
+A=[0 1 0;0 0 1;-2 -1 -5]
+e=spec(A) //spec gives eigen values of matrix
+disp(e,"eigen values=") \ No newline at end of file