⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ffb.m

📁 包含大量遗传算法程序
💻 M
字号:
function cltfm = ffb(w,g,k);
%FFB Closed-loop frequency response with unity feedback (MIMO). 
%
%       [CLTFM] = FFB(W,G,K) calculates the closed loop MVFR matrix.
%                CLTFM = inv(I + GK).GK
%
%       The calculations are performed for the system shown in the FFB section
%       of the MFD Reference manual. The feedback matrix H = I.
%
%       The input arguments are, G the plant and optionally
%       K a pre-compensator. Both G and K are MVFR matrices.
%       CLTFM is returned as an MVFR matrix.

%       J-M. Boyle 8th September 1987
% Copyright (c) 1987 by GEC Engineering Research Centre & Cambridge Control Ltd.

nargs=nargin;
error(nargchk(2,3,nargs));       % Check the number of input arguments.

[mg,ng] = fsize(w,g);
lw = length(w);

if nargs == 2                    % If the function has only two input
  if mg~=ng
     error('G must be square (K = I).')
  end
  k = eyef(w,ng);                  % arguments, K := I.
  mk = ng;
  nk = ng;
else
  [mk,nk] = fsize(w,k);
  if mk~=ng
    error('Outputs of K must equal inputs of G.')
  end
  if nk~=mg
    error('Outputs of G must equal inputs of K.')
  end
end
id=eye(mg);
cltfm =  zeros(mg*lw,nk);
indg = 1:mg;
indk = 1:mk;

for i=1:lw;
  gm = g(indg+mg*(i-1),:);
  km = k(indk+mk*(i-1),:);
  cltfm(indg+mg*(i-1),:) = (id + gm*km)\gm*km;
                     % CLTFM = inv(I + GK) * GK.
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -