summaryrefslogtreecommitdiff
path: root/3432/CH7/EX7.9/Ex7_9.sce
blob: 28a048851e22fba58b2c20e2df1c055d6677af68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//Example 7.9
//State Equations in Modal Canonical Form.

xdel(winsid())//close all graphics Windows
clear;
clc;
//------------------------------------------------------------------
//System transfer function 
s=poly(0,'s');
g1=1/s^2;
g2=-1/(s^2+2*s+4);
Gs=g1+g2;
//------------------------------------------------------------------
// State space representation in modal canonical form
sys1=tf2ss(g1);
sys2=tf2ss(g2);
[F1,G1,T1]=canon(sys1.A, sys1.B)
H1=sys1.C*T1;

[F2,G2,T2]=canon(sys2.A, sys2.B)
H2=sys2.C*T2;

F=[F1 zeros(2,2);zeros(2,2) F2];
G=[G1;G2];
H=[H1,H2];
J=0;
disp(J,"J",H,"H",G,"G",F,"F","System in modal canonical form")
//------------------------------------------------------------------
 //As Y=G*U;  consatnts k1 and k2  are taken out from G1 and G2 will be 
 //multiplied to H1 and H2 

// So alternately, it can be reprsented as
k1=-1;k2=-2;
F=[F1 zeros(2,2);zeros(2,2) F2];
G=[G1/k1;G2/k2];
H=[H1*k1,H2*k2];
J=0;
disp(J,"J",H,"H",G,"G",F,"F","System in modal canonical form")
//------------------------------------------------------------------