Hello all,
I was trying to optimize an MILP problem using Gurobi. However, I am getting the below error.
MathOptInterface.UnsupportedAttribute{MathOptInterface.NLPBlock}: Attribute MathOptInterface.NLPBlock() is not supported by the model.
The code is given below.
using JuMP, Ipopt, DataFrames, LinearAlgebra, Gurobi, Complementarity
x0=[-1 1 3]
y0=zeros(3);
for i=1:3
y0[i]=(x0[i]-1)^2+5
end
m = Model(with_optimizer(Gurobi.Optimizer))
@variable(m, -1<=x<=3)
@variable(m, g[1:2, 1])
@variable(m, u[i=1:2],Bin)
@constraint(m, sum(u[j] for j=1:2) ==1)
@complements(m, g[1,1] == y0[1]+(x-x0[1])*(y0[1]-y0[2])/(x0[1]-x0[2]), -1<=x<=1)
@complements(m, g[2,1] == y0[2]+(x-x0[2])*(y0[2]-y0[3])/(x0[2]-x0[3]), 1<=x<=3)
@objective(m, Min, u[1]*g[1,1]+u[2]*g[2,1])
optimize!(m)
I would appreciate if anybody could explain the error and give possible way to resolve this issue. Thank you.