# Why do I get Infeasible Solution (JuMP with Optimizer Ipopt)

**URL:** <https://discourse.julialang.org/t/why-do-i-get-infeasible-solution-jump-with-optimizer-ipopt/43141>\
**Category:** Optimization (Mathematical)\
**Created:** [July 15, 2020, 6:46pm UTC](https://discourse.julialang.org/t/why-do-i-get-infeasible-solution-jump-with-optimizer-ipopt/43141 "2020-07-15T18:46:22Z")\
**Posts on this page:** 12\
**Page:** 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:** [July 16, 2020, 5:10pm UTC](https://discourse.julialang.org/t/why-do-i-get-infeasible-solution-jump-with-optimizer-ipopt/43141/21 "2020-07-16T17:10:20Z")

</div>

~~Correct.~~ I didn’t read clearly enough.

No, both would. `@constraint(model, 0.9 <= x <= 1)` adds a `ScalarAffineFunction`-in-`Interval` constraint.

---

<div class="post-metadata">

**Author:** ![martincornejo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/martincornejo/32/13436_2.png) [@martincornejo](https://discourse.julialang.org/u/martincornejo)\
**Post date:** [July 16, 2020, 5:11pm UTC](https://discourse.julialang.org/t/why-do-i-get-infeasible-solution-jump-with-optimizer-ipopt/43141/22 "2020-07-16T17:11:45Z")

</div>

But I imagine the order is also important: `fix`ing before adding the constraints will result in an error/infeasibility?

---

<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 16, 2020, 5:15pm UTC](https://discourse.julialang.org/t/why-do-i-get-infeasible-solution-jump-with-optimizer-ipopt/43141/23 "2020-07-16T17:15:51Z")

</div>

Oops. I didn’t read your question enough. Both result in infeasibilities.

---

<div class="post-metadata">

**Author:** ![martincornejo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/martincornejo/32/13436_2.png) [@martincornejo](https://discourse.julialang.org/u/martincornejo)\
**Post date:** [July 16, 2020, 5:20pm UTC](https://discourse.julialang.org/t/why-do-i-get-infeasible-solution-jump-with-optimizer-ipopt/43141/24 "2020-07-16T17:20:29Z")

</div>

So `fix` only applies to the bounds declared with the variable

---

<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 16, 2020, 5:22pm UTC](https://discourse.julialang.org/t/why-do-i-get-infeasible-solution-jump-with-optimizer-ipopt/43141/25 "2020-07-16T17:22:09Z")

</div>

Yes. You can set variable bounds one of two ways:

```nohighlight
@variable(model, l <= x <= u)

```

or

```nohighlight
@variable(model, x)
set_lower_bound(x, l)
set_upper_bound(x, u)

```

---

<div class="post-metadata">

**Author:** ![mayar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mayar/32/16426_2.png) [@mayar](https://discourse.julialang.org/u/mayar)\
**Post date:** [July 16, 2020, 6:13pm UTC](https://discourse.julialang.org/t/why-do-i-get-infeasible-solution-jump-with-optimizer-ipopt/43141/26 "2020-07-16T18:13:30Z")

</div>

I am watching your educational video  
Thank you  
and I have another question please  
If I want to validate my ACOPF results, can I use Power World Simulator for example to do so  
Is it a good choice ?

---

<div class="post-metadata">

**Author:** ![mayar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mayar/32/16426_2.png) [@mayar](https://discourse.julialang.org/u/mayar)\
**Post date:** [July 16, 2020, 8:54pm UTC](https://discourse.julialang.org/t/why-do-i-get-infeasible-solution-jump-with-optimizer-ipopt/43141/27 "2020-07-16T20:54:56Z")

</div>

> [@martincornejo](#):
>
> ```julia
> @variable(model, x)
> 
> ```

I have been watching lecture now on convex relaxation and it explained to me the main concept so now how can I do convex relaxation for my problem…Do I have to write the code of SDP for example or can I use certain solver instead

---

<div class="post-metadata">

**Author:** ![ccoffrin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ccoffrin/32/400_2.png) [@ccoffrin](https://discourse.julialang.org/u/ccoffrin)\
**Post date:** [July 17, 2020, 2:23pm UTC](https://discourse.julialang.org/t/why-do-i-get-infeasible-solution-jump-with-optimizer-ipopt/43141/28 "2020-07-17T14:23:59Z")

</div>

> [@mayar](#):
>
> how can I do convex relaxation for my problem

I would start with one of the simplest convex relaxations. That is the SOC relaxation in the W space. The idea is, defined new voltage product variables W^R\_{i,j} + i\*W^I\_{i,j}, which will represent the complex voltage products V\_i \* V\_j. You go through your model and make these replacements,

|V\_i||V\_i| \rightarrow W\_{ii} \\ |V\_i||V\_j| cos(\theta\_i - \theta\_j) \rightarrow W^R\_{ij} \\ |V\_i||V\_j| sin(\theta\_i - \theta\_j) \rightarrow W^I\_{ij}

You then add this constraint,

(W^R\_{ij})^2 + (W^I\_{ij})^2 \leq W^R\_{ii}\*W^I\_{ii}

As a refrence implementation here is how AC and SOC models are constructed in PowerModels,

> <https://github.com/lanl-ansi/PowerModelsAnnex.jl/blob/master/src/model/opf.jl#L7>

> <https://github.com/lanl-ansi/PowerModelsAnnex.jl/blob/master/src/model/opf.jl#L141>

---

<div class="post-metadata">

**Author:** ![mayar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mayar/32/16426_2.png) [@mayar](https://discourse.julialang.org/u/mayar)\
**Post date:** [July 18, 2020, 3:21pm UTC](https://discourse.julialang.org/t/why-do-i-get-infeasible-solution-jump-with-optimizer-ipopt/43141/29 "2020-07-18T15:21:18Z")

</div>

I will try that…Thank you Dr. @ccoffrin

---

<div class="post-metadata">

**Author:** ![mayar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mayar/32/16426_2.png) [@mayar](https://discourse.julialang.org/u/mayar)\
**Post date:** [July 18, 2020, 3:21pm UTC](https://discourse.julialang.org/t/why-do-i-get-infeasible-solution-jump-with-optimizer-ipopt/43141/30 "2020-07-18T15:21:40Z")

</div>

I will try that…Thank you Dr. @ccoffrin

---

<div class="post-metadata">

**Author:** ![mayar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mayar/32/16426_2.png) [@mayar](https://discourse.julialang.org/u/mayar)\
**Post date:** [July 26, 2020, 3:46pm UTC](https://discourse.julialang.org/t/why-do-i-get-infeasible-solution-jump-with-optimizer-ipopt/43141/31 "2020-07-26T15:46:28Z")

</div>

Aha ,so I want to use the AC OPF then switch to the rectangular or maybe I will do both in parallel…so  
I used Couenne with ACOPF formulations through AmplNLWriter and I got “INFEASIBLE” ☹  
Although with the same model and equations with Ipopt, a local solution was found  
could it be something with the couenne or my model ?!

---

<div class="post-metadata">

**Author:** ![ccoffrin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ccoffrin/32/400_2.png) [@ccoffrin](https://discourse.julialang.org/u/ccoffrin)\
**Post date:** [July 26, 2020, 4:36pm UTC](https://discourse.julialang.org/t/why-do-i-get-infeasible-solution-jump-with-optimizer-ipopt/43141/32 "2020-07-26T16:36:41Z")

</div>

That sounds like a tolerance issue. Under the hood, Couenne is using Ipopt to solve the continuous problems.

[Previous page](https://discourse.julialang.org/t/why-do-i-get-infeasible-solution-jump-with-optimizer-ipopt/43141.md?page=1)
