📄 dtarray.m
字号:
function [d_M, M_,M]=dtarry(A,y)
% function dtarry(A) is to find the input delay matrix, d_M,
% and the diagonal decoupling matrix, M_ ;and the invertable delay matrix M
% when the process has the original delay matrix of A.
% The process with the additional input delay form a new process that can be decoupled.
% (M_ actually represent the non invertable part, M+, of the new process to be used
% in the controller implementation) (M+ is an invalid variable name)
if nargin < 2, y = []; end
[m,n]=size(A);
if m~=n error('The matrix must be square'); end
temp1=iscell(A);
if temp1 % Take care in case that A is cell array
temp=zeros(n,n);
for i=1:n
for j=1:n
temp(i,j)=mt2dt(A{i,j},y);
end
end
A=temp;
end
small_d=min(d_vector(A));
Tau=zeros(n,n);
for i=1:n
for j=1:n
Tau(i,j)=min(d_vector(minor(A,i,j)));
end
end
M_=max((small_d-Tau)');
d_M=max(diag(M_)*ones(n,n)-A);
M=(ones(n,n)*diag(d_M)+A)-diag(M_)*ones(n,n);
if temp1 % if input is cell array, so does output
temp=cell(n,n);
for i=1:n
for j=1:n
temp{i,j}=M(i,j);
end
end
M=temp;
end
function a=d_vector(A)
% This function is a helper function for the dtarry function.
% It compute the d_vector defined to be a vector of the posible
% delays terms resulting from taking the determinant of the square
% delay matrix.
[m,n]=size(A);
if n==1
a=A;
else
a=[];
for i=1:n
a=[a A(1,i)+d_vector(minor(A,1,i))];
end
end
return
function A=minor(A,i,j)
A(i,:)=[];
A(:,j)=[];
return
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -