Jump quadratic problem

Hello all,

I am solving a simple quadratric problem of the form

x* = argmin  0.5 x'Qx + x'q
#                     x   
#                     s.t. l1 ≤ Ax ≤ u1

my code is as follows:

        model = Model(HiGHS.Optimizer)
        @variable(model, x[1:n] >= 0)
        @objective(model, Min, 0.5*x'*Q*x+x'*q)
        @constraint(model, l1<=A*x<=u1)
        optimize!(model)

but it is giving me the error nrecognized constraint building format. Tried to invoke `build_constraint(error, AffExpr[], Float64[], Float64[])`, but no such method exists. This is due to specifying an unrecognized function, constraint set, and/or extra positional/keyword arguments.

Any help will be appreciated. Thank you

1 Like

You need l1 .<= A * x .<= u1

Documentation: Constraints · JuMP

But we should improve the error message.

2 Likes

Just to follow up, the error message will be improved in a future release of JuMP: Fix error message for vectorized interval constraints by odow · Pull Request #3123 · jump-dev/JuMP.jl · GitHub