Azzera filtri
Azzera filtri

Problem is unbounded in linear programming

21 visualizzazioni (ultimi 30 giorni)
Klaus Hajdaraj
Klaus Hajdaraj il 9 Apr 2021
Commentato: Klaus Hajdaraj il 9 Apr 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 Commenti
Chendi Lin
Chendi Lin il 9 Apr 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 il 9 Apr 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.

Accedi per commentare.

Risposte (1)

Chendi Lin
Chendi Lin il 9 Apr 2021
Modificato: Chendi Lin il 9 Apr 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

Categorie

Scopri di più su Get Started with Optimization Toolbox in Help Center e File Exchange

Prodotti


Release

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by