comparison m-toolbox/m/mdcs/mdc1/ltpda_mdc1_input_noises.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % LTPDA_MDC1_IFO_NOISE returns a model spectrum of the IFO sensing noise for MDC1.
2 %
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4 %
5 % DESCRIPTION: LTPDA_MDC1_IFO_NOISE returns a model spectrum of the IFO
6 % sensing noise for MDC1.
7 %
8 % CALL: b = ltpda_mdc1_ifo_noise(pl)
9 %
10 % PARAMETERS:
11 %
12 % 'source' - Choose source of noise [default: 'ifo']
13 % 'ifo' - IFO sensing noise [m^2/Hz]
14 % 'sc' - Spacecraft force noise [m^4s^{-2}/Hz]
15 % 'tm' - Test-mass force noise [m^4s^{-2}/Hz]
16 % 'f' - a vector of frequencies [default: 1]
17 % or
18 % 'f1' - start frequency [default: 1e-6]
19 % 'f2' - stop frequency [default: 5]
20 % 'nf' - number of frequency points [default: 1000]
21 % 'scale' - frequency spacing, 'lin' or 'log' [default: 'log']
22 %
23 % VERSION: $Id: ltpda_mdc1_input_noises.m,v 1.2 2008/08/08 13:35:23 anneke Exp $
24 %
25 % The following call returns a parameter list object that contains the
26 % default parameter values:
27 %
28 % >> pl = ltpda_mdc1_ifo_noise(ao, 'Params')
29 %
30 % The following call returns a string that contains the routine CVS version:
31 %
32 % >> version = ltpda_mdc1_ifo_noise(ao,'Version')
33 %
34 % The following call returns a string that contains the routine category:
35 %
36 % >> category = ltpda_mdc1_ifo_noise(ao,'Category')
37 %
38 % HISTORY: 11-04-08 M Hewitson
39 % Creation
40 %
41 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
42 function varargout = ltpda_mdc1_input_noises(varargin)
43 %%% Check if this is a call for parameters
44 if utils.helper.isinfocall(varargin{:})
45 varargout{1} = getInfo(varargin{3});
46 return
47 end
48
49 %%% Collect input variable names
50 in_names = cell(size(varargin));
51 for ii = 1:nargin,in_names{ii} = inputname(ii);end
52
53 pli = utils.helper.collect_objects(varargin(:), 'plist', in_names);
54
55 %%% Decide on a deep copy or a modify
56 %%% REMARK: If you create a new AO (call the constructor) then
57 %%% it is not necessay to copy the input-AOs !!!!!!!!!!!!!!!!!!!!!!!!!
58
59
60 %%% Combine plists
61 pl = combine(pli, getDefaultPlist('Range'));
62
63
64
65 %% Extract parameters from plist
66
67 f = find(pl, 'f');
68 if isempty(f)
69 f1 = find(pl, 'f1');
70 f2 = find(pl, 'f2');
71 nf = find(pl, 'nf');
72 scale = find(pl, 'scale');
73
74 switch scale
75 case 'lin'
76 f = linspace(f1, f2, nf);
77 case 'log'
78 f = logspace(log10(f1), log10(f2), nf);
79 end
80 end
81
82 source = find(pl, 'source');
83
84 %% Compute response for frequencies f
85
86 switch source
87 case 'ifo'
88 a = getIfoNoise(f);
89 case 'tm'
90 a = getTMNoise(f);
91 case 'sc'
92 a = getSCNoise(f);
93 otherwise
94 error('### Unknown noise source requested.');
95 end
96
97 varargout{1} = a;
98 end
99 %--------------------------------------------------------------------------
100 % Get IFO noise for each frequency
101 function o = getIfoNoise(f)
102
103 % Description of the noise
104 fcn = '0.5*(5e-12)^2 * ( 1 + (1+1e8)./(1+f.^2/1e-12) .* (1 + (1+9e6)./(1+f.^2/1e-14) ))';
105 % Pack in a plist
106 pl = plist('fsfcn', fcn, 'f', f);
107
108 % Build AO from plist
109 o = ao(pl);
110 o.setName('o_nxx', 'internal');
111 o.setXunits('Hz');
112 o.setYunits('m^2/Hz');
113 end
114 %--------------------------------------------------------------------------
115 % Get SC noise for each frequency
116 function o = getSCNoise(f)
117
118 % Zeros as constant factors
119 z1 = 1 + (10e-3/1e-6)^2;
120 z2 = 1 + (0.1e-3/0.1e-6)^2;
121 % AOs for frequency-dependent parts
122 p1 = ao(plist('fsfcn', '1 + (f./100).^2', 'f', f));
123 p2 = ao(plist('fsfcn', '1 + (f/1e-6).^2', 'f', f));
124 p3 = ao(plist('fsfcn', '1 + (f/0.1e-6).^2', 'f', f));
125
126 % Combine the parts
127 G = (0.1e-6/436)^2;
128 o = G .* (1./p1 + (z1./p2).*(1 + z2./p3 ));
129
130 % Set properties of final AO
131 o.setName('A_nxx', 'internal');
132 o.setXunits('Hz');
133 o.setYunits('m^2s^{-4}/ Hz');
134
135 end
136 %--------------------------------------------------------------------------
137 % Get TM noise for each frequency
138 function o = getTMNoise(f)
139
140 % Construct the various parts of the spectrum
141
142 % zeros
143 z1 = ao(plist('fsfcn', '(1 + (f./100).^2)', 'f', f));
144 z2 = (1 + (3e-3/1e-6).^2);
145 z3 = ao(plist('fsfcn', '(1 + (f./1e-6).^2)', 'f', f));
146 z4 = (1 + (0.1e-3./0.1e-6).^2);
147 z5 = ao(plist('fsfcn', '(1 + (f./0.1e-6).^2)', 'f', f));
148
149 % poles
150 p1 = (1 + (1e-3./100).^2);
151 p2 = (1 + (3e-3./1e-6).^2);
152 p3 = (1 + (1e-3./1e-6).^2);
153 p4 = (1 + (0.1e-3./0.1e-6).^2);
154 p5 = (1 + (1e-3./0.1e-6).^2);
155
156 % Combine the parts
157 o = (30e-15)^2 .* ( (1./z1 + z2./z3.*(1 + z4./z5)) ./ (1./p1 + p2./p3.*(1 + p4./p5)));
158
159 % Set properties of final AO
160 o.setName('A_1xx', 'internal');
161 o.setXunits('Hz');
162 o.setYunits('m^2s^{-4}/ Hz');
163
164 end
165 %% Default parameters
166 function plo = getDefaultPlist(varargin)
167 % List of available parameter sets
168 sets = {'List', 'Range'};
169 if nargin == 0
170 plo = sets;
171 return
172 end
173 set = varargin{1};
174 switch set
175 case 'List'
176 plo = plist('source', 'ifo', 'f', [1]);
177 case 'Range'
178 plo = plist('source', 'ifo', ...
179 'f1', 1e-6,...
180 'f2', 5,...
181 'nf', 1000,...
182 'scale', 'log');
183 otherwise
184 plo = plist();
185 end
186 end
187
188 %--------------------------------------------------------------------------
189 function ii = getInfo(varargin)
190 if nargin == 1 && strcmpi(varargin{1}, 'None')
191 sets = {};
192 pl = [];
193 else
194 sets = {'Default'};
195 pl = getDefaultPlist;
196 end
197 % Build info object
198 ii = minfo(mfilename, 'CLASS', '', 'CATEGORY', '$Id: ltpda_mdc1_input_noises.m,v 1.2 2008/08/08 13:35:23 anneke Exp $', sets, pl);
199 end