# BiLevel with Lower Quadratic Constraints

**URL:** <https://discourse.julialang.org/t/bilevel-with-lower-quadratic-constraints/99603>\
**Category:** Optimization (Mathematical)\
**Tags:** jump, bilevel\
**Created:** [May 30, 2023, 12:31pm UTC](https://discourse.julialang.org/t/bilevel-with-lower-quadratic-constraints/99603 "2023-05-30T12:31:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JeffreySarnoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeffreysarnoff/32/1980_2.png) [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Post date:** [May 30, 2023, 12:31pm UTC](https://discourse.julialang.org/t/bilevel-with-lower-quadratic-constraints/99603/1 "2023-05-30T12:31:34Z")

</div>

As “BilevelJuMP is not able to solve problems with quadratic constraints in the lower level.” Is there a recommended way to solve bilevel optimizations where the lower level has quadratic constraints and the upper level constraints are convex? (I am all that not familiar with this stuff).

---

<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:** [May 30, 2023, 8:48pm UTC](https://discourse.julialang.org/t/bilevel-with-lower-quadratic-constraints/99603/2 "2023-05-30T20:48:44Z")

</div>

Are you asking in general, or for BilevelJuMP.jl in particular?

This is a question for @joaquimg.

---

<div class="post-metadata">

**Author:** ![JeffreySarnoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeffreysarnoff/32/1980_2.png) [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Post date:** [May 30, 2023, 10:00pm UTC](https://discourse.julialang.org/t/bilevel-with-lower-quadratic-constraints/99603/3 "2023-05-30T22:00:25Z")

</div>

Whichever is simpler to use with 15 lower vars and 9 upper vars, where some vars or lowe var expressions appear in the upper level. Or both.

---

<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:** [May 30, 2023, 10:26pm UTC](https://discourse.julialang.org/t/bilevel-with-lower-quadratic-constraints/99603/4 "2023-05-30T22:26:54Z")

</div>

It seems like BilevelJuMP doesn’t support quadratic constraints in the lower level, but it does support second-order cones.

[https://joaquimg.github.io/BilevelJuMP.jl/stable/tutorials/conic\_lower/](https://joaquimg.github.io/BilevelJuMP.jl/stable/tutorials/conic_lower/)

So reformulate your quadratic constraint into an SOC.

> **[Tips and Tricks · JuMP](https://jump.dev/JuMP.jl/stable/tutorials/conic/tips_and_tricks/#Second-Order-Cone)**
>
> Documentation for JuMP.

If you get stuck, post a reproducible example, and we can help.
