📄 mimo2sen.m
字号:
function f=mimo2sen(x,y,E,sign,w,ps,ms,qs,order,row,col,input_delay,pds,qds)
% f=mimopartial(x,y,e,sign,w,ps,ms,qs,order,row,col,input_delay,pd)
% function to compute the the partial sensitivity function, the approximation
% of the sensitivity function, to be used for feedback controller tuning.
if iscell(E)
e=E{2};
end
if w % Define s = jw
s=sqrt(-1)*w;
else
s=sqrt(-1)*x(end);
end
n=length(order);
for i=1:n % compute the value of filter at a given s, filter time constant and order.
filter(i)=1/(e(i)*s+1)^order(i);
end
filter=diag(filter); % Make the filter become diagonal matrix
q=inv(eval(qs))*filter; % Evaluate the IMC controller at a given s.
m=eval(ms); % Evaluate the model
p=eval(ps); % Evaluate the process at a given s and x.
qd=eval(qds);
pd=eval(pds);
if any(input_delay~=0) % Take care if the control effort is delayed.(Dtarray)
delay=eye(n);
for i=1:n
delay(i,i)=exp(-input_delay(i)*s);
end
m=m*delay;
p=p*delay;
end
temp=abs((eye(n)-m*q*qd)*inv(eye(n)+(p-m)*q*qd)*pd); % kpd = pd(0)
% The magnitude of the close loop frequency response matrix.
f=sign*temp(row,col); % Pick the i,j element as the output.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -