# Bilevel JuMP

**URL:** <https://discourse.julialang.org/t/bilevel-jump/44068>\
**Category:** Optimization (Mathematical)\
**Tags:** question\
**Created:** [August 1, 2020, 3:40am UTC](https://discourse.julialang.org/t/bilevel-jump/44068 "2020-08-01T03:40:21Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [August 1, 2020, 2:57pm UTC](https://discourse.julialang.org/t/bilevel-jump/44068/2 "2020-08-01T14:57:51Z")

</div>

Please read the first post of [Please read: make it easier to help you - #81](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757/81) to learn how to format your code correctly.

There are multiple issues.

First, you seem to want a quadratic objective with `PGm1^2`, but you are using Cbc with is a linear solver.

Second, `PGm1` is a 1x1 matrix, so you need to index it as `PGm1[1, 1]`. Do you just want it to be a scalar? Same goes for `PGm2`.

Third, it looks like you want `PGD_EX` to be a vector?Use `@variable(Upper(model), PGD_EX[1:3])`.

I suggest you read the JuMP documentation and try solving some simpler models before moving to bilevel problems: [Variables · JuMP](https://jump.dev/JuMP.jl/v0.21.1/variables/)

---

_[View the full topic](https://discourse.julialang.org/t/bilevel-jump/44068)._
