Skip to content

FAQ: Ipopt is for nonlinear programming (NLP). Can I use it also for LLS, NLS, QP, etc. problems?

András Retzler edited this page Oct 21, 2022 · 2 revisions

The NLP formulation is very general, and you can formulate any kind of problem with nlpsol that fits into it:

image

Of course a linear least squares problem also fits into this, and you can solve it with CasADi and Ipopt, but unless you have a good reason to do so, you should probably use A\b (see mldivide or numpy.linalg.lstsq).

For QPs, CasADi has a specific interface: qpsol, see here. It's then best to use any of the QP solvers available.

In general, use a solver specific for a problem type for best (and fastest) results. CasADi + Ipopt is nevertheless nice for quick prototyping, sometimes it's faster to implement a problem in Opti as an NLP than using the specific solver.

Clone this wiki locally