📄 ismpbalanced.m
字号:
function fval = ismpbalanced(sys)%ISMPBALANCED True if the given system is balanced.%% ISMPBALANCED(SYS) returns 1 if (A,B,C) is minimum-phase balanced and 0% otherwise. SYS has to be an SS or IDSS object. The system is% minimum-phase balanced iff the controllability gramian Wc of SYS is% equal to the observability gramian Wo of inv(SYS).%% See also GRAM, SS, IDSS, MPBAL, BALREAL, ISBALANCED.%% CUED System Identification Toolbox.% Cambridge University Engineering Department.% Copyright (C) 1998-2002. All Rights Reserved.% Version 1.00, Date: 01/06/2002% Created by H. Chen and E.C. Kerrigan.if isa(sys,'idss') sys = ss(sys.a,sys.b,sys.c,sys.d,sys.Ts);elseif ~isa(sys,'ss') error('The given system is not an SS or IDSS object.')endWc = gram(sys,'c'); % Controllability Gramian of SYSWo = gram(inv(sys),'o'); % Observability Gramian of inv(SYS)tol = 1e3*eps; % A small toleranceif norm(Wc-Wo) > tol if nargout == 0 disp(sprintf('System is not minimum-phase balanced; norm(Wc(SYS)-Wo(inv(SYS))) = %4.2e.',norm(Wc-Wo))) else fval = 0; endelse if nargout == 0 disp(sprintf('System is minimum-phase balanced; norm(Wc(SYS)-Wo(inv(SYS))) = %4.2e.',norm(Wc-Wo))) else fval = 1; endend
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -