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

📄 fbrga.m

📁 控制系统计算机辅助设计——MATLAB语言与应用(源代码)
💻 M
字号:
function B = fbrga(w,G,rows,cols,lr)
%FBRGA Block Relative Gain Array
%
%        B = fbrga(w,G,rows,cols)
%        B = fbrga(w,G,rows,cols,'right')
%
%  Computes BLOCK RELATIVE GAIN ARRAY (BRGA) of G.
%
%  This is useful for the problem of control structure design.
%  The (Left) Block Relative Gain Array is defined (at each frequency) as
%               B = G(rows,cols) * [inv(G)](cols,rows).
%  The (Right) Block Relative Gain Array is defined as
%               B = [inv(G)](cols,rows) * G(rows,cols)
%  The vectors rows, cols should be of equal length, and contain
%  only positive integers. G should be square.
%  If the 5th input argument is the string 'right' (or 'r') then the
%  Right BRGA is computed, otherwise the Left BRGA is computed.

% J.M.Maciejowski, 22 February 1989.
% Copyright (C) Cambridge Control Ltd, 1989.

nargchk(nargin,4,5);
[gm,gl] = fsize(w,G);
if gm~=gl,
  disp('Warning: System not square. (FBRGA)')
end
if length(rows) ~= length(cols),
  disp('Warning: ROWS and COLS have unequal numbers of elements (FBRGA)')
end
if ~all(diff(rows)),
  disp('Warning: ROWS has repeated entries. (FBRGA)')
end
if ~all(diff(cols)),
  disp('Warning: COLS has repeated entries. (FBRGA)')
end
if max(rows) > gm,     % Row number too big
  error('Specified row number greater than # outputs')
end
if max(cols) > gl,     % Column number too big
  error('Specified column number greater than # inputs')
end

if nargin<5, lr = 'l'; end;  % Set default

Gblock = fpart(w,G,rows,cols);          % Pick out block of G
Gblocki = fpart(w,finv(w,G),cols,rows); % Pick out block of inv(G)
if lr(1)=='r',  
  B = fmulf(w,Gblocki,Gblock);   % Right BRGA
else
  B = fmulf(w,Gblock,Gblocki);   % Left BRGA  ( DEFAULT)
end;

⌨️ 快捷键说明

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