MIMO_WTLS_ModelCompatibility

PURPOSE ^

SYNOPSIS ^

function [Sel, ModelVar] = MIMO_WTLS_ModelCompatibility(Sel, ModelVar);

DESCRIPTION ^

 function [Sel, ModelVar] = MIMO_WTLS_ModelCompatibility(Sel, ModelVar);

    The coefficients are chosen such that Y = B/A U + Ig/A is valid

    Input/Output parameters

        Sel                    =    selects the parameters to be estimated; 1 = estimated; 0 = known 
                                Sel = struct('A', [], 'B', [], 'Ig', [])
                                    Sel.A = 1 x (OrderA+1)
                                        Sel.A(r) = 1 if coeff. a(r-1) is unknown
                                        Sel.A(r) = 0 if coeff. a(r-1) = 0
                                    Sel.B = ny x nu x (OrderB+1)
                                        Sel.B(i,j,r) = 1 if coeff. b(i,j,r-1) is unknown
                                        Sel.B(i,j,r) = 0 if coeff. b(i,j,r-1) = 0
                                    Sel.Ig = ny x (OrderIg+1)
                                        Sel.Ig(i,r) = 1 if coeff. ig(i,r-1) is unknown
                                        Sel.Ig(i,r) = 0 if coeff. ig(i,r-1) = 0

        ModelVar            =    contains the information about the model to be identified
                                structure with fields 'Transient', 'ThePlane', 'TheModel', 'Reciprocal'
                                    ModelVar = struct('Transient', [], 'PlantPlane', [], 'Struct', [], 'Reciprocal', [])
                                    ModelVar.Transient        =    1 then the initial conditions of the plant and/or noise are estimated
                                    ModelVar.PlantPlane        =    plane of the plant model
                                                                    's':    continuous-time;
                                                                    'w':    sqrt(s)-domain
                                                                    'z':    discrete-time;
                                                                    '':        plane not defined
                                    ModelVar.Struct            =    model structure
                                                                    'EIV':  errors-in-variables (noisy input-output data)
                                                                    'OE':    generalised output error (known input, noisy output)
                                    ModelVar.RecipPlant        =    1 if plant model is reciprocal: G(i,j) = G(j,i)
                                    ModelVar.nu                =    number of inputs
                                    ModelVar.ny                =     number of outputs
                                    ModelVar.na                =    order polynomial A
                                    ModelVar.nb                =     order matrix polynomial B
                                    ModelVar.nig            =    order vector polynomial Ig


 Copyright (c) Rik Pintelon, Vrije Universiteit Brussel - dept. ELEC, 25 November 2009
 All rights reserved.
 Software can be used freely for non-commercial applications only.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [Sel, ModelVar] = MIMO_WTLS_ModelCompatibility(Sel, ModelVar);
0002 %
0003 % function [Sel, ModelVar] = MIMO_WTLS_ModelCompatibility(Sel, ModelVar);
0004 %
0005 %    The coefficients are chosen such that Y = B/A U + Ig/A is valid
0006 %
0007 %    Input/Output parameters
0008 %
0009 %        Sel                    =    selects the parameters to be estimated; 1 = estimated; 0 = known
0010 %                                Sel = struct('A', [], 'B', [], 'Ig', [])
0011 %                                    Sel.A = 1 x (OrderA+1)
0012 %                                        Sel.A(r) = 1 if coeff. a(r-1) is unknown
0013 %                                        Sel.A(r) = 0 if coeff. a(r-1) = 0
0014 %                                    Sel.B = ny x nu x (OrderB+1)
0015 %                                        Sel.B(i,j,r) = 1 if coeff. b(i,j,r-1) is unknown
0016 %                                        Sel.B(i,j,r) = 0 if coeff. b(i,j,r-1) = 0
0017 %                                    Sel.Ig = ny x (OrderIg+1)
0018 %                                        Sel.Ig(i,r) = 1 if coeff. ig(i,r-1) is unknown
0019 %                                        Sel.Ig(i,r) = 0 if coeff. ig(i,r-1) = 0
0020 %
0021 %        ModelVar            =    contains the information about the model to be identified
0022 %                                structure with fields 'Transient', 'ThePlane', 'TheModel', 'Reciprocal'
0023 %                                    ModelVar = struct('Transient', [], 'PlantPlane', [], 'Struct', [], 'Reciprocal', [])
0024 %                                    ModelVar.Transient        =    1 then the initial conditions of the plant and/or noise are estimated
0025 %                                    ModelVar.PlantPlane        =    plane of the plant model
0026 %                                                                    's':    continuous-time;
0027 %                                                                    'w':    sqrt(s)-domain
0028 %                                                                    'z':    discrete-time;
0029 %                                                                    '':        plane not defined
0030 %                                    ModelVar.Struct            =    model structure
0031 %                                                                    'EIV':  errors-in-variables (noisy input-output data)
0032 %                                                                    'OE':    generalised output error (known input, noisy output)
0033 %                                    ModelVar.RecipPlant        =    1 if plant model is reciprocal: G(i,j) = G(j,i)
0034 %                                    ModelVar.nu                =    number of inputs
0035 %                                    ModelVar.ny                =     number of outputs
0036 %                                    ModelVar.na                =    order polynomial A
0037 %                                    ModelVar.nb                =     order matrix polynomial B
0038 %                                    ModelVar.nig            =    order vector polynomial Ig
0039 %
0040 %
0041 % Copyright (c) Rik Pintelon, Vrije Universiteit Brussel - dept. ELEC, 25 November 2009
0042 % All rights reserved.
0043 % Software can be used freely for non-commercial applications only.
0044 %
0045 
0046 
0047 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
0048 % initialisation variables %
0049 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
0050 
0051 ny = ModelVar.ny;    % number of outputs
0052 nu = ModelVar.nu;    % number of inputs
0053 
0054 
0055 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0056 % if no transient terms are estimated then the plant transient parameters do not exist %
0057 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0058 
0059 if ~ModelVar.Transient
0060     Sel.Ig = zeros(ny,1);
0061 end % if no transient
0062 
0063 
0064 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0065 % imposes the common plant model parameter structure for the reciprocal case %
0066 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0067 
0068 if ModelVar.RecipPlant    
0069 
0070     for jj = 1:nu                            % column index
0071         for ii = 1+jj:ny                    % row index
0072             lji = jj + ny*(ii-1);            % block position coefficients b(jj,ii) polynomial
0073 
0074             % reciprocity plant model
0075             if lji <= nu*ny                    % test for rectangular matrices
0076                 Sel.B(jj,ii,:) = zeros(size(Sel.B(jj,ii,:)));
0077             end % if
0078 
0079         end % ii
0080     end % jj
0081 
0082 end % if reciprocal plant
0083 
0084 
0085 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0086 % add the model orders to ModelVar %
0087 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0088 
0089 ModelVar.na = size(Sel.A,2) - 1;    % order polynomial A
0090 ModelVar.nb = size(Sel.B,3) - 1;    % order matrix polynomial B
0091 ModelVar.nig = size(Sel.Ig,2) - 1;    % order vector polynomial Ig

Generated on Thu 07-Jun-2012 11:58:58 by m2html © 2005