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


#1

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.


#2

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

status=solve(mdl)

#3

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)


#4

Why does the following code fail?

ismatch(:a, "a")

#5

Does

if( status == :Infeasible )

work?


#6

Yes it worked thanks