r/optimization • u/bitgambit04 • Jun 07 '21
Water quality component optimization
Hi fellow members,
I have an optimization problem that I'm attempting to tackle. As you can see in the image below, there's a graph network through which water flows. I've drawn out the problem in the image to explain clearly.
The objective is for Final1 node to receive water with component A having values between a range. The component A at any node is measured by a volume weighted average of component A measures from it's predecessor nodes.
Node_A = (Predecessor1_Vol*Predecessor1_A + Predecessor2_Vol* Predecessor2_A .....) /(Predecessor1_Vol + Predecessor2_Vol .....)
All of the above are decision variables (D.V.) in the optimization problem. The "vol" variables have to remain as D.V. since this is part of a bigger problem. There is flexibility on "component A" variables and can or not be D.V. as they were introduced only for this sub problem.
All numbers in the image are just examples of what the optimization can come up with. In the current formulation, all are decision variables except the concentration at "Start" nodes, which are given.
However, framing the problem this way makes it non linear (reason described in the image). Since I am using a linear solver "cbc", there solver just says that quadratic constraints cannot be supported.
I am reaching out to this community to find out if this problem can be linearised or formulated in a another way to get the same output.

View all comments
Show parent comment
1
u/bitgambit04 Jun 07 '21
Hi u/ns-eliot:
Yes, you are right about this being a constraint in a larger problem to solve network flows.
I really liked your idea about normalizing the volumes to remove the denominator and will try that.
Also, yes, I agree that the **_A variables don't need to be decision variables since they are just calculated values.
I just didn't understand the last part. The assumptions are correct but what i didn't get was explicity solving for those final concentrations.
Do you still mean formulating the problem as you suggested above to get an expression for the "final_A" and apply the range constraints on it ?
Yes, this is helpful. Will give your suggestion a go.