# Ipopt's "local" optimum can be very substandard

**URL:** <https://discourse.julialang.org/t/ipopts-local-optimum-can-be-very-substandard/127217>\
**Category:** Optimization (Mathematical)\
**Tags:** question, jump, ipopt\
**Created:** [March 21, 2025, 11:05am UTC](https://discourse.julialang.org/t/ipopts-local-optimum-can-be-very-substandard/127217 "2025-03-21T11:05:28Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![WalterMadelim](https://avatars.discourse-cdn.com/v4/letter/w/3e96dc/32.png) [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Post date:** [March 21, 2025, 9:58pm UTC](https://discourse.julialang.org/t/ipopts-local-optimum-can-be-very-substandard/127217/3 "2025-03-21T21:58:03Z")

</div>

I see, but  
The `cos` function is a nice function in that it belongs to C^\infty (having arbitrary orders of continuous derivative). In the first example, Ipopt gives me a local Maximum which cannot survive any slight perturbation. In this case, what is the meaning of specifying `Min` in `JuMP.@objective(NLP, Min, cos(x))`?

> [@odow](#):
>
> and it found a better solution so it returned that

I don’t think Ipopt can memorize the **best solution found so far**.  
Let’s discuss it separately [here](https://discourse.julialang.org/t/ipopt-does-not-memorize-a-best-solution-found-so-far/127244).

In the third example, my meaning was:  
Ipopt returns `3 * pi`, which is correct. But clearly `pi` is the nearest optimality, from the start value `0.0`.

One more question: is the usage in my first post correct (as expected)?  
Do I have to explicitly pass gradient and Hessian info to Ipopt? or something else?

---

_[View the full topic](https://discourse.julialang.org/t/ipopts-local-optimum-can-be-very-substandard/127217)._
