ismpbalanced.m

来自「剑桥大学用于线性和双线性动力学系统辨识的工具箱」· M 代码 · 共 44 行

M
44
字号
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 + =
减小字号Ctrl + -
显示快捷键?