0
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1 % MDC1 Conversion to acceleration
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
3 % Test script for the MDC1 conversion to acceleration of IFO data
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
4 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
5 % $Id: test_mdc1_conv2acc_utn.m,v 1.2 2009/03/02 15:53:46 luigi Exp $
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
6 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
7 %% Clear
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
8
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
9 clear all
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
10
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
11 %% Loading data
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
12
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
13 currPath = cd;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
14 cd 'C:\Dati\mock_data\interferometer\';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
15
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
16 j=1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
17 fs = 10;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
18
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
19 disp(sprintf('*** Reading data %d', j));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
20 in = load(sprintf('mockdata_16_48_17_11_2007_%d.dat', j));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
21 d1 = in(:,2);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
22 d12 = in(:,3);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
23
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
24 % Build O1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
25 eval('ts = tsdata(d1, fs);');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
26 eval(sprintf('o1_%d = ao(ts);', j));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
27 eval(sprintf('o1_%d = setName(o1_%d, ''o1'');', j, j));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
28 eval(sprintf('o1_%d = setXunits(o1_%d, ''s'');', j, j));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
29 eval(sprintf('o1_%d = setYunits(o1_%d, ''m'');', j, j));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
30
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
31 % Build O12
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
32 eval('ts = tsdata(d12, fs);');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
33 eval(sprintf('o12_%d = ao(ts);', j));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
34 eval(sprintf('o12_%d = setName(o12_%d, ''o12'');', j, j));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
35 eval(sprintf('o12_%d = setXunits(o12_%d, ''s'');', j, j));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
36 eval(sprintf('o12_%d = setYunits(o12_%d, ''m'');', j, j));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
37
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
38 global LTPDAinvar
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
39
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
40 LTPDAinvar = { o1_1 , 1 , 'From file';...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
41 o12_1 , 1 , 'From file'};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
42
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
43 cd(currPath)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
44
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
45
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
46 %% =============================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
47
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
48 channel1 = LTPDAinvar{1,1};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
49 channel2 = LTPDAinvar{2,1};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
50
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
51 %%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
52
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
53 CH1 = channel1.lpsd;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
54 CH2 = channel2.lpsd;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
55 iplot(CH1)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
56 iplot(CH2)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
57
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
58 %% DRAG FREE
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
59
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
60 rat1pl = plist('NUM', [0.0004659;0.1349;4.37;0.8304;0.07449;0.002978;4.403e-005], 'DEN', [1;5.046;9.609;11.05;0.01221;3.401e-006;0]);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
61 control1 = mdc1_ifo2cont_utn(channel1,rat1pl);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
62
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
63 %% retarded actuaction - thrusters:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
64
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
65 retard1pl = plist('TAU', 0.1, 'DELTAT', 0.315, 'FS', 10, 'TOL', 1e-007, 'AMP', 1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
66 actuation1 = mdc1_cont2act_utn(control1,retard1pl);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
67
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
68 %% LOW FREQ SUSP
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
69
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
70 rat2pl = plist('NUM', [-2.726e-007;1.665e-005;1.303e-007;8.381e-010], 'DEN', [1;0.2189;0.01922;0.0007803;0]);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
71 control2 = mdc1_ifo2cont_utn(channel2,rat2pl);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
72
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
73 %% retarded actuaction - electrical actuators:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
74
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
75 retard2pl = plist('TAU', 0.01, 'DELTAT', 0.305, 'FS', 10, 'TOL', 1e-007, 'AMP', 1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
76 actuation2 = mdc1_cont2act_utn(control2,retard2pl);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
77
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
78 %% Free dynamics:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
79
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
80 plfd = plist('pstiff1', -1.3e-6,'pstiff2', -2e-6,'cross_talk', -1e-4,'METHOD', 'PARFIT');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
81 freeDynamics = mdc1_ifo2acc_fd_utn(channel1,channel2,plfd);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
82
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
83 %% Output
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
84
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
85 output1 = freeDynamics.index(1) + actuation1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
86 output2 = freeDynamics.index(2) + actuation2;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
87 % output1 = freeDynamics(1) + control1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
88 % output2 = freeDynamics(2) + control2;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
89
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
90 %% ******************************************
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
91 % plotting output psd
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
92
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
93 psd1 = output1.lpsd;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
94 psd2 = output2.lpsd;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
95 iplot(psd1)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
96 iplot(psd2)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
97
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
98 %% ====================== More checks =====================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
99
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
100 %% Extracting filters
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
101
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
102 miir1Obj = find(control1.procinfo,'CONT_FILTER');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
103 retard1 = find(actuation1.procinfo,'ACT_FILTER');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
104 miir2Obj = find(control2.procinfo,'CONT_FILTER');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
105 retard2 = find(actuation2.procinfo,'ACT_FILTER');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
106
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
107 %% Checking controllers
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
108
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
109 % frequencies
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
110 f = logspace(-6,log10(5),300);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
111 % f = logspace(-6,0,300);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
112 f = f.';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
113
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
114 % response of continuous drag free
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
115 Rcdf = resp(rat1Obj,f);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
116 Rcdf.setName('Continuous DF');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
117
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
118 % response of discrete drag free
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
119 tRddf = resp(miir1Obj,plist('f',f));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
120 Rddf = tRddf(1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
121 for ii = 2:numel(tRddf)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
122 Rddf = Rddf + tRddf(ii);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
123 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
124 Rddf.setName('Discrete DF');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
125
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
126 % response of continuous low freq susp
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
127 Rclfs = resp(rat2Obj,f);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
128 Rclfs.setName('Continuous LFS');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
129
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
130 % response of discrete low freq susp
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
131 tRdlfs = resp(miir2Obj,plist('f',f));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
132 Rdlfs = tRdlfs(1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
133 for ii = 2:numel(tRdlfs)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
134 Rdlfs = Rdlfs + tRdlfs(ii);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
135 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
136 Rdlfs.setName('Discrete LFS');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
137
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
138 % response of actuation filter 1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
139 Ract1 = resp(retard1,plist('f',f));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
140 Ract1.setName('Thrusters');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
141
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
142 % response of actuation filter 2
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
143 Ract2 = resp(retard2,plist('f',f));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
144 Ract1.setName('Actuators');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
145
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
146 %% Plotting reposnse
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
147
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
148 % Continuous and discrete controllers
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
149 pl = plist('Legends', {'cH_{df}','dH_{df}','cH_{lfs}','dH_{lfs}'},...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
150 'LineStyles', {'', '--', '', '--'});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
151 iplot(Rcdf,Rddf,Rclfs,Rdlfs,pl)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
152
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
153 % Ratio between discrete and continuous
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
154 pl = plist('Legends', {'dH_{df}/cH_{df}','dH_{lfs}/cH_{lfs}'},...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
155 'YScales',{'All','lin'});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
156 iplot(Rddf./Rddf,Rdlfs./Rclfs,pl)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
157
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
158 % Actuators
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
159 pl = plist('Legends', {'Thrusters','El. Act.'},...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
160 'YScales',{'All','lin'});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
161 iplot(Ract1,Ract2,pl)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
162
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
163 % discrete controllers + actuation
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
164 pl = plist('Legends', {'dH_{df}','dH_{df} + Tht','dH_{lfs}','dH_{lfs} + Act'},...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
165 'LineStyles', {'', '--', '', '--'});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
166 iplot(Rddf,Rddf.*Ract1,Rdlfs,Rdlfs.*Ract2,pl)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
167
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
168 %% Calculating transfer functions
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
169
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
170 % controller ***
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
171 pl = plist('Nfft', fs*1000);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
172 tfdf = tfe(channel1,control1,pl);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
173 tflfs = tfe(channel2,control2,pl);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
174 plpl = plist('Legends', {'H_{df}','H_{df} data','H_{lfs}','H_{lfs} data'},...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
175 'LineStyles', {'', '--', '', '--'});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
176 iplot(Rddf,tfdf(1,2),Rdlfs,tflfs(1,2),plpl)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
177
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
178 % Actuation ***
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
179 pl = plist('Nfft', fs*1000);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
180 tfact1 = tfe(control1,actuation1,pl);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
181 tfact2 = tfe(control2,actuation2,pl);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
182 plpl = plist('Legends', {'Tht','Tht data','El Act','El Act data'},...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
183 'LineStyles', {'', '--', '', '--'});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
184 iplot(Ract1,tfact1(1,2),Ract2,tfact2(1,2),plpl)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
185
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
186 % Free Dynamics TFs ***
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
187 pl = plist('Nfft', fs*10000);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
188 tffd1 = tfe(channel1,freeDynamics(1),pl);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
189 tffd2 = tfe(channel2,freeDynamics(2),pl);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
190
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
191 % Theorethical
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
192 % w1 = -1.3e-6;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
193 % w2 = -2e-6;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
194 % D1 = -1e-4;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
195 % s = 2.*pi.*1i.*f;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
196 % FD1 = s.^2 + w1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
197 % FD2 = -D1.*s.^2 + w2 - w1 - D1*w2 + s.^2 + w2;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
198 FD1 = ao(plist('fsfcn', '(2.*pi.*1i.*f).^2 + -1.3e-6', 'f', f));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
199 FD2 = ao(plist('fsfcn', '-(-1e-4).*(2.*pi.*1i.*f).^2 + (-2e-6) - (-1.3e-6) - (-1e-4)*(-2e-6) + (2.*pi.*1i.*f).^2 + (-2e-6)', 'f', f));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
200
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
201 plpl = plist('Legends', {'FD1','FD1 data','FD2','FD2 data'},...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
202 'LineStyles', {'', '--', '', '--'});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
203 iplot(abs(FD1),abs(tffd1(1,2)),abs(FD2),abs(tffd2(1,2)),plpl)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
204
|