Home > classes > @ao > mdc1_ifo2acc_inloop.m

mdc1_ifo2acc_inloop

PURPOSE ^

MDC1_IFO2ACC_INLOOP calculates the inloop acceleration in the time-domain.

SYNOPSIS ^

function varargout = mdc1_ifo2acc_inloop(varargin)

DESCRIPTION ^

 MDC1_IFO2ACC_INLOOP calculates the inloop acceleration in the time-domain.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: MDC1_IFO2ACC_INLOOP calculates the inloop acceleration
              in the time-domain for MDC1.

 It computes: a = DS^-1 o

 CALL:        [a1,a2] = mdc1_ifo2acc_inloop(o1,o12,pl)

 INPUTS:       o1       - time-series of the IFO output o1
               o12      - time-series of the IFO output o12

 PARAMETERS:  'Omega1'   - the square of the stiffness term for the dynamical response
                           of test-mass 1 coupling to SC [default: 1.3e-6]
              'Omega3'   - the square of the stiffness term for the dynamical response
                           of test-mass 2 coupling to SC [default: 2e-6]
              'delta'    - the cross-coupling factor of o1 into o12 [default: -1e-4]

 M-FILE INFO: Get information about this methods by calling
              >> ao.getInfo('mdc1_ifo2acc_inloop')

              Get information about a specified set-plist by calling:
              >> ao.getInfo('mdc1_ifo2acc_inloop', 'None')

 VERSION:     $Id: mdc1_ifo2acc_inloop.m,v 1.10 2008/09/05 14:15:14 hewitson Exp $

 HISTORY:     11-04-08 M Hewitson
                 Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % MDC1_IFO2ACC_INLOOP calculates the inloop acceleration in the time-domain.
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION: MDC1_IFO2ACC_INLOOP calculates the inloop acceleration
0005 %              in the time-domain for MDC1.
0006 %
0007 % It computes: a = DS^-1 o
0008 %
0009 % CALL:        [a1,a2] = mdc1_ifo2acc_inloop(o1,o12,pl)
0010 %
0011 % INPUTS:       o1       - time-series of the IFO output o1
0012 %               o12      - time-series of the IFO output o12
0013 %
0014 % PARAMETERS:  'Omega1'   - the square of the stiffness term for the dynamical response
0015 %                           of test-mass 1 coupling to SC [default: 1.3e-6]
0016 %              'Omega3'   - the square of the stiffness term for the dynamical response
0017 %                           of test-mass 2 coupling to SC [default: 2e-6]
0018 %              'delta'    - the cross-coupling factor of o1 into o12 [default: -1e-4]
0019 %
0020 % M-FILE INFO: Get information about this methods by calling
0021 %              >> ao.getInfo('mdc1_ifo2acc_inloop')
0022 %
0023 %              Get information about a specified set-plist by calling:
0024 %              >> ao.getInfo('mdc1_ifo2acc_inloop', 'None')
0025 %
0026 % VERSION:     $Id: mdc1_ifo2acc_inloop.m,v 1.10 2008/09/05 14:15:14 hewitson Exp $
0027 %
0028 % HISTORY:     11-04-08 M Hewitson
0029 %                 Creation
0030 %
0031 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0032 
0033 function varargout = mdc1_ifo2acc_inloop(varargin)
0034 
0035   % Check if this is a call for parameters
0036   if utils.helper.isinfocall(varargin{:})
0037     varargout{1} = getInfo(varargin{3});
0038     return
0039   end
0040 
0041   import utils.const.*
0042   utils.helper.msg(msg.MNAME, 'running %s/%s', mfilename('class'), mfilename);
0043   
0044   % Collect input variable names
0045   in_names = cell(size(varargin));
0046   for ii = 1:nargin,in_names{ii} = inputname(ii);end
0047 
0048   % Collect all AOs and plists
0049   [as, ao_invars] = utils.helper.collect_objects(varargin(:), 'ao', in_names);
0050   pl              = utils.helper.collect_objects(varargin(:), 'plist', in_names);
0051 
0052   % Decide on a deep copy or a modify
0053   bs = copy(as, nargout);
0054 
0055   % combine plists
0056   pl = combine(pl, getDefaultPlist());
0057 
0058   %% Extract parameters from plist
0059 
0060   % Get parameters out
0061   w1     = find(pl, 'Omega1');
0062   w3     = find(pl, 'Omega3');
0063   delta  = find(pl, 'delta');
0064   o1     = bs(1);
0065   o12    = bs(2);
0066 
0067   if ~strcmp(o1.name, 'o1')
0068     warning('!!! The name of the first input AO is not ''o1''. Are you sure this is the o1 time-series?');
0069   end
0070   if ~strcmp(o12.name, 'o12')
0071     warning('!!! The name of the second input AO is not ''o12''. Are you sure this is the o1 time-series?');
0072   end
0073 
0074   if isempty(o1.data) || isempty(o12.data)
0075     error('### Please provide two input time-series.');
0076   end
0077   if ~isequal(o1.data.x, o12.data.x)
0078     error('### The two input time-series should be computed at the same times.');
0079   end
0080 
0081 
0082   %% Compute response for frequencies f
0083 
0084   [a1, a2] = computeAcc(w1, w3, delta, o1, o12, ao_invars);
0085 
0086   a1.setYunits('m s^-2');
0087   a2.setYunits('m s^-2');
0088   
0089   if nargout == 2
0090     varargout{1} = a1;
0091     varargout{2} = a2;
0092   elseif nargout == 1
0093     varargout{1} = [a1 a2];
0094   end
0095 end
0096 
0097 %--------------------------------------------------------------------------
0098 % Get DF controller for each frequency
0099 function [a1, a2] = computeAcc(w1, w3, delta, o1, o12, ao_invars)
0100 
0101   if isa(w1,'ao')
0102     w1 = w1.data.y;
0103   end
0104   if isa(w3,'ao')
0105     w3 = w3.data.y;
0106   end
0107 
0108   %---- compute a1
0109   pl = plist('Omega2', w1);
0110   a1 = mdc1_x2acc(o1, pl);
0111   % Add history
0112   a1.addHistory(getInfo, pl, ao_invars, [o1.hist o12.hist]);
0113   % Set AO name
0114   a1.setName(sprintf('%s(%s,%s)', mfilename, ao_invars{1}, ao_invars{2}), 'internal');
0115 
0116   % compute a2
0117   pl   = plist('Omega2', w3);
0118   wd   = w3-w1; % omega_delta
0119   a2 = wd.*o1 - delta.*mdc1_x2acc(o1, pl) + mdc1_x2acc(o12, pl);
0120   % Add history
0121   a2.addHistory(getInfo, pl, ao_invars, [o1.hist o12.hist]);
0122   % Set AO name
0123   a2.setName(sprintf('%s(%s,%s)', mfilename, ao_invars{1}, ao_invars{2}), 'internal');
0124 end
0125 
0126 %--------------------------------------------------------------------------
0127 % Get Info Object
0128 %--------------------------------------------------------------------------
0129 function ii = getInfo(varargin)
0130   if nargin == 1 && strcmpi(varargin{1}, 'None')
0131     sets = {};
0132     pl   = [];
0133   else
0134     sets = {'Default'};
0135     pl   = getDefaultPlist;
0136   end
0137   % Build info object
0138   ii = minfo(mfilename, 'ao', '', utils.const.categories.mdc01, '$Id: mdc1_ifo2acc_inloop.m,v 1.10 2008/09/05 14:15:14 hewitson Exp $', sets, pl);
0139 end
0140 
0141 %--------------------------------------------------------------------------
0142 % Get Default Plist
0143 %--------------------------------------------------------------------------
0144 function pl_default = getDefaultPlist()
0145   pl_default = plist(...
0146     'Omega1', 1.3e-6, ...
0147     'Omega3', 2e-6, ...
0148     'delta', -1e-4);
0149 end
0150

Generated on Mon 08-Sep-2008 13:18:47 by m2html © 2003