Filter löschen
Filter löschen

Quadratic optimization with quadratic constraints

31 Ansichten (letzte 30 Tage)
Rene
Rene am 1 Feb. 2012
Kommentiert: Steve Grikschat am 6 Jul. 2024 um 12:20
Hi everyone,
I have an optimization problem with a quadratic objective function and quadratic constraint functions AND the problem is non-convex.
Is there any Matlab function which can do this? QUADPROG and FMINCON only allow linear constraints afaik. I also tried a solver by MOSEK (<http://mosek.com/>) but this only can deal with convex problems. Is there any tool/function for the non-convex case?
Thanks! René

Akzeptierte Antwort

Steve Grikschat
Steve Grikschat am 1 Feb. 2012
Hi Rene (sorry, can't get the accent right)
You can use FMINCON to solve this problem. However, there is no dedicated input for quadratic constraints. Instead, you must formulate them as nonlinear constraints.
Since your problem is non-convex, you should probably use the interior-point algorithm. http://www.mathworks.com/help/toolbox/optim/ug/brnoxzl.html#brnpd5f
Also, since your objective and constraint functions are quadratic, you can save a lot of time by providing outputs that compute the gradients (H*x + f) and a function that computes the Hessian (of the Lagrangian, in this case).
To do this, you'll need to create functions to compute your objective and constraints, as well as setting these options:
- Algorithm to 'interior-point' - GradObj to 'on' (user-computed 1st derivatives) - GradConstr to 'on' (same) - Hessian to 'user-supplied' (user-computed 2nd derivatives) - HessFcn to a handle to a function that computes the Hessian of the Lagrangian (see this page:http://www.mathworks.com/help/toolbox/optim/ug/fmincon.html#f186882)
+Steve
  1 Kommentar
Matt J
Matt J am 18 Sep. 2020
Rene commented:
Sorry for responding that late, I had been busy with other stuff lately and just wanted to say "thank you" for your help, Steve!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (2)

Matt J
Matt J am 19 Jun. 2016
If you have single, L2-norm constraint, then this FEX submission should help,

Steve Grikschat
Steve Grikschat am 18 Sep. 2020
As of R2020b, Optimization Toolbox now has a dedicated solver for second-order cone programming, which can be used to solve quadratic constrained problems.
https://www.mathworks.com/help//optim/ug/convert-qp-to-socp.html
Function reference:
coupled with a function to make a second-order cone constraint
For an example see
  5 Kommentare
rui liu
rui liu am 6 Jul. 2024 um 3:34
Hello, if there is some methods to accelerate the SOCP computation. I try to generate C code but it says "Function 'secondordercone' not supported for code generation. if there is other methods to make the solver process quick. Thank you!
Steve Grikschat
Steve Grikschat am 6 Jul. 2024 um 12:20
C code generation for coneprog is not supported in the current release, but is on our plans (see if you can access the R2024b pre-release notes which mentions this: https://www.mathworks.com/help/releases/R2024b/optim/release-notes.html)
In the meantime, an option that can have a notable effect on the solve time is the LinearSolver option
If your linear or cone constraints are dense (many nonzeros) or have dense columns, then tuning this option may be helpful.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Systems of Nonlinear Equations finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by