-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlinearize_pod_analysis.m
52 lines (48 loc) · 1.35 KB
/
linearize_pod_analysis.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
use_bag = 0;
if use_bag == 2
p = BagSideFlowEnginePlant;
elseif use_bag == 1
p = BagFlowEnginePlant;
else
p = FlowEnginePlant;
end
[A, B, C, D, xdot0] = p.linearize(0, p.x0, p.u0);
eA = eig(full(A));
stable = all(real(eA) < 0);
% A = full(A);
% B = full(B);
% if use_bag == 2
% sys = ss(A, B, C, D, 'StateName', {'Height', 'Velocity', 'Bag Pressure', 'Bottom Pressure', 'Side Pressure'},...
% 'OutputName',{'Height', 'Velocity', 'Bag Pressure', 'Bottom Pressure', 'Side Pressure'},...
% 'InputName', 'MassFlowIn');
% elseif use_bag == 1
% sys = ss(A, B, C, D, 'StateName', {'Height', 'Velocity', 'Bag Pressure', 'Bottom Pressure'},...
% 'OutputName',{'Height', 'Velocity', 'Bag Pressure', 'Bottom Pressure'},...
% 'InputName', 'MassFlowIn');
% else
% sys = ss(A, B, C, D, 'StateName', {'Height', 'Velocity', 'Pressure'},...
% 'OutputName', {'Height', 'Velocity', 'Pressure'},...
% 'InputName', 'MassFlowIn');
% end
%
%
% tfinal = 0.2;
% %tfinal = 15;
%
% figure(29)
% subplot(1, 4, 1)
% opts = bodeoptions;
% opts.FreqUnits = 'Hz';
% bode(sys, opts)
%
%
% subplot(1, 4, 2)
% iopzmap(sys)
%
% t = linspace(0, tfinal, 201);
% subplot(1, 4, 3)
% impulse(sys, t)
%
% subplot(1, 4, 4)
% step(sys, t)
%