Matlab code for calculating integral absolute error(IAE)
39 views (last 30 days)
Show older comments
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 Comment
Image Analyst
on 11 Apr 2015
Edited: Image Analyst
on 11 Apr 2015
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.
Answers (0)
See Also
Categories
Find more on PID Controller Tuning in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!