Trilinear terms in objective function
AnsweredHi,
I try to model a network where the users' heat demand is (m * t) = q. q is negtive and shall be minimized.
Bounds of m are [10, 0] and bounds of t are [350, 270].
Bounds of q are [-10000, 0].
m, t and q are continuous variables.
Additionally, there shall be a minimum pressure(p) at the inlet of the users edge which shall be not below the value p_min.
p - p_min >= 0. Logically, the constraint m * (p - p_min) >= 0 should force m to be zero if p < p_min?
My objective function is min (sum(q)).
Somehow, gurobi throws an infeasible at once. I am sure my bounds are correct and the rest of the model, as well. The model is running to optimality if I leave out the constraint of m * (p - p_min) >= 0.
I also tried to define a binary ind_p [0,1] with the bigM approach. ind_p is 1 if p >= p_min and 0 if p < p_min.
Therefore, I changed the objective function to
min (sum(q * ind_p))
and deleted the constraint m * (p - p_min) >= 0.
This also leads to infeasibility. I wonder if gurobi is able to optimize "trilinear" terms as m * t * ind_p = q and if not how to relax the problem to make it work.
Thank's.
Cheers Johannes
Ps.: Example .mps for the first approach is in sp70rp50 - m_(p-pmin).mps
Example .mps for the second approach is in sp70rp50 q_ind_p.mps
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support. -
Hi Johannes,
The Knowledge Base article How do I determine why my model is infeasible? and How do I model multilinear terms in Gurobi? should be helpful.
Best regards,
Jaromił0 -
Dear Jaromił,
thank you for your comment. I have used the approach of "How do I model multilinear terms in Gurobi" where it was meaningful, so far.
The results of computeIIS() show that my bounds should not be the problems. However, I can not determine the infeasibility through it.
I added two links to a minimal network maybe that can help to find a solution for the problem.
Best regards,
Johannes
0 -
When working with nonconvex models, you should provide tight bounds to all variables participating in nonconvex terms. So it is best to set a tight lower bound for all \(\texttt{div_F0XXX_to_F0XXX}\) variables.
If the iis is not too big, could you pelase post it or attach it as you did with your other files?
0 -
Hi,
changing the bounds on "div" will also not lead to a feasibility.
Here you will find the computeIIS() *.ilp files:
sp70rp50 - m_(p-pmin).ilp = https://cloud.hawk.de/index.php/s/TGraNz885HFajzX
sp70rp50 - q_ind_p.ilp = https://cloud.hawk.de/index.php/s/cE2aiqLqQ9B4QDN
I also added the problem without included p-restrictions to show that the bounds on p are correct. The following model is just calculating the pressures losses without including them in the objective function nor in any restricting constraints.
sp70rp50.mps = https://cloud.hawk.de/index.php/s/NSSHanoWSqFS6id
sp70rp50.sol = https://cloud.hawk.de/index.php/s/NkoReWbnENdmepT
Best regards,
Johannes
0 -
Hi Johannes,
Did you try the feasRelax approach, cf. How do I determine why my model is infeasible? Maybe this gives a simpler hint of what is going wrong.
Best regards,
Jaromił0 -
Dear Jaromil,
Thank you for helping! It turned out that changing m^2 that occurres in one constraint to a new variable m2=m*m solved the issue. However the inequality constraint still does not work. I will go with the binary formulation and the m2 approach.
Cheers,
Johannes0
Post is closed for comments.
Comments
7 comments