Home > classes > @ssm > ssm_reduced_builtIn.m

ssm_reduced_builtIn

PURPOSE ^

builds a reduced order ssm model

SYNOPSIS ^

function varargout = ssm_reduced_builtIn(varargin) %#ok

DESCRIPTION ^

 builds a reduced order ssm model
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 FUNCTION:    ssm_reduced_builtIn

 DESCRIPTION: Construct a statespace model from one of the built-in
              systems.

 CALL:        sys = ssm_reduced_builtIn(options)

 INPUT:       option : a parameter plist with 
                 - 'name' : a system name (ex 'LPF Dynamics')
                 - 'dim' : a number of dof to keep (1 for X only, 3 for X-Y-Phi)

 OUTPUT:      sys :  an array of aam object, same length as options


 VERSION:     $Id: ssmFromBuiltinSystem.m,v 1.29 2008/08/15 14:31:07 adrien Exp $

 HISTORY:     15-04-2008 Hewitson
              Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% starting initial checks

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % builds a reduced order ssm model
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % FUNCTION:    ssm_reduced_builtIn
0005 %
0006 % DESCRIPTION: Construct a statespace model from one of the built-in
0007 %              systems.
0008 %
0009 % CALL:        sys = ssm_reduced_builtIn(options)
0010 %
0011 % INPUT:       option : a parameter plist with
0012 %                 - 'name' : a system name (ex 'LPF Dynamics')
0013 %                 - 'dim' : a number of dof to keep (1 for X only, 3 for X-Y-Phi)
0014 %
0015 % OUTPUT:      sys :  an array of aam object, same length as options
0016 %
0017 %
0018 % VERSION:     $Id: ssmFromBuiltinSystem.m,v 1.29 2008/08/15 14:31:07 adrien Exp $
0019 %
0020 % HISTORY:     15-04-2008 Hewitson
0021 %              Creation
0022 %
0023 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0024 function varargout = ssm_reduced_builtIn(varargin) %#ok<INUSL>
0025 %% starting initial checks
0026 utils.helper.msg(utils.const.msg.MNAME, ['running ', mfilename]);
0027 
0028 % Check if this is a call for parameters
0029 if utils.helper.isinfocall(varargin{:})
0030   varargout{1} = getInfo(varargin{3});
0031   return
0032 end
0033 
0034 % checking number of inputs work data
0035 for i=1:nargin
0036 %   if ~isequal(class(varargin{i}),'plist')
0037 %     error(['argument is not a plist but a ', class(varargin{2})])
0038 %   end
0039 end
0040 
0041 pl(nargin)=plist;
0042 % Get default params
0043 for i=1:nargin
0044   pl(i) = combine(varargin{i}, getDefaultPlist('Default'));
0045 end
0046 sys(nargin)=ssm;
0047 
0048 
0049 for i=1:nargin
0050   %% Check the input
0051   name = find(pl(i), 'name');
0052   dim  = find(pl(i), 'dim');
0053 
0054   %% data for model reduction
0055   modelData = {...
0056     'LPF Dynamics' ,...
0057     {[1] [1 7] [1] [1] [1 7] [1 7] [1]},{ [1 7 13 19 25 31]},{ [4 10]},...
0058     { [1 2 6] [1 2 6 7 8 12]  [1 2 6] [1 2 6] [1 2 6 7 8 12]  [1 2 6 7 8 12] [1 2 6]},{ [1 2 6 7 8 12 13 14 18 19 20 24 25 26 30 31 32 36]},{ [3 4 5 9 10 11 15]};...
0059     'LPF Dynamics no params',...
0060     {[1] [1 7] [1] [1] [1 7] [1 7] [1]},{ [1 7 13 19 25 31]},{ [4 10]},...
0061     { [1 2 6] [1 2 6 7 8 12]  [1 2 6] [1 2 6] [1 2 6 7 8 12]  [1 2 6 7 8 12] [1 2 6]},{ [1 2 6 7 8 12 13 14 18 19 20 24 25 26 30 31 32 36]},{ [3 4 5 9 10 11 15]};...
0062     'MPS',...
0063     { [1 7 13]},{ [1]},{ [1]},...
0064     { [1 2 6 7 8 12 13 14 18]},{ [1 2 6]},{ [1 2 6]}; ...
0065     'TM Actuation' ,...
0066     { [1 7 13]  [1 7]},{ []},{ [1 7]},...
0067     { [1 2 6 7 8 12 13 14 18] [1 2 6 7 8 12]},{ []},{ [1 2 6 7 8 12]};...
0068     'TM Actuation cross-coupled',...
0069     { [1 7 13]  [1 7]},{ []},{ [1 7]},...
0070     { [1 2 6 7 8 12 13 14 18] [1 2 6 7 8 12]},{ []},{ [1 2 6 7 8 12]};...
0071     'Star Tracker Readout',...
0072     { [4 10]  []},{ []},{ []},...
0073     { [3 4 5 9 10 11 15] [3]},{ []},{ [3]}; ...
0074     'Inertial Sensor Readout',...
0075     { [4 10] [1 7]},{ [] },{ [1 7]},...
0076     { [3 4 5 9 10 11 15] [1 2 6 7 8 12]},{ },{ [1 2 6 7 8 12]}; ...
0077     'Inertial Sensor Readout cross-coupled',...
0078     { [4 10] [1 7]},{ [] },{ [1 7]},...
0079     { [3 4 5 9 10 11 15] [1 2 6 7 8 12]},{ },{ [1 2 6 7 8 12]}; ...
0080     'Interferometer Readout',...
0081     { [4 10] [1 4]},{ [] },{ [1 4]},...
0082     { [3 4 5 9 10 11 15] [1 3 4 6]},{ },{ [1 3 4 6]};...
0083     'Interferometer Readout cross-coupled',...
0084     { [4 10] [1 4]},{ [] },{ [1 4]},...
0085     { [3 4 5 9 10 11 15] [1 3 4 6]},{ },{ [1 3 4 6]};...
0086     'NSF Solar Pressure',...
0087     'ALL','ALL',{ [1]},...
0088     'ALL','ALL',{ [1 2 6]}; ...
0089     'NSF Infrared Disturbance',...
0090     { [1] [1]},{ []},{ [1]},...
0091     { [1 2 6] [1 2 6]},{ []},{ [1 2 6]}; ...
0092     'NSF TM Actuation Disturbance',...
0093     { [1 7] [1 7]},{ [1:4 28:31]},{ [1 7]},...
0094     { [1 2 6 7 8 12] [1 2 6 7 8 12]},{ [1:4 5:8 23:27 28:31 32:35 49:54]},{ [1 2 6 7 8 12]}; ...
0095     'NSF TM Disturbance',...
0096     { [1 7] [1 7]},{ [1:4 28:31]},{ [1 7]},...
0097     { [1 2 6 7 8 12] [1 2 6 7 8 12]},{ [1:4 5:8 23:27 28:31 32:35 49:54]},{ [1 2 6 7 8 12]}; ...
0098     'NSF TM-SC Disturbance',...
0099     { [1 7] [1 7]},{ [1:4 28:31]},{ [1 7]},...
0100     { [1 2 6 7 8 12] [1 2 6 7 8 12]},{ [1:4 5:8 23:27 28:31 32:35 49:54]},{ [1 2 6 7 8 12]}; ...
0101     'NSF Interferometer Disturbance',...
0102     { [1 4] [1 4]},{ [1 2 7 8]},{ [1 4]},...
0103     { [1 3 4 6] [1 3 4 6]},{ [1 2 5 6 7 8 11 12]},{ [1 3 4 6]}; ...
0104     'NSF Star Tracker Disturbance',...
0105     { [] []},{ },{ []},...
0106     { [3] [3]},{ },{ [3]}; ...
0107     'NSF Inertial Sensor Disturbance',...
0108     { [1 7] [1 7]},{ [1:3 19:21]},{ [1 7]},...
0109     { [1 2 6 7 8 12] [1 2 6 7 8 12]},{ [1:3 4:6 16:18 19:21 22:24 34:36]},{ [1 2 6 7 8 12]}; ...
0110     'Delay Star Tracker Readout',...
0111     { []},{ []},{ []},...
0112     { [3]},{ [9:12]},{ [3]}; ...
0113     'Delay Inertial Sensor Readout',...
0114     { [1 7]},{ [1:4 25:28]},{ [1 7]},...
0115     { [1 2 6 7 8 12]},{ [1:4 5:8 21:24 25:28 29:32 45:48]},{ [1 2 6 7 8 12]}; ...
0116     'Delay Interferometer Readout',...
0117     { [1 4]},{ [1:4 13:16]},{ [1 4]},...
0118     { [1 3 4 6]},{ [1:4 9:12 13:16 21:24]},{ [1 3 4 6]}; ...
0119     'Testcase No Params',...
0120     { [] []},{ []},{ []},...
0121     { [] []},{ []},{ []};...
0122     'Testcase Params',...
0123     { [] []},{ []},{ []},...
0124     { [] []},{ []},{ []};...
0125     'DFACS 1 Normal Mode',...
0126     { [] [1 7] [1 4] [4 10 16 19]}, {[10:15 44:48]},{ [1 7 13]},...
0127     { [3] [1 2 6 7 8 12] [1 3 4 6] [3 4 5 9 10 11 15 16 18 19 21]}, {[7:9 10:15 16:21 39:43 44:48 49:54 71:75]},{ [1 2 6 7 8 12 13 14 18]}; ...
0128     'DFACS 2 Science Mode 1 M3',...
0129     { [] [1 7] [1 4] [4 10 16 19]}, {[19:24 51:54]},{ [1 7 13]},...
0130     { [3] [1 2 6 7 8 12] [1 3 4 6] [3 4 5 9 10 11 15 16 18 19 21]}, {[13:18 19:24 25:30 47:50 51:54 55:60 75:78]}, { [1 2 6 7 8 12 13 14 18]}; ...
0131     'DFACS 3 Science Mode 2 M1 Transition',...
0132     { [] [1 7] [1 4] [4 10 16 19]}, {[19:24 51:54]},{ [1 7 13]},...
0133     { [3] [1 2 6 7 8 12] [1 3 4 6] [3 4 5 9 10 11 15 16 18 19 21]}, {[13:18 19:24 25:30 47:50 51:54 55:60 75:78]}, { [1 2 6 7 8 12 13 14 18]}; ...
0134     'DFACS 4 Science Mode 2 M1 Performance',...
0135     { [] [1 7] [1 4] [4 10 16 19]}, {[19:24 51:56]},{ [1 7 13]},...
0136     { [3] [1 2 6 7 8 12] [1 3 4 6] [3 4 5 9 10 11 15 16 18 19 21]}, {[13:18 19:24 25:30 47:50 51:56 57:62 77:80]}, { [1 2 6 7 8 12 13 14 18]}; ...
0137     'DFACS 5 Science Mode 1 All Optical Readouts',...
0138     { [] [1 7] [1 4] [4 10 16 19]}, {[19:24 51:54]},{ [1 7 13]},...
0139     { [3] [1 2 6 7 8 12] [1 3 4 6] [3 4 5 9 10 11 15 16 18 19 21]}, {[13:18 19:24 25:30 47:50 51:54 55:60 75:78]}, { [1 2 6 7 8 12 13 14 18]} ...
0140     };
0141   %% looking for system position through list
0142   [pos, sum, value] = ssm.cellstrfind(modelData(:,1), name, 'all'); %#ok<NASGU,NASGU>
0143   if dim==1
0144     L = [2 3 4];
0145   elseif dim==3
0146     L = [5 6 7];
0147   else
0148     error(['dim should be 1 or 3 but is ', num2str(dim)])
0149   end
0150   options = plist(...
0151     'inputs', modelData{pos,L(1)},...
0152     'states', modelData{pos,L(2)} ,...
0153     'outputs', modelData{pos,L(3)} );
0154   %% building and reducing the object
0155   sys(i) = reduce_model(ssm(plist('Built-in', name)), options);
0156   %% set the history
0157   sys(i).addHistory(ssm.getInfo(['ssm.',mfilename]), pl(i) , {''}, sys(i).hist );
0158 end
0159 varargout = {sys};
0160 end
0161 
0162 function ii = getInfo(varargin)
0163   if nargin == 1 && strcmpi(varargin{1}, 'None')
0164     sets = {};
0165     pls   = [];
0166   elseif nargin == 1 && ~isempty(varargin{1}) && ischar(varargin{1})
0167     sets{1} = varargin{1};
0168     pls = getDefaultPlist(sets{1});
0169   else
0170     sets = {'Default'};
0171     pls = [];
0172     for kk=1:numel(sets)
0173       pls = [pls getDefaultPlist(sets{kk})];
0174     end
0175   end
0176   % Build info object
0177   ii = minfo(mfilename, 'ssm', '', 'STATESPACE', '$Id: resp.m,v 1.17 2008/07/22 10:22:38 ingo Exp $', sets, pls);
0178 end
0179 
0180 function plo = getDefaultPlist(set)
0181   switch set
0182     case 'Default'
0183       plo = plist('dim',1,'name',' ');
0184     otherwise
0185       error('### Unknown parameter set [%s].', set);
0186   end
0187 end

Generated on Wed 27-Aug-2008 13:30:29 by m2html © 2003