quadprog output: this problem is non-convex

3 ビュー (過去 30 日間)
Changhe
Changhe 2024 年 8 月 14 日
コメント済み: Walter Roberson 2024 年 8 月 14 日
I am trying to solve a quadratic optimization problem but quadprog keeps telling me that my problem is non-convex.
After several experiments, I found that the problem comes from the equation constraints matrix A, which is a 57250*57441 matrix.
For the following code,
[m, n] = size(A);
assert(m < n);
options = optimoptions('quadprog','Display','off');
[Pwp,fval,exitflag,output] = quadprog(speye(n), zeros(n,1), [], [], A, zeros(m, 1), [], [], [], options);
obviously the solution should be the all-zero vector. But the output still said that this is a nonconvex problem.
=============
Update: I am using matlab 2022b. Here is the link for the mat file of my matrix A:
I am sorry that it's larger than 5MB so I can only put the link here instead of directly attaching it to this post.
  11 件のコメント
Walter Roberson
Walter Roberson 2024 年 8 月 14 日
All, I was counting on the fact that there was no error message, and was not checking exitflag . exitflag is showing up as -6, non-convex problem detected.
Walter Roberson
Walter Roberson 2024 年 8 月 14 日
Unfortunately the invoked routine, ipqpsparse, is a .p file, so we cannot examine what is going on internally.

サインインしてコメントする。

採用された回答

Matt J
Matt J 2024 年 8 月 14 日
編集済み: Matt J 2024 年 8 月 14 日
I think you probably should report it as a bug, but a possible workaround would be to approximate the original problem with inequality constraints,
b=repelem(1e-10,m);
[Pwp,fval,exitflag,output] = ...
quadprog(speye(n), zeros(n,1), [A;-A], [b;b], [], [], [], [], [], options);

その他の回答 (1 件)

Torsten
Torsten 2024 年 8 月 14 日
移動済み: Torsten 2024 年 8 月 14 日
Maybe there are Inf or NaN coefficients in your A ? The following small example works.
A = rand(53,66);
[m,n] = size(A);
options = optimoptions('quadprog','Display','off');
[Pwp,fval,exitflag,output] = quadprog(speye(n), zeros(n,1), [], [], A, zeros(m, 1), [], [], [], options)
Pwp = 66x1
1.0e-13 * -0.0955 -0.1044 -0.0355 0.0400 0.0122 0.1021 -0.0133 0.0133 -0.0910 0.1088
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
fval = 3.2638e-27
exitflag = 1
output = struct with fields:
message: 'Minimum found that satisfies the constraints....' algorithm: 'interior-point-convex' firstorderopt: 2.0437e-16 constrviolation: 3.1306e-14 iterations: 1 linearsolver: 'sparse' cgiterations: []
  6 件のコメント
Changhe
Changhe 2024 年 8 月 14 日
Thanks a lot. I will do it in a minute.
Changhe
Changhe 2024 年 8 月 14 日
I have added the link for A.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by