Effacer les filtres
Effacer les filtres

Problem is unbounded in linear programming

21 vues (au cours des 30 derniers jours)
Klaus Hajdaraj
Klaus Hajdaraj le 9 Avr 2021
I have this solution for a linear programming . I have used the linprog function , but I get showed the answer : Problem is unbounded .
Please if you can help me how to fix this problem .
The code is below :
AT = [1 4 2 3;
4 5 3 1];
u = [300 400];
g = [320 510 430 300];
z = linprog(g,AT,u);
  2 commentaires
Chendi Lin
Chendi Lin le 9 Avr 2021
Hi Klaus,
Is there any missing lower bound or upper bound for the design variables?
For example, if all your design variables are non-negative, then you will have
lb = zeros(4,1);
ub = [];
z = linprog(g, AT, u, [], [], lb, ub);
Please refer to this document to see the syntax for linprog: Solve linear programming problems - MATLAB linprog (mathworks.com).
Thanks,
CD
Klaus Hajdaraj
Klaus Hajdaraj le 9 Avr 2021
Thank your for your answer !
Yes , I expect only positive values , but when I try the code with ub and lb like you suggested me , the result is 0 0 0 0.
I expect a different result , postitive non zero numbers.

Connectez-vous pour commenter.

Réponses (1)

Chendi Lin
Chendi Lin le 9 Avr 2021
Modifié(e) : Chendi Lin le 9 Avr 2021
Hi Klaus,
Because all your design variables are non-negative, you will have
AT = [1 4 2 3;
4 5 3 1];
u = [300 400];
g = [320 510 430 300];
lb = zeros(4,1);
ub = [];
z = linprog(g, AT, u, [], [], lb, ub);
Notice that, linprog solves a minimization problem. Intuitively, the result is a zero vector. To make it a maximization problem, you can use
z = linprog(-1*g, AT, u, [], [], lb, ub);
And the result is [0; 0; 128.57; 14.29] now.
Please refer to this document to see the syntax for linprog: Solve linear programming problems - MATLAB linprog (mathworks.com).
Thanks,
CD

Catégories

En savoir plus sur Get Started with Optimization Toolbox dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by