function PolyTrans = MIMO_ML_CalcPolyTrans(Theta, x); Output parameters PolyTrans = structure containing the polynomials and transfer functions evaluated in x PolyTrans.A = denominator polynomial plant transfer function evaluated in x.Plant, size 1 x F PolyTrans.G = plant transfer matrix evaluated in x.Plant, size ny x nu x F PolyTrans.Tg = plant transient term evaluated in x.Plant, size ny x F Input parameters Theta = plant, noise, and initial conditions parameters structure with fields 'A', 'B', 'Ig' Theta = struct('A', [], 'B', [], 'Ig', []) Theta.A = 1 x (OrderA+1) Theta.A(r) = coefficient a(r-1) of x^(r-1) Theta.B = ny x nu x (OrderB+1) Theta.B(i,j,r) = coefficient b(i,j,r-1) of x^(r-1) Theta.Ig = ny x (OrderIg+1) Theta.Ig(i,r) = coefficient ig(i,r-1) of x^(r-1) x = structure containing (jwk) or (zk^-1) values x.Plant = plant model, dimension: F x 1 Copyright (c) Rik Pintelon, Vrije Universiteit Brussel - dept. ELEC, November 2009 All rights reserved. Software can be used freely for non-commercial applications only.
0001 function PolyTrans = MIMO_ML_CalcPolyTrans(Theta, x); 0002 % 0003 % function PolyTrans = MIMO_ML_CalcPolyTrans(Theta, x); 0004 % 0005 % Output parameters 0006 % 0007 % PolyTrans = structure containing the polynomials and transfer functions evaluated in x 0008 % PolyTrans.A = denominator polynomial plant transfer function evaluated in x.Plant, size 1 x F 0009 % PolyTrans.G = plant transfer matrix evaluated in x.Plant, size ny x nu x F 0010 % PolyTrans.Tg = plant transient term evaluated in x.Plant, size ny x F 0011 % 0012 % Input parameters 0013 % 0014 % Theta = plant, noise, and initial conditions parameters 0015 % structure with fields 'A', 'B', 'Ig' 0016 % Theta = struct('A', [], 'B', [], 'Ig', []) 0017 % Theta.A = 1 x (OrderA+1) 0018 % Theta.A(r) = coefficient a(r-1) of x^(r-1) 0019 % Theta.B = ny x nu x (OrderB+1) 0020 % Theta.B(i,j,r) = coefficient b(i,j,r-1) of x^(r-1) 0021 % Theta.Ig = ny x (OrderIg+1) 0022 % Theta.Ig(i,r) = coefficient ig(i,r-1) of x^(r-1) 0023 % 0024 % x = structure containing (jwk) or (zk^-1) values 0025 % x.Plant = plant model, dimension: F x 1 0026 % 0027 % 0028 % Copyright (c) Rik Pintelon, Vrije Universiteit Brussel - dept. ELEC, November 2009 0029 % All rights reserved. 0030 % Software can be used freely for non-commercial applications only. 0031 % 0032 0033 ny = size(Theta.B,1); % number of outputs 0034 nu = size(Theta.B,2); % number of inputs 0035 F = length(x.Plant); % number of frequencies 0036 0037 PolyTrans = struct('A', zeros(1,F), 'G', zeros(ny, nu, F), 'Tg', zeros(ny, F)); 0038 0039 0040 %%%%%%%%%%%%%%%% 0041 % A polynomial % 0042 %%%%%%%%%%%%%%%% 0043 0044 PolyTrans.A = polyval(fliplr(Theta.A), x.Plant.'); 0045 0046 0047 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0048 % G ny x nu plant transfer matrix % 0049 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0050 0051 for ii = 1:ny 0052 for jj = 1:nu 0053 PolyTrans.G(ii, jj, :) = polyval(fliplr(squeeze(Theta.B(ii, jj, :)).'), x.Plant.'); 0054 end % jj 0055 end % ii 0056 0057 dummy = zeros(1,1,F); 0058 dummy(1,1,:) = PolyTrans.A; 0059 PolyTrans.G = PolyTrans.G./repmat(dummy, ny, nu); 0060 0061 0062 %%%%%%%%%%%%%%%%%%%%%%%% 0063 % Plant transient term % 0064 %%%%%%%%%%%%%%%%%%%%%%%% 0065 0066 for ii = 1:ny 0067 PolyTrans.Tg(ii,:) = polyval(fliplr(Theta.Ig(ii,:)), x.Plant.'); 0068 end % ii 0069 0070 PolyTrans.Tg = PolyTrans.Tg./repmat(PolyTrans.A, ny, 1); 0071