Unable to transform a quadratic constraint into a second-order cone constraint because the quadratic constraint is not strongly convex

I am using Mosek solver to solve the model below. I get the model showing but the solver is not able to display the results. Am guessing is an issue with the second order cone formulation. I will appreciate your guidance to get this working please.

using JuMP
using Mosek
using MosekTools
model= Model(Mosek.Optimizer)

Let parameter

m=15
NumVar=5
r=[0, 0, 0, 0, 0]
@variable(model, X>=0)
@variable(model, y>=0)
@variable(model, z>=0)
@variable(model, a[i=1:NumVar]>=0)
@variable(model, b[i=1:NumVar]>=0)
@variable(model, R>=0)

@objective(model, Min, X^2 + y^2-z )

#######Declare the constraints
for i in 1:NumVar
@constraint(model, -2Xa[i]-2*b[i]*y + z <=(R-r[i])^2-a[i]^2-b[i]^2)
end

@show model
print(model)
optimize!(model)
@show termination_status(model)
@show primal_status(model)
@show dual_status(model)
@show objective_value(model)
for i in 1:NumVar
println("r[$i] = ", value(r[i]))
end
@show value(X)
@show value(y)
@show value(R)

1 Like

Mosek is a conic solver, so it requires that your problem formulation is convex. Your problem is non-convex because it has bilinear terms. like X * a[i].

If you expected your problem to be convex, you should take another look at the formulation. Otherwise you could try a solver like Ipopt that can find locally optimal solutions to non-convex problems, or Gurobi, which can solve this problem to global optimality.

1 Like

Is there a way I can reformulate my non convex model to be convex or unless I get a solver that can solve non covex problem like you said earlier.

Do I need a license before using Gurobi?

No, you typically can’t reformulate nonconvex problems to be convex

And yes, Gurobi is commercial, but they have free licenses for academics.

Thank you very much