Preventing division by zero

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.

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.