itae.m

来自「华东理工大学自动化系《控制系统分析、设计和应用》教材配套程序实例,有关说明: 」· M 代码 · 共 22 行

M
22
字号
function [ISE,IAE,ITAE]=itae(tt,yy,sp)
% calculate the step response integral criteria: ise,iae,itae
% INPUT: tt the time vactor, yy the output response vector, sp the setpoint
% OUTPUT:ISE,IAE and ITAE

% Copyright 2001-2002 ECUST. 
%   $Revision: 1.2 $  $Date: 2001/04/18 07:01:28 $

if nargin < 3, sp=1;end;% unity step signal
if length(tt) ~= length(yy) & nargin == 2
    error('The input and output must have the same length');
end;
if nargin < 2, erroe('The response data lost!');end;
tend=tt(length(tt));tsp=tt(2)-tt(1);yss=mean(yy(round(tend*0.9):tend));
if abs(yss-sp)<0.001*sp
 err=sp-yy;ISE=sum(err.^2)*tsp;
 IAE=sum(abs(err))*tsp;
 ITAE=sum(tt*abs(err)')*tsp;
else
    error('Not arrive the steady state');
end;

⌨️ 快捷键说明

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