Use Sign function in JuMP



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.


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


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