Skip to content

quadform objective does not work with OSQP #709

@a7b

Description

@a7b

I was trying to solve the following QP using OSQP:

λs = [0, 0.01, 0.1, 1, 10, 100, 200, 300, 1000]
for i in eachindex(λs)
    n = size(mat, 1) - 1
    x = Variable(n)
    constraints = [sum(x) == 100000, x >= 0]
    p = minimize( 1/2 * quadform(x, Σ) - λs[i] * dot(μr, x), constraints)
    solve!(p, OSQP.Optimizer)
end

but I get the error

UnsupportedConstraint: MathOptInterface.VectorAffineFunction{Float64}-in-MathOptInterface.SecondOrderCone constraints are not supported by the
solver you have chosen, and we could not reformulate your model into a
form that is supported.

Both of the constraints can be written in the form required by OSQP but it seems that Convex.jl is unable to do this. It would be nice if this could be fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions