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.7 2008/08/18 08:07:56 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.7 2008/08/18 08:07:56 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 no ''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 no ''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   if nargout == 2
0087     varargout{1} = a1;
0088     varargout{2} = a2;
0089   elseif nargout == 1
0090     varargout{1} = [a1 a2];
0091   end
0092 end
0093 
0094 %--------------------------------------------------------------------------
0095 % Get DF controller for each frequency
0096 function [a1, a2] = computeAcc(w1, w3, delta, o1, o12, ao_invars)
0097 
0098   if isa(w1,'ao')
0099     w1 = w1.data.y;
0100   end
0101   if isa(w3,'ao')
0102     w3 = w3.data.y;
0103   end
0104 
0105   %---- compute a1
0106   pl = plist('Omega2', w1);
0107   a1 = mdc1_x2acc(o1, pl);
0108   % Add history
0109   a1.addHistory(getInfo, pl, ao_invars, [o1.hist o12.hist]);
0110   % Set AO name
0111   a1.setName(sprintf('%s(%s,%s)', mfilename, ao_invars{1}, ao_invars{2}), 'internal');
0112 
0113   % compute a2
0114   pl   = plist('Omega2', w3);
0115   wd   = w3-w1; % omega_delta
0116   a2 = wd.*o1 - delta.*mdc1_x2acc(o1, pl) + mdc1_x2acc(o12, pl);
0117   % Add history
0118   a2.addHistory(getInfo, pl, ao_invars, [o1.hist o12.hist]);
0119   % Set AO name
0120   a2.setName(sprintf('%s(%s,%s)', mfilename, ao_invars{1}, ao_invars{2}), 'internal');
0121 end
0122 
0123 %--------------------------------------------------------------------------
0124 % Get Info Object
0125 %--------------------------------------------------------------------------
0126 function ii = getInfo(varargin)
0127   if nargin == 1 && strcmpi(varargin{1}, 'None')
0128     sets = {};
0129     pl   = [];
0130   else
0131     sets = {'Default'};
0132     pl   = getDefaultPlist;
0133   end
0134   % Build info object
0135   ii = minfo(mfilename, 'ao', '', 'MDC1', '$Id: mdc1_ifo2acc_inloop.m,v 1.7 2008/08/18 08:07:56 hewitson Exp $', sets, pl);
0136 end
0137 
0138 %--------------------------------------------------------------------------
0139 % Get Default Plist
0140 %--------------------------------------------------------------------------
0141 function pl_default = getDefaultPlist()
0142   pl_default = plist(...
0143     'Omega1', 1.3e-6, ...
0144     'Omega3', 2e-6, ...
0145     'delta', -1e-4);
0146 end
0147

Generated on Mon 25-Aug-2008 22:39:29 by m2html © 2003