Effacer les filtres
Effacer les filtres

Intlinprog returns 0 as the best result

1 vue (au cours des 30 derniers jours)
Mondeep maz
Mondeep maz le 12 Juin 2018
Commenté : Mondeep maz le 12 Juin 2018
I have an optimization problem consisting of 48 variables. When used milp or ga it is returning 0 as the best value eventhough i have mentioned the indices for intcon.Is there some sort of tuning that needs to be done ?
  4 commentaires
John D'Errico
John D'Errico le 12 Juin 2018
So show what you did. Apparently, you did something wrong. We cannot guess what. Or, maybe you are just interpreting the output incorrectly.
If I had to guess, you have formulated the problem incorrectly, since all solvers seem to generate the same solution. You are solving a different problem than the one you think you are solving. But all we have been told is this is a 48 variable problem, and that at least some variables are constrained to be integer. Could you possibly have set both the lower and upper bounds for your variables to 0? Maybe. How can we read your mind, or see into your computer?
Mondeep maz
Mondeep maz le 12 Juin 2018
lb =zeros(1,48); ub =zeros(1,48); for j=1:length(lb); if T_in(i)==j ub(j:j+P(i))=1; UB(i,:)= ub; end end for m = 1:length(ub) if ub(m)==1 int(m)=m; end end Intcon= int(int~=0); A = 2*ones(1,48); b(i)= round(Ereq(i)); fog = 2*RTP; [s,fval] = intlinprog(fog,[],[],[],A,Ereq(i),lb,UB(i,:));
Here is a part of my code. Just check it if there is anything wrong. The bounds are getting updated at every iteration. So for example for a certain iteration it would look like [0,0,0,0....,1,1,1,1,1...0,0,0]. Tell me if i can do this because without the Intcon part i am getting solutions.

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by