noise_amp_e.m

来自「内模控制器(IMC)工具箱。包括参数整定、PID控制器参数转换等」· M 代码 · 共 30 行

M
30
字号
function [e]=noise_amp_e(qnummt,qdenmt,order,Na,y)
% [e]=noise_amp_e(q,qnummt,qdenmt,order,Na,y)
% This function compute the filter time constant to satisfy noise amplification.
% where 
%	qnummt	=	a matrix representing part of the process numurator to be inverted.
%	qdenmt	=	a mertix representing part of the process denominator to be inverted.
	qnum=mt2poly(qnummt,y);
	qden=mt2poly(qdenmt,y);
	l=length(qnum);
	n=length(qden);
    while qden(n)==0
    n=n-1;
end
qden=qden(1:n);
   e=(qden(1)*qnum(l)/qden(n)/qnum(1)/Na)^(1/order);
   filter=[1];
   for i=1:order
      filter=conv(filter,[e 1]);
   end
   qnum=conv(qnum,filter);
   q=tf(qden,qnum);
   [mp,w]=sigma(q);
   [max_mp,index]=max(mp);
   if max_mp/mp(1) > 1.05*Na
      temp='There is a high peak of the frequency response';
      temp=strvcat(temp,['of the controller at the frequency of' num2str(w(index))]);
      warndlg(temp);
   end

⌨️ 快捷键说明

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