intlinprog returns non-optimal solution. Can you help me finding the problem?

1 回表示 (過去 30 日間)
Frederik Hesselmann
Frederik Hesselmann 2018 年 2 月 20 日
コメント済み: Nicola Blasuttigh 2021 年 12 月 1 日
I have large constraint Matrix A,b, Aeq, beq. I select an easy case where I know the solution for x (and negative cost) and I can prove true:
logical(A*x_example <= b)
logical(Aeq*x_example == beq)
logical(x_example >= lb )
logical(x_example <= ub)
But intlinprog returns a result with zero cost.
options = optimoptions('intlinprog','Display','final');
[x_sol,fval,eflag,output] = intlinprog(-f,1:length(f),A,b,Aeq,beq,lb,ub,options);
This is a my cost (positiv real) function f =
(1,1) 0.2300
(3,1) 0.1069
(4,1) 0.2700
(5,1) 0.0400
(6,1) 0.1100
(8,1) 4.0000
(15,1) 0.2300
(19,1) 4.0000
%...
(106,1) 0.2300
(108,1) 0.1069
(109,1) 0.2700
(110,1) 0.0400
(111,1) 0.1100
(113,1) 4.0000
(120,1) 0.2300
(124,1) 4.0000

回答 (1 件)

Frederik Hesselmann
Frederik Hesselmann 2018 年 2 月 21 日
編集済み: Frederik Hesselmann 2018 年 2 月 21 日
I found two Problems.
the function 'logical()' doesnt care about whether x is integer or not. The solution I have suggested is not integer. This is the reason why my test using 'logical()' wasnt correct. Checking 'isinteger(x)' is also necessary.
Though this doesnt explain why my result is wrong using 'intlinprog' but I know now that I have to look in the constraints. I found indeed that due to cutting of digits some equalities are violated. Using boundary solves the problem.
  1 件のコメント
Nicola Blasuttigh
Nicola Blasuttigh 2021 年 12 月 1 日
Hi man, sorry but probably I have the same problem about cutting digits. How do you solve it? What do you mean with boundary?
Thanks

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

カテゴリ

Help Center および File ExchangeGet Started with Optimization Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by