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.

Preventing division by zero

0 votes
839 views
I have created a group of blocks to calculate the power factor. But when I run it, the simulation ends with a divition by zero error. I can go and change the setting that turns division by zero into a warning, but I don't want to do that, because under other conditions I want this to be an error.

I think the division by zero is caused by the first data point in the simulation. So is there a way to tell PLECS to skip over the first data point and start analyzing from the second and on? Attached is the circuit.
asked Jun 29, 2023 by taydin (17 points)

1 Answer

0 votes
Hi there, I believe you didn't attach the model after all. But you could try using the Initial Condition block to set the problematic variable to a non-zero initial value. Alternatively, the Saturation block could be used to force a small but non-zero positive value to the problematic signal.
answered Jun 29, 2023 by Kris Eberle (1,591 points)
...