fsgb.m

来自「包含大量遗传算法程序」· M 代码 · 共 37 行

M
37
字号
function k=fsgb(w,f,index,gains);
%FSGB   Normalizes system and manipulates singular values.
%       FSGB(W,F,index) calculates a constant pre-compensator K,
%       that normalizes the system at the frequency W(index) and
%       balances all the singular values of F(index)*K to the maximum
%       singular value of F at W(index).
%
%       FSGB(W,F,index,Gains) calculates a constant pre-compensator
%       K, that normalizes the system at the frequency W(index) and
%       multiplies the singular values of F(index)*K by Gains*svd(F(index)).
%       Where Gains is a vector of the same length as svd(F(index)).
%
%       Note the K returned may be complex. It is up to the designer
%       to decide if the real or the imaginary part should be used for
%       the pre-compensator.

% Copyright (c) 1987 by GEC Engineering Research Centre & Cambridge Control Ltd

nargs = nargin;            % Perform error checking on the number of
error(nargchk(3,4,nargs)); %  input arguments.

[fc,wc]=fgetf(w,f,index);  % Pick out the required component matrix
[yf, sf, uf] = svd(fc);    % Perform a singular value decomposition
			   %  at the required frequency.
if nargs <= 4
  gain= sf(1,1);           % If GAINS is not given, the gain added to
  gain = inv(sf./gain);    % each locus is calculated.
end

if nargs == 4              % Form GAINS into a diagonal matrix
  gain = diag(gains);
end

% Form the compensator.
k = uf * gain * yf';       % Calculate the resulting compensator.

⌨️ 快捷键说明

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