How to setup inequality constraints

1,338 views
Skip to first unread message

tobenda

unread,
Jan 31, 2017, 8:05:19 AM1/31/17
to CasADi
Hey dear all, 

i am looking for a way to setup inequality constraints for the solver when using ipopt in the casadi example for the moving horizon estimation nonlinear programming problem. In the following is a code snippet of the mhe example shown online. 
----------------------------------------------------------------------------------------------------------------
# Build the multiple shooting constraints
g = []
for i in range(N-1):
  g.append( shooting["X",i+1] - phi(shooting["X",i],parameters["U",i],shooting["W",i]) )
----------------------------------------------------------------------------------------------------------------
This way, one can setup equality constraints. But what to do to setup inequality constraints?

And is there an other solver available other than the ipopt:
----------------------------------------------------------------------------------------------------------------
# Create the solver
opts = {"ipopt.print_level":0, "print_time": False, 'ipopt.max_iter':10}
nlpsol = nlpsol("nlpsol", "ipopt", nlp, opts)
----------------------------------------------------------------------------------------------------------------

Thanks in advance for your great help. 

Best regards. 

Joe

Joris Gillis

unread,
Feb 1, 2017, 6:47:10 AM2/1/17
to CasADi
Dear Joe,

Inequalities can be obtained by setting the entries of lbg and ubg to nonzero values:

  lbg <= g(x) <= ubg

The bounds can be infinite if you want one-sided inequalities.

Concerning other solvers, there a quite some (seed docs.casadi.org -> Solvers, e.g. http://casadi.sourceforge.net/api/html/d4/d89/group__nlpsol.html )
However, many are commericial; we ship interfaces to them but cannot ship the solver itself.


Best regards,
  Joris
Reply all
Reply to author
Forward
0 new messages