diff options
Diffstat (limited to '1499/CH7')
-rw-r--r-- | 1499/CH7/EX7.14/q14.sce | 8 | ||||
-rw-r--r-- | 1499/CH7/EX7.18/q18.sce | 35 | ||||
-rw-r--r-- | 1499/CH7/EX7.19/q19.sce | 43 | ||||
-rw-r--r-- | 1499/CH7/EX7.20/q20.sce | 36 | ||||
-rw-r--r-- | 1499/CH7/EX7.28/q28.sce | 21 | ||||
-rw-r--r-- | 1499/CH7/EX7.29/q29.sce | 25 | ||||
-rw-r--r-- | 1499/CH7/EX7.30/q30.sce | 17 | ||||
-rw-r--r-- | 1499/CH7/EX7.31/q31.sce | 16 | ||||
-rw-r--r-- | 1499/CH7/EX7.32/q32.sce | 25 | ||||
-rw-r--r-- | 1499/CH7/EX7.33/q33.sce | 16 | ||||
-rw-r--r-- | 1499/CH7/EX7.36/q36.sce | 11 | ||||
-rw-r--r-- | 1499/CH7/EX7.6/q6.sce | 24 |
12 files changed, 277 insertions, 0 deletions
diff --git a/1499/CH7/EX7.14/q14.sce b/1499/CH7/EX7.14/q14.sce new file mode 100644 index 000000000..b7b42e2c8 --- /dev/null +++ b/1499/CH7/EX7.14/q14.sce @@ -0,0 +1,8 @@ +s=%s;
+
+num=s+3;
+den=s^2+2*s+7;
+
+H=syslin('c',num,den)
+SS=tf2ss(H)
+[Ac,Bc,U,ind]=canon(SS(2),SS(3))
diff --git a/1499/CH7/EX7.18/q18.sce b/1499/CH7/EX7.18/q18.sce new file mode 100644 index 000000000..8ca7da5b8 --- /dev/null +++ b/1499/CH7/EX7.18/q18.sce @@ -0,0 +1,35 @@ +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
+m11=1;
+m21=-1;
+m31=-1;
+x2=[m12;m22;m32];
+q2=(l2*I-A)*1
+//on solving;
+m12=2;
+m22=-4;
+m32=1;
+
+x3=[m13;m23;m33];
+q3=(l3*I-A)*1
+//on solving
+m13=1;
+m23=-3;
+m33=3;
+
+// modal matrix is
+M=[m11 m12 m13;m21 m22 m23;m31 m32 m33]
diff --git a/1499/CH7/EX7.19/q19.sce b/1499/CH7/EX7.19/q19.sce new file mode 100644 index 000000000..75985e2a7 --- /dev/null +++ b/1499/CH7/EX7.19/q19.sce @@ -0,0 +1,43 @@ +syms m11 m12 m13 m21 m22 m23 m31 m32 m33 ^ t m
+s=%s;
+poly(0,"l");
+A=[0 1 0;3 0 2;-12 -7 -6]
+B=[1;0;2]
+C=[1 0 0]
+[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
+m11=1;
+m21=-1;
+m31=-1;
+x2=[m12;m22;m32];
+q2=(l2*I-A)*1
+//on solving;
+m12=2;
+m22=-4;
+m32=1;
+
+x3=[m13;m23;m33];
+q3=(l3*I-A)*1
+//on solving
+m13=1;
+m23=-3;
+m33=3;
+
+// modal matrix is
+M=[m11 m12 m13;m21 m22 m23;m31 m32 m33]
+
+
+q=inv(M)
+A1=real(q*A*M)
+B1=(q*B)
+C1=C*M
diff --git a/1499/CH7/EX7.20/q20.sce b/1499/CH7/EX7.20/q20.sce new file mode 100644 index 000000000..1973b577a --- /dev/null +++ b/1499/CH7/EX7.20/q20.sce @@ -0,0 +1,36 @@ +syms m11 m12 m13 m21 m22 m23 m31 m32 m33 ^ t m
+s=%s;
+poly(0,"l");
+A=[3 -2;-1 2]
+
+[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=4;
+
+x1=[m11;m21];
+q1=(l1*I-A)*1
+
+//on solving
+m11=1;
+m21=1;
+
+x2=[m12;m22];
+q2=(l2*I-A)*1
+//on solving;
+m12=2;
+m22=-1;
+
+
+
+
+
+// modal matrix is
+M=[m11 m12;m21 m22]
+
+
+q=inv(M)
+A1=real(q*A*M)
diff --git a/1499/CH7/EX7.28/q28.sce b/1499/CH7/EX7.28/q28.sce new file mode 100644 index 000000000..c9395a24e --- /dev/null +++ b/1499/CH7/EX7.28/q28.sce @@ -0,0 +1,21 @@ +A=[-2 4;2 -1];
+B=[0;1];
+
+[r c]=size(A)
+I=eye(r,c)
+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;
+
+
+p=s*I-A // s*I-A
+q=s^2+3*s-6;
+r=roots(q)
+
+ //roots lie in rhp
+printf("system is unstable")
diff --git a/1499/CH7/EX7.29/q29.sce b/1499/CH7/EX7.29/q29.sce new file mode 100644 index 000000000..f7868d490 --- /dev/null +++ b/1499/CH7/EX7.29/q29.sce @@ -0,0 +1,25 @@ +A=[-1 0;0 -2];
+B=[0;1];
+
+[r c]=size(A)
+I=eye(r,c)
+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;
+
+C=[1 2];
+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;
+
+
diff --git a/1499/CH7/EX7.30/q30.sce b/1499/CH7/EX7.30/q30.sce new file mode 100644 index 000000000..ec2372e67 --- /dev/null +++ b/1499/CH7/EX7.30/q30.sce @@ -0,0 +1,17 @@ +A=[-1 0;1 -2];
+B=[1;1];
+
+[r c]=size(A)
+I=eye(r,c)
+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;
+
+
+
+
diff --git a/1499/CH7/EX7.31/q31.sce b/1499/CH7/EX7.31/q31.sce new file mode 100644 index 000000000..cf8076e50 --- /dev/null +++ b/1499/CH7/EX7.31/q31.sce @@ -0,0 +1,16 @@ +A=[1 -1;1 -1];
+B=[0;1];
+
+
+
+C=[1 0];
+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;
+
+
diff --git a/1499/CH7/EX7.32/q32.sce b/1499/CH7/EX7.32/q32.sce new file mode 100644 index 000000000..e5d91c7aa --- /dev/null +++ b/1499/CH7/EX7.32/q32.sce @@ -0,0 +1,25 @@ +A=[0 1 0;0 0 1;0 0 0];
+B=[0;0;1];
+
+[r c]=size(A)
+I=eye(r,c)
+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;
+
+C=[1 0 0];
+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;
+
+
diff --git a/1499/CH7/EX7.33/q33.sce b/1499/CH7/EX7.33/q33.sce new file mode 100644 index 000000000..819968c37 --- /dev/null +++ b/1499/CH7/EX7.33/q33.sce @@ -0,0 +1,16 @@ +A=[-2 0;1 -1];
+B=[0;1];
+
+[r c]=size(A)
+I=eye(r,c)
+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;
+
+
+
diff --git a/1499/CH7/EX7.36/q36.sce b/1499/CH7/EX7.36/q36.sce new file mode 100644 index 000000000..a2c68e163 --- /dev/null +++ b/1499/CH7/EX7.36/q36.sce @@ -0,0 +1,11 @@ +A=[-1 -4 -1;-1 -6 -2;-1 -2 -3];
+B=[0;0;1];
+C=[3 1 0]
+
+[r c]=size(A)
+I=eye(r,c)
+
+p=s*I-A // s*I-A
+r=inv(p)
+q=C*r
+t=q*B
diff --git a/1499/CH7/EX7.6/q6.sce b/1499/CH7/EX7.6/q6.sce new file mode 100644 index 000000000..4ac5b256f --- /dev/null +++ b/1499/CH7/EX7.6/q6.sce @@ -0,0 +1,24 @@ +syms m11 m12 m13 m21 m22 m23 m31 m32 m33 ^
+s=%s;
+poly(0,"l");
+A=[-3 1;1 -3]
+[r c]=size(A)
+I=eye(r,c);
+p=l*I-A;
+q=det(p); // determinant of li-p
+// roots of q are
+l1=-2;
+l2=-4;
+
+x1=[m11;m21];
+q1=(l1*I-A)*1
+// on solving we find m11=1 m21=1
+m11=1;
+m21=1;
+x2=[m12;m22];
+q2=(l2*I-A)*1
+// on solving we find m12=1 m22=-1
+m12=1;
+m22=-1;
+// modal matrix is
+M=[m11 m12;m21 m22;]
|