MATLAB: I cant solve linear programming

linear programingMATLAB

Obejctive function: f= 2.84x1 – 0.22x2-3.33x3 + 1.09x4 + 9.39x5 + 9.51x6
Constraints
1.1x1 + 0.9x2 +0.9x3+ 1.0x4 + 1.1x5 + 0.9x6 ≤ 200,000
0.5x1 + 0.35x2 +0.25x3+ 0.25x4 + 0.5x5 + 0.35x6 ≤ 100,000
0.01x1 + 0.15x2 +0.15x3+ 0.18x4 + 0.01x5 + 0.15x6 ≤ 20,000
0.4x1 + 0.06x2 +0.04x3+ 0.05x4 – 0.6x5 + 0.06x6 = 0
0.1x2+0.01x3 + 0.01x4 – 0.9x6 = 0
-6857.6x1 + 364x2 +2032x3– 1145x4 – 6857.6x5 + 364x6 + 21,520x7= 20,000,000
Anyone can show me the code?When I solve it by linprog it says it is unbounded problem. When using optimtool it tell me f need to be double. Who can solve my problem??

Best Answer

I think you should try to go with all that has been advised. To obtain an optimal solution, your problem will require specification of atleast the lower bounds. For example based on your code, assuming your variables have assumed lower bounds greater than zero, try this in your program to see if it gives you a different optimal solution:
f=[2.84,-0.22,-3.33,1.09,9.39,9.51,0];
A=[1.1,0.9,0.9,1,1.1,0.9,0;0.5,0.35,0.25,0.25,0.5,0.35,0;0.01,0.15,0.15,0.18,0.01,0.15,0];
b=[200000,100000,20000];
Aeq=[0.4,0.06,0.04,0.05,-0.6,0.06,0;0,0.1,0.01,0.01,0,-0.9,0;-6857.6,364,2032,-1145,-6857.6,364,21520];
beq=[0,0,20000000];
lb=zeros(7,1); % specification of assumed lower bounds to be greater than zero
x= linprog(f,A,b,Aeq,beq,lb);