# Jump quadratic problem

**URL:** <https://discourse.julialang.org/t/jump-quadratic-problem/89475>\
**Category:** Optimization (Mathematical)\
**Tags:** jump\
**Created:** [October 29, 2022, 4:59am UTC](https://discourse.julialang.org/t/jump-quadratic-problem/89475 "2022-10-29T04:59:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muhammad\_Nadeem](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@Muhammad\_Nadeem](https://discourse.julialang.org/u/Muhammad_Nadeem)\
**Post date:** [October 29, 2022, 4:59am UTC](https://discourse.julialang.org/t/jump-quadratic-problem/89475/1 "2022-10-29T04:59:54Z")

</div>

Hello all,

I am solving a simple quadratric problem of the form

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

```

my code is as follows:

```julia
        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

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [October 29, 2022, 5:30am UTC](https://discourse.julialang.org/t/jump-quadratic-problem/89475/2 "2022-10-29T05:30:49Z")

</div>

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

Documentation: [Constraints · JuMP](https://jump.dev/JuMP.jl/stable/manual/constraints/#Vectorized-constraints)

But we should improve the error message.

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [November 1, 2022, 3:34am UTC](https://discourse.julialang.org/t/jump-quadratic-problem/89475/3 "2022-11-01T03:34:25Z")

</div>

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](https://github.com/jump-dev/JuMP.jl/pull/3123)
