Matlab code for calculating integral absolute error(IAE)
27 次查看(过去 30 天)
显示 更早的评论
Hello, I am new on Matlab and want to find value of IAE which used for finding controller performance. I implemented fallowing code but it didn't give me correct answer.
******************
clc
clear all
close all
tp=input('Enter the time constant of process:');
dp=input('Ente the time delay:');
kp=input('Enter the gain of process:');
T=pade(tf([kp],[tp 1],'iodelay',dp),1)
% alpha= 0.1;
% lambda=0.425%max(0.2*tp,1.7*Dp)
% beta=alpha*0.25*max(tp,dp)
ti=1.046%(tp+beta)+dp^2 /(2*(lambda+dp))
kc=1.55%ti/(kp*(lambda+dp))
td=0.042%dp^2 /(2*(lambda+dp)*ti)*((ti-beta)-dp/3)+(beta*tp)/ti
% num_gc=[kc*(alpha*ti*td+ti*td) kc*(ti+alpha*td) kc]
% den_gc=[alpha*ti*td ti 0]
num_gc=[kc*ti*td kc*ti kc]
den_gc=[ti 0]
gc=tf(num_gc,den_gc)
imc=feedback(T*gc,1)
A=parallel(1,series(T,gc))
load=T/A
stepplot(load),
figure,
stepplot(imc),
s=stepinfo(imc)
E1=1/A
t=0:0.01:6;
u=ones(1,length(t));
e1=lsim(E1,u,t);
z1=trapz(t,abs(e1))
E2=tf([A-T],A)
e2=lsim(E2,u,t);
z2=trapz(t,abs(e2))
***********************
Please help me.
1 个评论
Image Analyst
2015-4-11
编辑:Image Analyst
2015-4-11
We can't read it so read this: http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup
In short, paste code, highlight code, click "{}Code" button.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 PID Controller Tuning 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!