linprog gives wrong solution?

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?

 采纳的回答

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 个评论

Fortunately, this is not a new math just my mistake in the calculation. Thanks

请先登录,再进行评论。

更多回答(0 个)

类别

Community Treasure Hunt

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

Start Hunting!

Translated by