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

📄 sysfeedbk.m

📁 Two scripts are included here. 1. convsys.m - combines the state space representation of two syst
💻 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 + -