Problem with linearization of qpsol

92 views
Skip to first unread message

Gerd

unread,
Oct 30, 2020, 6:26:02 AM10/30/20
to CasADi
Dear Joris,

I found out, that qpsol automatically linearises the problem if the objective is not linear or the constraints are not linear ( https://web.casadi.org/docs/#high-level-interface ). I tried to use this great feature for my problem but the solution is not correct. I made up a short (hopefully meaningful) example to show what I mean https://gist.github.com/steradiant/f1432c8a8e8748d39366348baa7d6fc4
I declare my own linearisation and compare it with the qpsol internal linearisation at the initial point (x_0). I would expect the same output but a quite different output is obtained. Is there something wrong or do I have another understanding of the 'linearisation at the initial point'?


Cheers

Joel Andersson

unread,
Dec 12, 2020, 11:42:46 PM12/12/20
to CasADi
I had a look at this and it looks like the linearization is not done at zero, always. x0 is the initial guess for the solution, so it's a different thing, really.
I'm not sure what the right behavior is - linearization at zero is better for being able to simplify expressions symbolically.
In any case, the wording in the docs are wrong.

If you want to linearize at a different point, I would just shift `x` so that the 0 corresponds to the desired linearization point.

Joel
Reply all
Reply to author
Forward
0 new messages