I’m trying to optimize a function with absolute constraints on its variable (a<=|x|<=b), but I don’t know how to replace function “abs” in JuMP constraint or variable.
At first I wrote this one, where x_min and x_max are two known 1*2 array:
myModel = Model(GLPK.Optimizer)
@variable(myModel, x_min[i] <= abs(x[i = 1:2]) <= x_max[i])
But it turns out that abs cannot be used in variable. I also tried to add constraint with abs, but that also failed.
I know that I can write -b<=x<=b to replace |x|<=b, but how should I deal with a<=|x|?