# Juniper...Solver gets only local optimum point

**URL:** <https://discourse.julialang.org/t/juniper-solver-gets-only-local-optimum-point/43676>\
**Category:** Optimization (Mathematical)\
**Created:** [July 25, 2020, 6:22pm UTC](https://discourse.julialang.org/t/juniper-solver-gets-only-local-optimum-point/43676 "2020-07-25T18:22:06Z")\
**Posts on this page:** 11\
**Page:** 1

<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 25, 2020, 6:22pm UTC](https://discourse.julialang.org/t/juniper-solver-gets-only-local-optimum-point/43676/1 "2020-07-25T18:22:06Z")

</div>

Hello there,

Congratulations on the amazing conference of 2020 at first…Let me tell you my problem briefly  
I have a non convex NLP (OPF or Optimal Power Flow) and I want to try different solvers on this problem. I decided first to try installing solvers like COUENNE but I got lost actually so until I figure my way out of this loop of installing solvers (why are not all solvers like IPOPT, Gosh) I decided to try something like Juniper since it is very easy to use with Julia  
only these two lines and I can use Juniper  
optimizer = Juniper.Optimizer  
nl\_solver = optimizer\_with\_attributes(Ipopt.Optimizer, “print\_level”=\>0)

So I used Juniper, but I get LOCALLY\_SOLVED as a termination status, and as far as I understand this solver finds the global optimal point so how can this be explained ?

thxxxx

---

<div class="post-metadata">

**Author:** ![ctkelley](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ctkelley/32/10684_2.png) [@ctkelley](https://discourse.julialang.org/u/ctkelley)\
**Post date:** [July 25, 2020, 6:40pm UTC](https://discourse.julialang.org/t/juniper-solver-gets-only-local-optimum-point/43676/2 "2020-07-25T18:40:13Z")

</div>

There are no guaranteed global optimizers that run in finite time. You might try different initiatizations or a GA, but still no guarantees.

It’s pretty good that you got an informative message at the end.

---

<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 25, 2020, 7:38pm UTC](https://discourse.julialang.org/t/juniper-solver-gets-only-local-optimum-point/43676/3 "2020-07-25T19:38:26Z")

</div>

Juniper is a local solver. It ~~does not~~ is not guaranteed to find the global optimum.

---

<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 25, 2020, 9:51pm UTC](https://discourse.julialang.org/t/juniper-solver-gets-only-local-optimum-point/43676/4 "2020-07-25T21:51:33Z")

</div>

On a related note. The only Julia-native _global_ solver that I am aware of is Alpine.jl. It is not yet working with JuMP v0.19+, but you can track that progress here, [https://github.com/lanl-ansi/Alpine.jl/pull/149](https://github.com/lanl-ansi/Alpine.jl/pull/149).

In the case of AC-OPF, last I recall, Alpine did not support trig functions yet, so it would not help you in that case.

If you switch to the rectangular voltage form of the AC-OPF you could then use Alpine or Gurobi v9 to get global optimality proofs for small to medium sized problems.

---

<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, 5:07pm UTC](https://discourse.julialang.org/t/juniper-solver-gets-only-local-optimum-point/43676/6 "2020-07-26T17:07:56Z")

</div>

What I understand so far is that if I i want to get global optimum with a rather larger system, I have to make convex relaxation and use different solvers??  
@ccoffrin

---

<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, 5:24pm UTC](https://discourse.julialang.org/t/juniper-solver-gets-only-local-optimum-point/43676/7 "2020-07-26T17:24:40Z")

</div>

> [@mayar](#):
>
> What I understand so far is that if I i want to get global optimum with a rather larger system, I have to make convex relaxation and use different solvers??

That is the most scaleable approach that I am aware of.

To my knowledge there is no off-the-self solver that can provide AC-OPF optimality proof for cases with more than 50 buses. I have seen research prototypes go up to 300 buses, larger than this the only approach I know that runs in a reasonable amount of time is to solve the non-convex problem locally with Ipopt and then get a lower bound with a convex relaxation of the problem. Depending on the specifics of the OPF problem you are considering, this can show gaps of less than 1% with just a few minutes of computation.

In most of the applications I have looked at, Ipopt’s local solutions are near optimal.

---

<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, 7:17pm UTC](https://discourse.julialang.org/t/juniper-solver-gets-only-local-optimum-point/43676/8 "2020-07-26T19:17:27Z")

</div>

I will give the rectangular formulation with Gurobi a try.  
My main objective is not the ACOPF but rather a multi objective OPF for example combining minimum losses and minimum generation cost, to make use of the great combination of formulations that PowerModels provide , will it be easy to edit code and have something with multiobjectives like that using PowerModels or currently not easy or possible ? @ccoffrin

---

<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, 7:28pm UTC](https://discourse.julialang.org/t/juniper-solver-gets-only-local-optimum-point/43676/9 "2020-07-26T19:28:55Z")

</div>

> [@mayar](#):
>
> will it be easy to edit code and have something with multiobjectives like that using PowerModels or currently not easy or possible ?

I don’t recall where JuMP is with respect to multi-objective support. @odow, can you comment? At the very least you could explore multi-objective pareto front by solving a series of single objective problems. Modification of one of [these JuMP models](https://github.com/lanl-ansi/PowerModelsAnnex.jl/tree/master/src/model) should be fairly strait forward.

---

<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 26, 2020, 7:50pm UTC](https://discourse.julialang.org/t/juniper-solver-gets-only-local-optimum-point/43676/10 "2020-07-26T19:50:03Z")

</div>

No, JuMP doesn’t have multi-objective support. It’s on my radar, but it involves some pretty broad changes.

Just scalarize the objective and solve different weights.

You could use something like `NISE`.  
[https://www.tandfonline.com/doi/abs/10.1080/03052158508902504?journalCode=geno20](https://www.tandfonline.com/doi/abs/10.1080/03052158508902504?journalCode=geno20)

I started an implementation if you want some hints:  
[https://github.com/odow/MOO.jl/blob/master/src/algorithms/nise.jl](https://github.com/odow/MOO.jl/blob/master/src/algorithms/nise.jl)

---

<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, 8:51pm UTC](https://discourse.julialang.org/t/juniper-solver-gets-only-local-optimum-point/43676/11 "2020-07-26T20:51:51Z")

</div>

SO I will concentrate on this path for me now… I will work with power models to investigate performance of the different formulations, then use to powermodelsannex to enable me to edit and put my own formulations  
Thank you so much

---

<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, 8:53pm UTC](https://discourse.julialang.org/t/juniper-solver-gets-only-local-optimum-point/43676/12 "2020-07-26T20:53:35Z")

</div>

@odow  
great work…I will definitely need this after I start being confident on my opf with different formulations… I plan to use powermodelsannex to change something like the objective function…etc
