How to calculate IAE between zero-crossing
조회 수: 10 (최근 30일)
이전 댓글 표시
I am studying a load disturbance detection procedure presented by Hagglund.
Through simulink I have calculated the control error (it is an array) and I need to calculate the IAE between two consecutive istances of zero crossings as presented in the formula below
In simulink I used a simulation time of 30s and a sampling period of 0.001s.
the question is: how can I calculate the IAE between each zero-crossing and, after each zero-crossing, reset the IAE to 0? Next I need to plot the obtained IAE array.
댓글 수: 0
답변 (1개)
Sam Chak
2022년 8월 6일
편집: Sam Chak
2022년 8월 6일
Are you looking for a MATLAB or Simulink solution?
sys = ss([0 1; -1 -1], [0; 1], [1 0], 0);
[y, t] = step(sys, 16);
e = 1 - y;
subplot(2,1,1)
plot(t, e), grid on, xlabel('t'), ylabel('e(t)'), ylim([-0.5 1.01])
ae = abs(e);
subplot(2,1,2)
plot(t, ae), grid on, xlabel('t'), ylabel('|e(t)|'), ylim([-0.5 1.01])
J_IAE = trapz(t, ae)
To reset the IAE to 0 after each zero-crossing detection, you probably need some conditional logics. By the way, what does the reset-IAE imply after each zero-crossing detection?
댓글 수: 2
Sam Chak
2022년 8월 8일
Your IAE is increasing over time. This suggests that the error is accumulating and the output did not track the reference signal.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!