linprog gives wrong solution?
Show older comments
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?
Accepted Answer
More Answers (0)
Categories
Find more on Solver Outputs and Iterative Display in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!