Use Sign function in JuMP

question

#1

Dear all,

I’m solving a MINLP problem in JuMP which contains a nonlinear constraint like this:

y = x^2*sign(x) #both x and y are continuous.

Previously, I used Couenne through AmplNLWriter interface and got an error of “Unrecognized function sign used in nonlinear expression.” Do you know how to fix this problem?

Thanks in advance.


#2

Did you also try y == x * abs(x)?


#3

Hi @leethargo. The expression y==x*abs(x) works. Thank you.