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!