Filter löschen
Filter löschen

Problem is unbounded in linear programming

24 Ansichten (letzte 30 Tage)
Klaus Hajdaraj
Klaus Hajdaraj am 9 Apr. 2021
Kommentiert: Klaus Hajdaraj am 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 Kommentare
Chendi Lin
Chendi Lin am 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 am 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.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Chendi Lin
Chendi Lin am 9 Apr. 2021
Bearbeitet: Chendi Lin am 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

Kategorien

Mehr zu Get Started with Optimization Toolbox finden Sie in Help Center und File Exchange

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by