isstable.m

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

M
66
字号
function [fval,lambda] = isstable(model,data)%BILIN/ISSTABLE   Determines whether a bilinear system is stable.%%   ISSTABLE(M,DATA) is true if the bilinear system M satsifies a%   "stability" condition and false if it does not.%%   [FVAL,LAMBDA] = ISSTABLE(M,DATA) returns FVAL = 1 if the bilinear system%   M satsifies a "stability" condition and FVAL = 0 if it does not. LAMBDA%   is the associated largest singular value and FVAL = 1 iff LAMBDA < 1.%%   M has to be given as a BILIN object and DATA is an IDDATA%   object. DATA.InputData should contain the input data.%%   See also BILIN, IDDATA.%% 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 nargin < 2 | isempty(data)  error('DATA not specified in call to BILIN/ISSTABLE.')endA = model.A;N = model.N;u = data.InputData;u = u(:,1:size(model.B,2))';[ra,ca]=size(A);[ru,cu]=size(u);Lam = zeros(cu,1);for i=1:cu  temp = zeros(ra,ca);  for j=1:ru	temp = temp+u(j,i)*N(:,(j-1)*ra+1:j*ra);  end    Lam(i) = max(svd((A+temp)));endlambda = max(Lam);if nargout < 1  if lambda < 1	disp(sprintf('The system satisfies the stability condition: Lambda = %1.2e < 1.',lambda))  else	disp(sprintf('The system does not satisfy the stability condition: Lambda = %1.2e >= 1.',lambda))  endelse  if lambda < 1	fval = 1;  else	fval = 0;  endend	% *** last line of isstable.m ***

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?