O
O
(6)
(7)
(5)
O
(2)
O
(3)
O
(4)
O
(1)
O
O
with('linalg'):
Define the system matrices
A
,
B
,
C
A:=diag(2,2,2,-3,-3);
A
d
2
0
0
0
0
0
2
0
0
0
0
0
2
0
0
0
0
0
K
3
0
0
0
0
0
K
3
A[1,2]:=1;
A
1, 2
d
1
print(A);
2
1
0
0
0
0
2
0
0
0
0
0
2
0
0
0
0
0
K
3
0
0
0
0
0
K
3
B:=transpose(matrix(2,5,[1,1,2,0,0,0,1,1,1,1]));C:=matrix(2,5,
[1,0,0,1,-1,0,0,1,0,0]);
B
d
1
0
1
1
2
1
0
1
0
1
C
d
1
0
0
1
K
1
0
0
1
0
0
Compute the controllability matrix
R:=evalm(augment(B,A&*B,A&*A&*B,A&*A&*A&*B,A&*A&*A&*A&*B));
R
d
1
0
3
1
8
4
20
12
48
32
1
1
2
2
4
4
8
8
16
16
2
1
4
2
8
4
16
8
32
16
0
1
0
K
3
0
9
0
K
27
0
81
0
1
0
K
3
0
9
0
K
27
0
81
rank(R);
4
The pair (A,B) is not controllable. Let us compute the controllable subspace
imageR:=colspace(R);
Exercise set 6 - Problem 4