📄 isstable.m
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -