Please take a minute to review and accept our Terms of Use.
Welcome to the PLECS User Forum, where you can ask questions and receive answers from other members of the community.

Many technical questions regarding PLECS are answered on the Technical Solutions page of our website. Tutorial videos, specific application examples, and pre-recorded webinars are available on our YouTube page. Please follow us on LinkedIn for the latest Plexim news.

How to use integrator block to integrate over a switching cycle, Ts ?

0 votes

I want to integrate the inductor current for a converter over a switching cycle Ts and not the simulation clock time. How can I do that?

E.g Simulation running time = 0.1s, switching frequency = 15kHz, switching cycle Ts = 66.66e-6s, inductor current IL = 150 A. I want to integrate IL from 0 to Ts and compare the resultant value after each step to a reference charge value.

When I use the integrator block, it integrates IL from 0 to 0.1 giving the final result to be 15. But what I want is to repeatedly integrate from 0 to Ts.


asked Feb 7, 2019 by snehathakur (64 points)

1 Answer

+1 vote
Best answer

The Periodic Average block in the library periodically computes the integral over a given interval and divides it by the duration to calculate the average value. To get the integral itself, you could connect a Gain block to the output. Alternatively, you could break the library link and modify the underlying C-Script to remove the unwanted division.

answered Feb 11, 2019 by Wolfgang Hammer (397 points)
selected Feb 13, 2019 by snehathakur
Thank you Wolfgang.