?? sysfeedbk.m
字號:
function [Ao,Bo,Co,Do]=sysfeedbk(Af,Bf,Cf,Df,Ab,Bb,Cb,Db)
%
% [Ao,Bo,Co,Do]=convsys(A1,B1,C1,D1,A2,B2,C2,D2)
%
% This algorithm gives the closed loop state space of two state space representations
%
% | A1 B1 |
% u ==> | | ==> y
% + o | C1 D1 | |
% - | |
% | | A2 B2 | |
% |= | |= |
% | C2 D2 |
%
% The algorithm also accepts state space objects as inputs and gives out a
% state space object as output.
if ((nargin==2) && nargout>1) || ((nargin==8) && ~ismember(nargout,[0 4])) || ~ismember(nargin,[2 8])
error('Incompatible Number of inputs or outputs');
end
if (nargin==2)
if any([~isobject(A1) ~isobject(B1)])
error('State Space Objects expected as input');
else
T1=Af;
T2=Bf;
Af=T1.a;
Bf=T1.b;
Cf=T1.c;
Df=T1.d;
Ab=T2.a;
Bb=T2.b;
Cb=T2.c;
Db=T2.d;
end
else
checkcompatibility(Af,Bf,Cf,Df,'1');
checkcompatibility(Ab,Bb,Cb,Db,'2');
end
if any([(size(Cf,1)~=size(Bb,2)) (size(Cb,1) ~= size(Bf,2))])
error('Incompatible system dimensions')
end
fac = inv(eye(size(Db*Df))-Db*Df);
Ao=[Af-Bf*fac*Db*Cf -Bf*fac*Cb;
Bb*(Cf-Df*fac*Db*Cf) Ab-Bb*Df*fac*Cb];
Bo=[Bf*fac;
Bb*Df*fac];
Co=[Cf-Df*fac*Db*Cf Df*fac*Cb];
Do=Df*fac;
temps=cleanss(Ao,Bo,Co,Do);
if nargout==1
Ao=temps;
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -