Both primal and dual problems are infeasible
Show older comments
I want to solve a linear optimisation problem in MatLab. But i see an error message :
Exiting: One or more of the residuals, duality gap, or
total relative error has stalled: both the primal and the dual appear to be infeasible.
My equation :
z=150*x9 + 150*x10 + 305*x11 + 100*x12 (min)
Limits :
2.5*x1 - 2.5*x2 <=1;
1.67*x1 - 1.67*x4 <=0.8;
5*x1 - 5*x5 <=1;
5*x2 - 5*x3<=1;
2.5*x2 - 2.5*x4 <=1;
5*x3 - 5*x5 <=1;
x6<=0.5;
x7<=1.65;
x8<=5.45.
Constrain:
-9.17*x1 + 2.5*x2 + 1.67*x4 + 5*x5 + x6 = 0.8;
2.5*x1 - 10*x2 + 5*x3 +2.5*x4 + x9 -x13= 2.4;
5*x2 - 10*x3 +5*x5 + x7 -x12 +x16 = 0.4;
1.67*x1 + 2.5*x2 - 4.17*x4 + x10 -x14 =1.6;
5*x1 + 5*x3 - 10*x5 + x11 + x12 - x15 -x16 =2.4;
x8 - x9 - x10 - x11 + x13 + x14+ x15 = 0.
My code in MatLab :
c=[0;0;0;0;0;0;0;0;150;150;305;100;0;0;0;0;];
A = [-9.17,2.5,0,1.67,5,1,0,0,0,0,0,0,0,0,0,0;
2.5,-10,5,2.5,0,0,0,0,1,0,0,0,-1,0,0,0;
0,5,-10,0,5,0,1,0,0,0,0,-1,0,0,0,1;
1.67,2.5,0,-4.17,0,0,0,0,0,1,0,0,0,-1,0,0;
5,0,5,0,-10,0,0,0,0,0,1,1,0,0,-1,-1;
0,0,0,0,0,0,0,1,-1,-1,-1,0,1,1,1,0;
2.5,-2.5,0,0,0,0,0,0,0,0,0,0,0,0,0,0;
1.67,0,0,-1.67,0,0,0,0,0,0,0,0,0,0,0,0;
5,0,0,0,-5,0,0,0,0,0,0,0,0,0,0,0;
0,5,-5,0,0,0,0,0,0,0,0,0,0,0,0,0;
0,2.5,0,-2.5,0,0,0,0,0,0,0,0,0,0,0,0;
0,0,5,0,-5,0,0,0,0,0,0,0,0,0,0,0;
0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0;
0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0;
0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0;
];
b = [0.8;2.4;0.4;1.6;2.4;0;1;0.8;1;1;1;1;0.5;1.65;5.45;];
[x,fval] = linprog(f,A,b)
I think, everything is true but software say to me there was an error!
Please someone help me for this subject...
1 Comment
Matt J
on 11 Oct 2016
[x,fval] = linprog(f,A,b)
I think you really meant to write linprog(c,A,b)
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!