How to calculate IAE between zero-crossing
15 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Sam Chak
el 6 de Ag. de 2022
Editada: Sam Chak
el 6 de Ag. de 2022
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 comentarios
Sam Chak
el 8 de Ag. de 2022
Your IAE is increasing over time. This suggests that the error is accumulating and the output did not track the reference signal.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!