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

2 次查看(过去 30 天)
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
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 CenterFile Exchange 中查找有关 Nonlinear Optimization 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by