# A question about BilevelJuMP.jl

**URL:** <https://discourse.julialang.org/t/a-question-about-bileveljump-jl/43336>\
**Category:** Optimization (Mathematical)\
**Tags:** question\
**Created:** [July 19, 2020, 3:41pm UTC](https://discourse.julialang.org/t/a-question-about-bileveljump-jl/43336 "2020-07-19T15:41:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abcde](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abcde/32/16180_2.png) [@abcde](https://discourse.julialang.org/u/abcde)\
**Post date:** [July 19, 2020, 3:41pm UTC](https://discourse.julialang.org/t/a-question-about-bileveljump-jl/43336/1 "2020-07-19T15:41:09Z")

</div>

```julia
using JuMP, BilevelJuMP, Xpress

model = BilevelModel()

@variable(Lower(model), x)
@variable(Upper(model), y)

@objective(Upper(model), Min, 3x + y)
@constraints(Upper(model), begin
    x <= 5
    y <= 8
    y >= 0
end)

@objective(Lower(model), Min, -x)
@constraints(Lower(model), begin
     x + y <= 8
    4x + y >= 8
    2x + y <= 13
    2x - 7y <= 0
end)

optimize!(model, Xpress.Optimizer(), BilevelJuMP.SOS1Mode())

objective_value(model) # = 3 * (3.5 * 8/15) + 8/15
value(x) # = 3.5 * 8/15
value(y) # = 8/15

```

![image](https://global.discourse-cdn.com/julialang/original/3X/6/a/6ace7141519b4818d29c44dfbfe77e7eb228c0f8.png)  
Run the example in the readme file. What is the cause of this error

---

<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:** [July 19, 2020, 5:49pm UTC](https://discourse.julialang.org/t/a-question-about-bileveljump-jl/43336/2 "2020-07-19T17:49:11Z")

</div>

Please don’t post the same question twice: [KKT condition solves the bilevel optimization problem - #7 by abcde](https://discourse.julialang.org/t/kkt-condition-solves-the-bilevel-optimization-problem/43289/7).
