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

📄 fssvim2.m

📁 控制系统计算机辅助设计——MATLAB语言与应用(源代码)
💻 M
字号:
function V = fssvim2(w,G,blocks,weight1,weight2)
%FSSVIM2 Structured Singular Value Interaction Measure (2-block).
%        V = fssvim2(w,G,blocks,weight1,weight2)
%
%
% The SSVIM of G is computed relative to the structure specified in
% the vector 'blocks'. Only 2-block structures are supported, and
% the simple weighting of Nett and Uthgenannt (1988) is assumed.
%
% The SSVIM is useful for control structure design.
%
% Inputs:          w = frequency vector
%                  G = MVFR matrix whose SSVIM is computed (square)
%             blocks = structure vector of positive integers, with
%                      length(blocks)==2, and sum(blocks)=max(fsize(w,G))
%            weight1 = 1x1 MVFR matrix : weight on first block
%            weight2 = 1x1 MVFR matrix : weight on second block.
%
%    Defaults:  If max(size(weight))==1, a constant value is used.
%               If a weight is omitted, 1 is assumed.
%
% Outputs:         V = 1x1 MVFR matrix which is the SSVIM.

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

nargchk(nargin,3,5);
[gm,gl] = fsize(w,G);
if gm ~= gl,
  error('System not square')
end
if sum(blocks) ~= gm,
  error('Sum of block sizes must equal system size')
end

if nargin < 4,
  weight1 = 1;  % Default
  disp('Weight1 assumed to be 1 by default. (FSSVIM2)')
end
if nargin < 5,
  weight2 = 1;  % Default
  disp('Weight2 assumed to be 1 by default. (FSSVIM2)')
end
if max(size(weight1)) == 1,
  weight1 = weight1 * ones(length(w),1);  % Make it an MVFR matrix
  disp('Weight1 the same at each frequency. (FSSVIM2)')
elseif min(size(weight1)) > 1,
  error('Weight1 is not a 1x1 MVFR matrix')
end
if max(size(weight2)) == 1,
  weight2 = weight2 * ones(length(w),1);  % Make it an MVFR matrix
  disp('Weight2 the same at each frequency. (FSSVIM2)')
elseif min(size(weight2)) > 1,
  error('Weight2 is not a 1x1 MVFR matrix')
end
weight1 = weight1(:);    weight2 = weight2(:); % Ensure column vectors
weight1 = abs(weight1);  weight2 = abs(weight2);

if length(blocks) == 2,          % Only case supported here.
  % Split G into sub-blocks :
  block1 = 1:blocks(1);
  block2 = blocks(1)+1:gm;
  G11 = fpart(w,G,block1,block1);
  G12 = fpart(w,G,block1,block2);
  G21 = fpart(w,G,block2,block1);
  G22 = fpart(w,G,block2,block2);
  % Find the singular values of G21*inv(G11) & G12*inv(G22) :
  s1 = fsvd(w,fmulf(w,G21,finv(w,G11)));
  s2 = fsvd(w,fmulf(w,G12,finv(w,G22)));
  % Keep only the largest ones :
  s1 = s1(:,1);   s2 = s2(:,1);
  % Form the product of weights with s1 and s2 (NB all 1x1 MVFR) :
  V = weight1 .* weight2 .* s1 .* s2;
  V = sqrt(V);
else
  error('Only 2-block structures supported.')
end

⌨️ 快捷键说明

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