How to extract problem data from Opti object

133 views
Skip to first unread message

Truong Nghiem

unread,
Aug 22, 2018, 7:23:27 PM8/22/18
to CasADi
Hi,

I'm using Opti in CasADi 3.4.5 to construct an optimization problem and solve it. I have the need to extract / access the problem data in Opti, like: the symbolic object function, the symbolic constraints, bounds, etc. My goal is to use these functions and data for calling solvers that are not yet supported by CasADi (for example my objective function provided to that solver simply calls the corresponding CasADi function in the Opti object).  I want to reuse the Opti object because then I can easily compare different solvers, supported and unsupported by CasADi.

I looked at the methods of an Opti object, and can figure out a few relevant ones, such as: 'x' are the optimization variables, 'p' are the parameters, 'f' is the objective function, and 'g' seems to be the constraint functions. However, I don't know how 'g' is used. It seems to me that it's not simply g(x,p) <= 0. And I'm not sure about 'lam_g', 'lbg' (lower bound of g?), 'ubg' (upper bound of g?).

Is there any official document on this? Or can you briefly help understand the various data accessible from an Opti object?

Thanks!
Truong

Joris Gillis

unread,
Aug 23, 2018, 2:06:31 AM8/23/18
to CasADi
Dear Truong,

Alluding to the methods you listed, the problem specification is:

min_x f(x,p)
lbg(p)<=g(x,p)<=ubg(p)

lam_g can be ignored when extracting problem data..

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