Hi
I am trying to solve a simple linear programming problem in matlab:
500x + 400y -> min
x + y >= 90
0.02x + 0.05y <= 2.7
3x + 5y <= 360
According to the manual this should solve the problem:
f = [500, 400];
A = [-1 -1; 0.02 0.05 3 5];
b = [-90 0.03*90 4*90]';
[x, fval, info] = linprog(f, A, b)
I received the answer:
x=[60 30];
fval = 4.20e4;
info=1
On the other hand, the vertices of the area of acceptable solutions and the value of the function are as follows:
xy=[60 30; 90 18; 45 45]
f = 1e4*[4.2000 5.2200 4.0500]
It looks like the actual minimum is 4.05e4. What am I doing wrong? How to interpret this result?

 채택된 답변

John D'Errico
John D'Errico 2017년 5월 22일
편집: John D'Errico 2017년 5월 22일

0 개 추천

I'm surprised that you think [45 45] is a possible solution.
.02*45 + .05*45
ans =
3.15
That is less than 2.7? Must be the new math.
Maybe you should consider if you have determined the shape of that region properly?

댓글 수: 1

Stan
Stan 2017년 5월 22일
Fortunately, this is not a new math just my mistake in the calculation. Thanks

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

추가 답변 (0개)

카테고리

질문:

2017년 5월 22일

댓글:

2017년 5월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by