# How to get the status of optimization of Julia Ipopt as an output?

**URL:** https://discourse.julialang.org/t/how-to-get-the-status-of-optimization-of-julia-ipopt-as-an-output/2881
**Category:** Optimization (Mathematical)
**Created:** [March 26, 2017, 2:25am UTC](https://discourse.julialang.org/t/how-to-get-the-status-of-optimization-of-julia-ipopt-as-an-output/2881 "2017-03-26T02:25:29Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Angshuman\_Goswami](https://avatars.discourse-cdn.com/v4/letter/a/aca169/32.png) [@Angshuman\_Goswami](https://discourse.julialang.org/u/Angshuman_Goswami)
#### Post date: [March 26, 2017, 2:25am UTC](https://discourse.julialang.org/t/how-to-get-the-status-of-optimization-of-julia-ipopt-as-an-output/2881/1 "2017-03-26T02:25:29Z")

</div>

I am running MPC with Julia Ipopt+JuMP in ROS. I want to get the output of the MPC along with the status of optimization. Sometimes the MPC is infeasible, my value gets stuck in the previous output and hence this will help me create a Boolean loop.

---

<div class="post-metadata">

### Author: ![huckl3b3rry87](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/huckl3b3rry87/32/3163_2.png) [@huckl3b3rry87](https://discourse.julialang.org/u/huckl3b3rry87)
#### Post date: [March 28, 2017, 11:00pm UTC](https://discourse.julialang.org/t/how-to-get-the-status-of-optimization-of-julia-ipopt-as-an-output/2881/2 "2017-03-28T23:00:34Z")

</div>

this documentation is very good  
[https://jump.readthedocs.io/en/latest/quickstart.html](https://jump.readthedocs.io/en/latest/quickstart.html)

```julia
status=solve(mdl)

```

---

<div class="post-metadata">

### Author: ![Angshuman\_Goswami](https://avatars.discourse-cdn.com/v4/letter/a/aca169/32.png) [@Angshuman\_Goswami](https://discourse.julialang.org/u/Angshuman_Goswami)
#### Post date: [April 6, 2017, 1:55am UTC](https://discourse.julialang.org/t/how-to-get-the-status-of-optimization-of-julia-ipopt-as-an-output/2881/3 "2017-04-06T01:55:56Z")

</div>

Thanks for the reply. I am trying to do string compare and have numeric outputs for different status like 1 for infeasible but I am getting errors.

tic()  
status = solve(mdl)  
toc()  
ismatch(status,“Infeasible”)  
if ismatch(status,“Infeasible”)  
status = 1  
println(“Veh cannot move”)  
end

I am getting the following error:  
ERROR: LoadError: MethodError: `ismatch` has no method matching ismatch(::Symbol, ::ASCIIString)  
Closest candidates are:  
ismatch(!Matched::Regex, ::AbstractString)  
ismatch(!Matched::Regex, ::AbstractString, !Matched::Integer)

---

<div class="post-metadata">

### Author: ![pkofod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pkofod/32/2179_2.png) [@pkofod](https://discourse.julialang.org/u/pkofod)
#### Post date: [April 6, 2017, 9:46am UTC](https://discourse.julialang.org/t/how-to-get-the-status-of-optimization-of-julia-ipopt-as-an-output/2881/4 "2017-04-06T09:46:14Z")

</div>

> [@Angshuman\_Goswami](#):
>
> Thanks for the reply. I am trying to do string compare and have numeric outputs for different status like 1 for infeasible but I am getting errors.
> 
> tic()  
> status = solve(mdl)  
> toc()  
> ismatch(status,“Infeasible”)  
> if ismatch(status,“Infeasible”)  
> status = 1  
> println(“Veh cannot move”)  
> end
> 
> I am getting the following error:  
> ERROR: LoadError: MethodError: ismatch has no method matching ismatch(::Symbol, ::ASCIIString)  
> Closest candidates are:  
> ismatch(!Matched::Regex, ::AbstractString)  
> ismatch(!Matched::Regex, ::AbstractString, !Matched::Integer)

Why does the following code fail?

```julia
ismatch(:a, "a")

```

---

<div class="post-metadata">

### Author: ![adowling2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adowling2/32/539_2.png) [@adowling2](https://discourse.julialang.org/u/adowling2)
#### Post date: [April 6, 2017, 7:04pm UTC](https://discourse.julialang.org/t/how-to-get-the-status-of-optimization-of-julia-ipopt-as-an-output/2881/5 "2017-04-06T19:04:21Z")

</div>

Does

```julia
if( status == :Infeasible )

```

work?

---

<div class="post-metadata">

### Author: ![Angshuman\_Goswami](https://avatars.discourse-cdn.com/v4/letter/a/aca169/32.png) [@Angshuman\_Goswami](https://discourse.julialang.org/u/Angshuman_Goswami)
#### Post date: [April 6, 2017, 8:01pm UTC](https://discourse.julialang.org/t/how-to-get-the-status-of-optimization-of-julia-ipopt-as-an-output/2881/6 "2017-04-06T20:01:03Z")

</div>

Yes it worked thanks
