abs and mpvar^integer error in Xpress mosel

275 Views Asked by At

enter image description here

This is my code and:

enter image description here

this is error statement of code.

How can I solve those errors?

1

There are 1 best solutions below

0
On

The default implementation of abs() only accepts numbers. In order to make abs() for for expressions, you have to include the mmxnlp module. This is explained in the documentation here.

Note that this will change the type of your constraints from linctr to nlctr, so you have to change that in your code as well.

Finally, strict inequality is not supported. Instead > is interpreted as boolean operator. For a constraint you have to >=. If you really need the expressions to be different from zero then there is no other option than to use an epsilon: replace > 0 by >= eps for a small number eps.