📄 frd.m
字号:
function f = frd(w,g,h,k);
%FRD Return difference frequency response (MIMO).
%
% F = FRD(w,G,H,K) calculates the return difference matrix of a
% closed loop system.
%
% F = I + GKH.
%
% The calculations are performed for the system: ------- K --- G --->---
% (see the Reference Manual entry for FRD) -| |
% ----- H --<--
% The input arguments are, G the plant
% H a non-unity feedback matrix and
% K a pre-compensator. G, H and K are MVFR matrices.
% w is the associated frequency vector.
% J-M. Boyle 8th September 1987
% Copyright (c) 1987 by GEC Engineering Research Centre & Cambridge Control Ltd.
nargs = nargin;
error(nargchk(4,4,nargs)); % Check the number of input arguments
[mg,ng] = fsize(w,g);
lw = length(w);
[mh,nh]=fsize(w,h);
[mk,nk]=fsize(w,k);
if nk~=mh
error('Rows of H not equal to columns of K.')
end
if mk~=ng
error('Rows of K not equal to columns of G.')
end
if nh~=mg
error('Rows of G not equal to columns of H.')
end
id = eye(mg);
f = zeros(mg*lw,nk);
indg = 1:mg;
indk = 1:mk;
indh = 1:mh;
for i=1:lw;
gm = g(indg+mg*(i-1),:);
km = k(indk+mk*(i-1),:);
hm = h(indh+mh*(i-1),:);
f(indg+mg*(i-1),:) = id + gm*km*hm;
%F = I + GKH
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -