KNITRO/Octave interface

199 views
Skip to first unread message

Daniel Sacks

unread,
Jun 24, 2013, 9:27:33 AM6/24/13
to casadi...@googlegroups.com
Hello, 

I am a doctoral student at the University of Pennsylvania and I am using Octave for my dissertation. The built in solver is not really adequate for me so I am looking for something about stronger, and I am considering Knitro and IPOPT. Can you say how well these programs work with Octave? I understand that CasADi has an Octave interface and can use Knitro and IPOPT in the backend, but did you write your own c++ file to handle that, or is it possible to use the .mex files from Knitro/ipopt?

Thanks,

Dan

Joel Andersson

unread,
Jun 24, 2013, 11:35:00 AM6/24/13
to casadi...@googlegroups.com
Dear Dan,

CasADi is written in C++ and all the interfaced solvers are interfaced on the C++ level. This includes the interfaces to IPOPT and KNITRO. The front-end to Octave (generated using SWIG, www.swig.org) sits on top of this. I'm not aware of any .mex files from KNITRO/IPOPT, but afaik, there are no .mex files involved in the interface. The interface talkes to Octave's C++ API directly, without .mex. The easiest is probably to follow the installation instructions, then you'll see what you need.

There are a few things you should be aware of: 

First of all, CasADi is not intended to be an KNITRO/IPOPT wrapper for Octave. The user only needs to provide the objective/constraint functions and all the rest is automatically generated. This only works if your NLP is constructed using CasADi's symbolic syntax. You cannot just pass an existing Octave function for the NLP and expect it to work well.

Secondly, you ask about both KNITRO and IPOPT. Out of these two, IPOPT is currently the most used by far and also has the most stable interface to CasADi. It is also free for all use (also commercial). There is also a third NLP solver that you might be interested in, namely WORHP, which is free for academic use. All NLP solvers use the same syntax, so its easy to switch between them for the same problem, if you manage to install them (which can be a bit tricky).

The last thing is about the Octave interface. The Octave interface to CasADi is feature complete, but it is not widely used or particularly well documented. You will probably uncover a lot of bugs also. I would recommend you to try out CasADi for Python first. It has binary installers that already includes for example IPOPT, so installation is much easier. Performance-wise, it does not matter if you use CasADi from C++, Octave or Python. After we saw that people didn't seem to have any major difficulties learning Python, we have focused our efforts on this interface.

I hope this makes it more clear! Good luck with your dissertation!
Joel
Reply all
Reply to author
Forward
0 new messages