Error in addition of absolute values of variables.
AnsweredHi,
I am trying to add the absolute values of 16 variables. But gurobipy is throwing the following error:
TypeError: unsupported operand type(s) for +: 'GenExprAbs' and 'GenExprAbs'
How can I sum up the absolute values of variables?
0
-
Official comment
As I mentioned in my reply in the support request, the typical way to do this is to use auxiliary variables. Please see How to add a constraint which is the absolute value is smaller than a constant? for a similar question and explanation.
-
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.
Post is closed for comments.
Comments
2 comments