# Find which constrains are violated in an IPOPT JuMP model

**URL:** https://discourse.julialang.org/t/find-which-constrains-are-violated-in-an-ipopt-jump-model/78228
**Category:** Optimization (Mathematical)
**Tags:** package, jump
**Created:** [March 21, 2022, 5:13pm UTC](https://discourse.julialang.org/t/find-which-constrains-are-violated-in-an-ipopt-jump-model/78228 "2022-03-21T17:13:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![this\_josh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/this_josh/32/42679_2.png) [@this\_josh](https://discourse.julialang.org/u/this_josh)
#### Post date: [March 21, 2022, 5:13pm UTC](https://discourse.julialang.org/t/find-which-constrains-are-violated-in-an-ipopt-jump-model/78228/1 "2022-03-21T17:13:53Z")

</div>

I have a model I’m trying to optimise which is returning “LOCALLY\_INFEASIBLE”. When using a linear solver like Gurobi at this point I’d compute conflicts, I appreciate this isn’t possible when working with a non-linear Ipopt model. But is it possible to easily find which constraints were being violated at the last performed iterations? E.g.

```julia
constraint_violation(model)

```

---

<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: [March 21, 2022, 5:39pm UTC](https://discourse.julialang.org/t/find-which-constrains-are-violated-in-an-ipopt-jump-model/78228/2 "2022-03-21T17:39:14Z")

</div>

See

[https://jump.dev/JuMP.jl/stable/manual/solutions/#Checking-feasibility-of-solutions](https://jump.dev/JuMP.jl/stable/manual/solutions/#Checking-feasibility-of-solutions)

---

<div class="post-metadata">

### Author: ![this\_josh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/this_josh/32/42679_2.png) [@this\_josh](https://discourse.julialang.org/u/this_josh)
#### Post date: [March 22, 2022, 8:35am UTC](https://discourse.julialang.org/t/find-which-constrains-are-violated-in-an-ipopt-jump-model/78228/3 "2022-03-22T08:35:31Z")

</div>

Thanks, it turns out I was on an older version of JuMP which didn’t have this function.

Note to future me: Ensure `primal_feasibility_report` is using a similar `atol` to your solver…
