hy02xbal.m

来自「A Matlab toolbox for exact linear time-i」· M 代码 · 共 50 行

M
50
字号
% HY02XBAL - From impulse response and sequential free %            responses to a balanced state sequence.%% XBAL = hy02xbal(h,y0,delta,n,tol)%% H - first T>2*DELTA samples of the impulse response%     for MIMO (M-inputs, P-outputs) system, H is PxMxT%     for SISO system, H can be Tx1 vector% Y0 - matrix of DELTA samples long sequential free resp. %      (Y0(:,i) is such a response)% DELTA - optional finite time balancing parameter%     DELTA>LMAX+1, LMAX - upper bound on the system lag %     default: DELTA = floor(T/2) (the maximum)% N    - optional order of the system% TOL - tolerance for order selection, default 1e-7%   If TOL < 0, the SVs are plotted and an input is asked.% XBAL - finite time DELTA balanced state sequencefunction xbal = hy02xbal(h,y0,delta,n,tol)% Remove H(0) from Hif length(size(h)) == 2  T = size(h,1);  h = h(2:end);else  T = size(h,3);  h = h(:,:,2:end);endif nargin < 3 | isempty(delta)  delta = floor(T/2);end% SVD of the Hankel matrix of the Markov parameters[U,S,V] = svd(blkhank(h,delta),0);s = diag(S);% If not given, determine the orderif (nargin < 5 | isempty(tol))  tol = [];endif (nargin < 4 | isempty(n))  n = order(s,tol);end% Compute balanced state sequencesqrt_s = sqrt(1./s(1:n));xbal = (sqrt_s(:,ones(1,size(U,1))) .* U(:,1:n)') ...       * y0(1:size(U,1),:); 

⌨️ 快捷键说明

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