c=[2.84, -0.22, -3.33, 1.09, 9.39, 9.51 0]';
A=[1.1, 0.9, 0.9, 1.0, 1.1, 0.9, 0.0;
   0.5, 0.35, 0.25, 0.25, 0.5, 0.35, 0.0;
   0.01, 0.15, 0.15, 0.18, 0.01, 0.15, 0.0];
b=[200000, 100000, 20000]';
Aeq=[0.4, 0.06, 0.04, 0.05, -0.6, 0.06, 0.0;
     0.0, 0.1, 0.01, 0.01, 0.0, -0.9, 0.0;
	 -6857.6, 364, 2032, -1145, -6857.6, 364, 21520];
beq=[0, 0, 20000000]';
lb=zeros(7,1);
ub=[];

% active set: simplex
op=optimset('LargeScale','off','Display','final');
[x,S,eflag,out,lambda]=linprog(-c,A,b,Aeq,beq,lb,ub,[],op)
Ethylene=A(2,:)*x
Propylene=A(3,:)*x
Butadiene=[0.01, 0.02, 0.04, 0.05, 0.01, 0.02, 0.0]*x
Gasoline=[0.01, 0.07, 0.25, 0.30, 0.01, 0.07, 0.0]*x
Methane=[0.07, 0.25, 0.10, 0.15, 0.07, 0.25, 0.0]*x
Fuel_oil=[0.0, 0.0, 0.21, 0.01, 0.0, 0.0, 0.0]*x
Objective=-S-20e6/21520*5.38
