Hi everyone. I’m currently working on an SQP solver and now trying to use that to solve optimal control problem. The optimal control problems are trancripted to NLPs in the framework of JuMP, which means if I want to use my solver for the NLP, I better develop a wrapper so that my SQP solver can be used under JuMP.
The thing is my current solver needs constriants to be formulated in the form as
c(x) = 0 or
c(x) <= 0
However, I don’t really know how to transform a constraint of set saying Interval{Float64} to Lessthan(0.0) with MOI.
I tried to use MOI.transform, but it seems not able to real with nonlinear models that defined by MOI.Nonlinear.Model().
Inside my solver, constraints are defined in the form of equalities and then inequalites.
For example,
function eq_con(x) # if no equality constraint
return Float64
end
function ineq_con(x)
con1 = 3x[1]^2 - 2x[1]*x[2] + x[2]^2 - 1
return [con1]
end
add_con!(prob, eq_con, ineq_con)
It will be helpful if I can have some advice about this contraint handling. Whether it is better to do that inside of MOI, or making my solver itself able to detail with a general formated constraint, instead of strictly <=0 or =0.