# How to programmatically check optimisation status in JuMP \>= 0.19

**URL:** https://discourse.julialang.org/t/how-to-programmatically-check-optimisation-status-in-jump-0-19/26289
**Category:** Optimization (Mathematical)
**Created:** [July 12, 2019, 1:47pm UTC](https://discourse.julialang.org/t/how-to-programmatically-check-optimisation-status-in-jump-0-19/26289 "2019-07-12T13:47:06Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)
#### Post date: [July 12, 2019, 1:47pm UTC](https://discourse.julialang.org/t/how-to-programmatically-check-optimisation-status-in-jump-0-19/26289/1 "2019-07-12T13:47:06Z")

</div>

Which is the equivalent of `status=solve(model); if status == :Optimal` in JuMP \>= 0.19 ?

`optimize!(model); if termination_status(model) == ????`

---

<div class="post-metadata">

### Author: ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)
#### Post date: [July 12, 2019, 1:50pm UTC](https://discourse.julialang.org/t/how-to-programmatically-check-optimisation-status-in-jump-0-19/26289/2 "2019-07-12T13:50:02Z")

</div>

> [@sylvaticus](#):
>
> termination\_status

got it:

`termination_status(model) == MOI.OPTIMAL`

a bit more complicated 😉

---

<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 12, 2019, 2:04pm UTC](https://discourse.julialang.org/t/how-to-programmatically-check-optimisation-status-in-jump-0-19/26289/3 "2019-07-12T14:04:41Z")

</div>

Here are the relevant docs: [Query Solutions · JuMP](http://www.juliaopt.org/JuMP.jl/v0.19.2/solutions/#Obtaining-solutions-1)
