How can I solve infinite quadratic programs using the Optimization Toolbox?

조회 수: 15 (최근 30일)
The problem occurs if I have a quadratic:
.5*x'*H*x + f'*x
where H is indefinite (i.e. has both negative and positive eigenvalues) or negative definite and f has all zero elements. If this is the case, then the algorithm fails.
This problem does not happen when "f" has any nonzero elements.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2022년 10월 14일
편집: MathWorks Support Team 2022년 10월 14일
Please follow this link to our website to review the limitation of QUADPROG:
The solution to indefinite or negative definite problems is often unbounded. In this case, "exitflag" is returned with a negative value to show a minimum was not found. Note that when a finite solution does exist, QUADPROG may only give local minima since the problem may still be nonconvex.
Try using the FMINCON function instead. Your objective function should be structured as:
myobjfun = @(x, H, c) (.5*x'*H*x + c'*x);
If you are using a version prior to MATLAB 7.0 (R14), you will need to create an inline function:
myobjfun = inline('(.5*x'*H*x + c'*x)', 'x', 'H', 'c');
The following function file computes the gradient of the quadratic and the first derivative matrix for the constraints, which in this case is just A':
function [g, gcon] = myg(x, H, c, A)
g = H*x + c;
gcon=A';
Then, FMINCON can be called using:
[x,optout] = fmincon(myobjfun, x0, A, b, [], [], lb, ub, @myg)
In general, QUADPROG should be preferred over FMINCON when possible, but for some particular problems, QUADPROG will not work.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Quadratic Programming and Cone Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by