MIMO_ML_ModelCompatibility

PURPOSE ^

SYNOPSIS ^

function [Theta0, Sel, ModelVar] = MIMO_ML_ModelCompatibility(Theta0, Sel, ModelVar);

DESCRIPTION ^

 function [Theta0, Sel, ModelVar] = MIMO_ML_ModelCompatibility(Theta0, Sel, ModelVar);

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

    Input/Output parameters

        Theta0                =    starting value plant, noise, and initial conditions parameters
                                Theta0 = struct('A', [], 'B', [], 'Ig', [])
                                    Theta0.A = 1 x (OrderA+1)
                                        Theta0.A(r) = coefficient a(r-1) of Omega^(r-1) 
                                    Theta0.B = ny x nu x (OrderB+1)
                                        Theta0.B(i,j,r) = coefficient b(i,j,r-1) of Omega^(r-1)
                                    Theta0.Ig = ny x (OrderIg+1)
                                        Theta0.Ig(i,r) = coefficient ig(i,r-1) of Omega^(r-1) 

        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, 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 [Theta0, Sel, ModelVar] = MIMO_ML_ModelCompatibility(Theta0, Sel, ModelVar);
0002 %
0003 % function [Theta0, Sel, ModelVar] = MIMO_ML_ModelCompatibility(Theta0, 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 %        Theta0                =    starting value plant, noise, and initial conditions parameters
0010 %                                Theta0 = struct('A', [], 'B', [], 'Ig', [])
0011 %                                    Theta0.A = 1 x (OrderA+1)
0012 %                                        Theta0.A(r) = coefficient a(r-1) of Omega^(r-1)
0013 %                                    Theta0.B = ny x nu x (OrderB+1)
0014 %                                        Theta0.B(i,j,r) = coefficient b(i,j,r-1) of Omega^(r-1)
0015 %                                    Theta0.Ig = ny x (OrderIg+1)
0016 %                                        Theta0.Ig(i,r) = coefficient ig(i,r-1) of Omega^(r-1)
0017 %
0018 %        Sel                    =    selects the parameters to be estimated; 1 = estimated; 0 = known
0019 %                                Sel = struct('A', [], 'B', [], 'Ig', [])
0020 %                                    Sel.A = 1 x (OrderA+1)
0021 %                                        Sel.A(r) = 1 if coeff. a(r-1) is unknown
0022 %                                        Sel.A(r) = 0 if coeff. a(r-1) = 0
0023 %                                    Sel.B = ny x nu x (OrderB+1)
0024 %                                        Sel.B(i,j,r) = 1 if coeff. b(i,j,r-1) is unknown
0025 %                                        Sel.B(i,j,r) = 0 if coeff. b(i,j,r-1) = 0
0026 %                                    Sel.Ig = ny x (OrderIg+1)
0027 %                                        Sel.Ig(i,r) = 1 if coeff. ig(i,r-1) is unknown
0028 %                                        Sel.Ig(i,r) = 0 if coeff. ig(i,r-1) = 0
0029 %
0030 %        ModelVar            =    contains the information about the model to be identified
0031 %                                structure with fields 'Transient', 'ThePlane', 'TheModel', 'Reciprocal'
0032 %                                    ModelVar = struct('Transient', [], 'PlantPlane', [], 'Struct', [], 'Reciprocal', [])
0033 %                                    ModelVar.Transient        =    1 then the initial conditions of the plant and/or noise are estimated
0034 %                                    ModelVar.PlantPlane        =    plane of the plant model
0035 %                                                                    's':    continuous-time;
0036 %                                                                    'w':    sqrt(s)-domain
0037 %                                                                    'z':    discrete-time;
0038 %                                                                    '':        plane not defined
0039 %                                    ModelVar.Struct            =    model structure
0040 %                                                                    'EIV':  errors-in-variables (noisy input-output data)
0041 %                                                                    'OE':    generalised output error (known input, noisy output)
0042 %                                    ModelVar.RecipPlant        =    1 if plant model is reciprocal: G(i,j) = G(j,i)
0043 %                                    ModelVar.nu                =    number of inputs
0044 %                                    ModelVar.ny                =     number of outputs
0045 %                                    ModelVar.na                =    order polynomial A
0046 %                                    ModelVar.nb                =     order matrix polynomial B
0047 %                                    ModelVar.nig            =    order vector polynomial Ig
0048 %
0049 %
0050 % Copyright (c) Rik Pintelon, Vrije Universiteit Brussel - dept. ELEC, November 2009
0051 % All rights reserved.
0052 % Software can be used freely for non-commercial applications only.
0053 %
0054 
0055 
0056 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
0057 % initialisation variables %
0058 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
0059 
0060 ny = ModelVar.ny;    % number of outputs
0061 nu = ModelVar.nu;    % number of inputs
0062 
0063 % if no starting values are available Theta0 is empty
0064 try
0065     if ~isstruct(Theta0) || isempty(Theta0.B) || isempty(Theta0.Ig);
0066         NoParam = 1;           % no theta parameters available
0067     else
0068         NoParam = 0;           % theta parameters available
0069     end % if
0070 catch
0071     NoParam = 0;               % no theta parameters available
0072 end
0073 
0074 
0075 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0076 % if no transient terms are estimated then the plant transient parameters do not exist %
0077 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0078 
0079 if ~ModelVar.Transient
0080     Sel.Ig = zeros(ny,1);
0081     if ~NoParam
0082         Theta0.Ig = zeros(ny,1);
0083     end % if theta parameter available
0084 end % if no transient
0085 
0086 
0087 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0088 % imposes the common plant model parameter structure for the reciprocal case %
0089 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0090 
0091 if ModelVar.RecipPlant    
0092 
0093     for jj = 1:nu                            % column index
0094         for ii = 1+jj:ny                    % row index
0095             lji = jj + ny*(ii-1);            % block position coefficients b(jj,ii) polynomial
0096 
0097             % reciprocity plant model
0098             if lji <= nu*ny                    % test for rectangular matrices
0099                 Sel.B(jj,ii,:) = zeros(size(Sel.B(jj,ii,:)));
0100                 if ~NoParam
0101                     Theta0.B(jj,ii,:) = Theta0.B(ii,jj,:);
0102                 end % if theta parameter available
0103             end % if
0104 
0105         end % ii
0106     end % jj
0107 
0108 end % if reciprocal plant
0109 
0110 
0111 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0112 % add the model orders to ModelVar %
0113 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0114 
0115 ModelVar.na = size(Sel.A,2) - 1;    % order polynomial A
0116 ModelVar.nb = size(Sel.B,3) - 1;    % order matrix polynomial B
0117 ModelVar.nig = size(Sel.Ig,2) - 1;    % order vector polynomial Ig

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