-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathLinearAnalysis.m
63 lines (59 loc) · 1.13 KB
/
LinearAnalysis.m
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
%% Loading system parameters on workspace
VehicleParameters;
%% Linear time-invariant simplified model (LTI)
% Linear dynamic matrix equation: E*qdd + F*qd + G*q = hT*u
E = [
2*mw + 2*Iw/rw^2 + mb, mb*l;
mb*l, Ib + mb*l^2
];
F = [
2*bw/rw^2, 0;
0, 0
];
G = [
0, 0;
0, -mb*g*l
];
hT = [
1/rw, 0;
-1, 1
];
% State-space representation of the LTI model
% State or system matrix
A = [
zeros(2, 2), eye(2);
-inv(E)*G, -inv(E)*F
];
% Input matrix
B = [
zeros(2, 2);
E\hT
];
% Output matrix
% (hypothetical case with full-state feedback)
C = eye(4);
% Feedthrough (or feedforward) matrix
D = [
0, 0;
0, 0;
0, 0;
0, 0
];
% LTI system construction in continuous time
ltiSys = ss(A, B, C, D);
clear E F G hT A B C D
%% Poles and zeros of the LTI system, open-loop stability analysis
% disp(eig(A));
disp(pole(ltiSys));
pzplot(ltiSys);
grid on
%% Non-minimum phase system: Real positive zero
HTw_x = tf(ltiSys(1, 1));
HTw_x.Name = "H(s)";
HTw_x.InputName = "T_w";
HTw_x.OutputName = "x_t";
disp(pole(HTw_x))
figure(1)
pzmap(HTw_x)
grid on
clear HTw_x