I cannot get my head around what JuMP/Ipopt is doing if I have an absolute value in the constraints. This runs and I cannot find out why:
using JuMP, Ipopt
tf=10
model = Model(Ipopt.Optimizer)
@variable(model, 0<=v)
@variable(model, x[1:tf])
@objective(model, Max, v)
@constraint(model, tryErr[k=1:tf], abs(x[k]).>=v) ###This is equivalent to OR constraints: x[k]>=v OR x[k]<=-v, how does JuMP handle it?
@constraint(model, importantCstr[k=1:tf], abs.(10.0./k.*sin(x[k])).<=0.5)###This one is the same as two constraints: -0.5<=10.0./k.*sin(x[k]) AND 10.0./k.*sin(x[k])<=0.5, OK
optimize!(model)
I found this topic introducing binary variables - but if I have binary variables, then I cannot use Ipopt. So how is JuMP handling the tryErr
constraint if the code runs?
The actual problem I am trying to solve can be interpreted as finding a maximum v
that pushes all elements of x
away from zero while keeping the importantCstr
is still satisfied. The problem is nonlinear, so using MILP solvers is out of question.