# \`solve(::OptimizationProblem)\`: ub argument not quite respected

**URL:** <https://discourse.julialang.org/t/solve-optimizationproblem-ub-argument-not-quite-respected/118393>\
**Category:** Modelling & Simulations\
**Created:** [August 19, 2024, 11:39pm UTC](https://discourse.julialang.org/t/solve-optimizationproblem-ub-argument-not-quite-respected/118393 "2024-08-19T23:39:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cstjean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cstjean/32/1444_2.png) [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Post date:** [August 19, 2024, 11:39pm UTC](https://discourse.julialang.org/t/solve-optimizationproblem-ub-argument-not-quite-respected/118393/1 "2024-08-19T23:39:20Z")

</div>

I have a fairly benign `Optimization.OptimizationProblem` (over an MTK problem). Passing `lb, ub` clearly works, but I encountered a case today where the output was

```julia
retcode: Success
u: 3×2 Matrix{Float64}:
 10.0 15.0
 18.025 14.0
 13.0 13.0

```

In spite of having an `ub` of `fill(17, 3, 2)`. I.e. the upper bound isn’t respected and it still yields “success”. Is that expected? I’m using `OptimizationOptimJL.NelderMead`.

---

<div class="post-metadata">

**Author:** ![Vaibhavdixit02](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vaibhavdixit02/32/2916_2.png) [@Vaibhavdixit02](https://discourse.julialang.org/u/Vaibhavdixit02)\
**Post date:** [August 20, 2024, 12:09am UTC](https://discourse.julialang.org/t/solve-optimizationproblem-ub-argument-not-quite-respected/118393/2 "2024-08-20T00:09:33Z")

</div>

That’s not expected, but without reproducible example it’s hard to diagnose. It could also be an issue at the solver level in which case trying another one on the same problem might help in understanding it better.
