I integrated fault current which is sine wave with its time period as an interval. But, i am getting value as an answer instead of getting 0.
Ältere Kommentare anzeigen

F=0.05
ix = (Phasecurrent.Time >= F) & (Phasecurrent.Time <=F+0.020047);
Int = cumtrapz(Phasecurrent.Data(ix))
vpa(Int(end))
ans =
137031976.93982961773872375488281
4 Kommentare
Paul
am 7 Jan. 2024
What does this command show:
Int = cumtrapz(PhaseCurrent.Time(idx),Phasecurrent.Data(ix))
Dyuman Joshi
am 7 Jan. 2024
Bearbeitet: Dyuman Joshi
am 7 Jan. 2024
In addition to Madhan's answer, also note that cumtrapz() is a numerical approximation instead of a proper integral and the data points you have do not seem to be smooth enough - there are slight unsmoothness (for a lack of a better phrase) near the maximas and minimas.
So even after using correct syntax, the answer might not be exactly 0.
A Lumbini
am 8 Jan. 2024
Paul
am 8 Jan. 2024
Why not just implement it in Simulink? Use a Clock, two Compare to Constant blocks, and an AND to output signal that is 1 (or true) over the desired interval and 0 otherwise. Multiply that signal with signal to be integrated and send that product into an Integrator. Make sure to use a variable step solver with zero crossing detection turned on, at least for the Compare to Constant and AND blocks, if not for the whole model.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Signal Generation finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

