how to solve a linear least square problem with non-linear constraint
5 views (last 30 days)
Show older comments
Hi,
I am trying to solve a linear least square optimization problem but with a nonlinear constraint. Neither quadprog nor lsqlin could deal with nonlinear constraint. I could only try fmincon, but it is quite slow. Could anyone give me a suggestion?
The problem I am trying to solve is just like the standard form of quadratic programming problem, but with a constraint that x(1)^2+x(2)^2=1.
0 Comments
Answers (1)
John D'Errico
on 4 Jan 2016
It is a nonlinear constraint. What do you expect? Magic?
I'll offer a hint. Use a transformation. If you know that
x(1)^2 + x(2)^ = 1
then can you transform the problem, eliminating the constraint completely? (Yes.)
x(1) = cos(t)
x(2) = sin(t)
So optimize over the single parameter t. Your constraint is built directly into the problem, implicit in the transformation.
The problem will still be nonlinear, but you no longer have a constraint at all to deal with. Not magic, but far simpler to solve, and since you have one less parameter, a reduced space to search.
2 Comments
John D'Errico
on 6 Jan 2016
Of course a quadratic form will be efficient to solve. But you don't have a simple quadratic programming problem.
You might look at yalmip (on the FEX.)
See Also
Categories
Find more on Linear Least Squares in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!