2 Attachment(s)

stuck on matlab simplex method

hi all,

can anyone help me with this?ive been stuck for days!(Crying)

im using the matlab code:

%

options=optimset('LargeScale','off','Simplex','on' );

%

% This code solves the problem:

%

% minimise x_1+x_2+x_3

%

% subject to the constraints

%

% b_11 x_1 + b_12 x_2 + b_13 x_3 >= 1

% b_21 x_1 + b_22 x_2 + b_23 x_3 >= 1

% b_31 x_1 + b_32 x_2 + b_33 x_3 >= 1

% x_1 >=0, x_2 >=0, x_3 >=0

%

%

B=[ 1 -6 -7;

-1 6 6;

7 -6 0];

A=-B;

f=[1;1;1];

b=-[1;1;1];

lb=zeros(3,1); % x_1, x_2 and x_3 are non-negative.

%

[x,value]=linprog(f,A,b,[],[],lb)

to solve for (see attached file)

my results are (when i run simplex_method.m):

x1 = 0

x2 = 0

x3 = 1/3

obviously this does not make any sense?? as x1 + x2 + x3 = 1

what am i doing wrong?? : (

P.S. im trying to minimise the problem in the second pic