Linear Control Systems: Assignment #05
Linear Control Systems: Assignment #05
ASSIGNMENT #05
Submitted By:
NS Umair Zulfiqar
NS Waseem Tariq
NS M. Naeem
Submitted To:
Madam Muwahida
Question # 01
Take a 4x4 system where q=2. Decompose the system into controllable part.
Matlab Code:
A=[ 3 3 2 4; 4 2 2 4; 1 2 3 4; 2 1 1 3]
B=[1;1;-1;1]
W = ctrb(A,B)
rank_of_W=rank(W)
rank_of_first_two_column=rank(W(:,1:2))
p3=[3;1;1;2]
p4=[7;2;2;1]
P=[W(:,1:2) p3 p4]
rank_of_P=rank(P)
PI=inv(P)
A_hat = PI*A*P
B_hat = PI*B
A11_hat=A_hat(1:2,1:2)
A22_hat=A_hat(3:4,3:4)
B11_hat=B_hat(1:3,:)
Output:
A=
B=
1
1
-1
1
W=
76 740
76 740
-1
56 568
43 413
rank_of_W =
rank_of_first_two_column =
p3 =
3
1
1
2
p4 =
7
2
2
1
P=
-1
rank_of_P =
PI =
0.1333
-0.0667
0.1667 -0.6556
0.1667
0 -0.5000
0.2000
0.0444
0.0778 -0.0222
0.1667
0.6667
0 -0.0667 -0.2667
A_hat =
3.4667
5.5000
0.0000 -0.4000
B_hat =
1.0000
-0.0000
0
0
A11_hat =
0.0000 -12.0000
1.0000 11.0000
0.0000
A22_hat =
-0.0000 -2.5000
-0.4000
B11_hat =
1.0000
-0.0000
0
0.0000
Question#02
Take a 6 order system with three outputs and represent it in observer form.
Matlab Code:
A=[2 4 4 4 3 2;2 4 7 1 1 3; 3 6 2 4 5 1; 1 3 1 6 3 4; 5 1 6 1 2 4; 2 5 1 3 3
4]
C=[4 3 2 6 7 1; 4 2 7 4 4 5; 6 7 5 1 2 1]
rank_of_C=rank(C)
O = obsv(A,C)
rank_of_O=rank(O)
eeta_C1=2
eeta_C2=2
eeta_C3=2
Oa=[C(1,:); C(1,:)*A; C(2,:); C(2,:)*A; C(3,:); C(3,:)*A;]
Rank_of_Oa=rank(Oa)
J=inv(Oa)
j=J(:,2)
j1=J(:,4)
j2=J(:,6)
PI=[j A*j j1 A*j1 j2 A*j2 ]
P=inv(PI)
AH=P*A*PI
CH=C*PI
Output:
A =
2
2
3
1
5
2
4
4
6
3
1
5
4
7
2
1
6
1
4
1
4
6
1
3
3
1
5
3
2
3
2
3
1
4
4
4
4
4
6
3
2
7
2
7
5
6
4
1
7
4
2
1
5
1
C =
rank_of_C =
3
O =
4
4
6
63
67
54
1059
1234
1053
20146
23014
19755
378764
435354
371029
7150999
8199777
6992380
3
2
7
70
107
92
1726
1874
1682
31498
36941
31122
603865
688273
589014
11331535
13027275
11088513
2
7
5
90
77
97
1430
1837
1530
29479
32846
28763
545185
632345
536306
10362928
11850263
10123179
2
90
7
77
5
97
7
60
4
84
2
60
rank_of_O =
6
eeta_C1 =
2
eeta_C2 =
2
eeta_C3 =
2
Oa =
4
63
4
67
6
54
3
70
2
107
7
92
Rank_of_Oa =
6
6
73
4
89
1
62
1
75
5
73
1
54
6
4
1
73
89
62
1405
1520
1290
25159
29173
24516
476950
544359
464850
8954154
10285889
8758083
7
4
2
60
84
60
1273
1347
1207
22588
26563
22330
433394
493235
422640
8123119
9343038
7951450
1
5
1
75
73
54
1258
1516
1185
24470
27459
23410
453133
522477
442663
8568216
9808156
8366018
J =
0.0768
-0.0763
0.0373
0.2601
-0.0681
-0.2367
0.0295
-0.0107
0.0051
0.1089
-0.1026
-0.0315
-0.0555
-0.0949
-0.0050
-0.8547
0.7536
0.3704
-0.0101
0.0130
-0.0248
-0.0663
0.0578
0.0444
0.2015
0.0168
-0.0408
-0.1452
0.0147
-0.0063
-0.0273
0.0071
0.0269
0.0154
-0.0044
-0.0275
0.1015
-0.0362
-0.0742
0.2220
-0.0549
-0.0965
-0.0101
0.0130
-0.0248
-0.0663
0.0578
0.0444
-0.0704
-0.0170
0.0662
-0.0426
0.0406
0.1721
-0.0273
0.0071
0.0269
0.0154
-0.0044
-0.0275
0.0750
0.0910
0.0268
-0.0099
-0.0712
-0.0691
12.9687
3.0000
35.1129
2.0000
26.2309
7.0000
-20.3111
2.0000
-33.4058
7.0000
-6.4298
5.0000
2.2973
6.0000
9.2647
4.0000
13.7884
1.0000
-16.8920
7.0000
-5.9721
4.0000
5.1702
2.0000
6.0062
1.0000
9.0817
5.0000
-3.3069
1.0000
j =
0.0295
-0.0107
0.0051
0.1089
-0.1026
-0.0315
j1 =
-0.0101
0.0130
-0.0248
-0.0663
0.0578
0.0444
j2 =
-0.0273
0.0071
0.0269
0.0154
-0.0044
-0.0275
PI =
0.0295
-0.0107
0.0051
0.1089
-0.1026
-0.0315
P =
-18.6716
4.0000
-26.7443
4.0000
-25.8433
6.0000
AH =
-0.0000
1.0000
-0.0000
-0.0000
0
0.0000
-16.0970
2.8540
-34.9789
5.3107
-17.6143
0.2085
-0.0000
-0.0000
0.0000
1.0000
0.0000
0
-5.5357
12.5609
21.6738
10.7363
19.9929
10.1377
0.0000
-0.0000
-0.0000
0.0000
-0.0000
1.0000
-9.3264
3.3354
-5.4487
4.9261
0.8328
6.4097
1.0000
0.0000
0.0000
-0.0000
-0.0000
-0.0000
-0.0000
1.0000
-0.0000
-0.0000
-0.0000
-0.0000
-0.0000
-0.0000
1.0000
CH =
0.0000
0.0000
0.0000