defcon.klaxon
Lifetime Supporting Member
Hi guys,
One thing I'm running into is dividing by zero, and I'm wondering how best to deal with it.
For the coagulant chemical pump dosing, I divide a bunch of variables by total plant flow to work out pump speed. The problem is, when the plant isn't actively treating water the influent flow is exactly 0. Thus, the problem. It creates thousands of minor errors, and while it's not creating a "problem", per say, I'd really like to clean that up and keep things nice and tidy.
I was wondering if there is a better way to take care of this and how you guys have dealt with such issues. One thing I could do is put a compare block in front of the computation block, that says to only energize that rung if the influent plant flow is above 0. But I wonder if that's best practices, or more hacky. Is there a better way to deal with this?
Thanks!
One thing I'm running into is dividing by zero, and I'm wondering how best to deal with it.
For the coagulant chemical pump dosing, I divide a bunch of variables by total plant flow to work out pump speed. The problem is, when the plant isn't actively treating water the influent flow is exactly 0. Thus, the problem. It creates thousands of minor errors, and while it's not creating a "problem", per say, I'd really like to clean that up and keep things nice and tidy.
I was wondering if there is a better way to take care of this and how you guys have dealt with such issues. One thing I could do is put a compare block in front of the computation block, that says to only energize that rung if the influent plant flow is above 0. But I wonder if that's best practices, or more hacky. Is there a better way to deal with this?
Thanks!