📄 conhsv.m
字号:
function t = conhsv(s,method)%CONHSV Convert distinct Hankel singular values into estimates.%% T = CONHSV(S,METHOD) converts the distinct Hankel singular values S into% estimates T in order to remove the explicit constraints that they be% strictly positive and distinct, bearing in mind which METHOD will be% used to identify the system. The singular values have to be arranged% from the largest S(1) to the smallest S(end). If METHOD is 'ncf' or% 'pr', then the singular values must also be strictly less than 1. The% singular values can be recovered by calling S = EXTHSV(T,METHOD).%% See also EXTHSV.%% 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 ~all(s > 0) error('Hankel singular values are not strictly positive.')endn = length(s);t = s;for i=1:n-1 t(i) = s(i) - s(i+1);endif any(t == 0) error('Hankel singular values are not distinct.')end if ~all(t > 0) error('Hankel singular values are not arranged from largest to smallest.')endswitch method case{'sb','mp'} % This operation is the reverse of % t = exp(t); % s = t; % for i=n-1:-1:1 % s(i) = t(i) + s(i+1); % end t = log(t); case {'ncf','pr'} if ~all(s < 1) error('Hankel singular values are not strictly less than 1.') end % This operation is the reverse of % s = t(:); % s(1) = exp(t(1))/(1+exp(t(1))); % for i=2:n % s(i) = s(i-1) * exp(t(i))/(1+exp(t(i))); % end t(1) = log(s(1)/(1-s(1))); for i=2:n t(i) = log(s(i)/(s(i-1)-s(i))); end otherwise error('Unknown METHOD.')endt = t(:); % Vectorize
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -