how to solve a linear least square problem with non-linear constraint

5 views (last 30 days)
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.

Answers (1)

John D'Errico
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
Hengbo TANG
Hengbo TANG on 4 Jan 2016
Edited: Hengbo TANG on 4 Jan 2016
Thank you for your reply.
Of course I could just eliminate the constraint by using one angle variable instead, but the objective problem would no longer be a quadratic form. I found that to solve a quadratic problem will be much more efficient than just define a nonlinear objective problem and use fmincon() to solve it.
Maybe there is an efficient approach consider my objective function?
John D'Errico
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.)

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!