필터 지우기
필터 지우기

Problem is unbounded in linear programming

조회 수: 21 (최근 30일)
Klaus Hajdaraj
Klaus Hajdaraj 2021년 4월 9일
댓글: Klaus Hajdaraj 2021년 4월 9일
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
Chendi Lin
Chendi Lin 2021년 4월 9일
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 2021년 4월 9일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

Chendi Lin
Chendi Lin 2021년 4월 9일
편집: Chendi Lin 2021년 4월 9일
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

카테고리

Help CenterFile Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by