# Conditional constraint if else in JuMP

**URL:** https://discourse.julialang.org/t/conditional-constraint-if-else-in-jump/6795
**Category:** Optimization (Mathematical)
**Tags:** question
**Created:** [October 31, 2017, 8:29am UTC](https://discourse.julialang.org/t/conditional-constraint-if-else-in-jump/6795 "2017-10-31T08:29:34Z")
**Posts on this page:** 1
**Showing post:** 10

<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 4, 2020, 4:47pm UTC](https://discourse.julialang.org/t/conditional-constraint-if-else-in-jump/6795/10 "2020-05-04T16:47:17Z")

</div>

Take a read of the first post in [Please read: make it easier to help you - #11](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757/11).

It’s easier to help if you do the following:

- format your code using the triple backticks: `````
- provide a minimal working example of what you are trying to accomplish.
  - Simplify it down to one constraint, and two or three variables. Remove any redundant information.
  - It may help to provide the math formulation of your simple problem as well.

- What solver are you using? If you are trying to solve MPEC-type models, JuMP is a little behind compared to GAMS. You either have to do the reformulations manually, or using a solver like KNITRO.jl.
- You could also use a mixed-integer reformulation.

---

_[View the full topic](https://discourse.julialang.org/t/conditional-constraint-if-else-in-jump/6795)._
