有6个变量X,Y,Z,L,M,H和1个目标函数
I have solved it in Gams but stuck in Matlab
help
I have seen some posts but they have no answers in it
混合整数线性规划问题,我陷入了对intlinprog()求和的数组A []和B []的问题
I have read this on MATLAB forum how to use intlinprog() and it was easy to make array A easily for that
我必须解决这些方程式
如何为A []建立
Minimize OBJ=-sum(SP.*X)+sum(PCL.*L+PCM.*M+PCH.*H); // How to make this type of array
X-CL.*L-CM.*M-CH.*H=0;
L(j)+M(j)+H(j)-Z(j)=0;
X(j)-100000*Z(j)<=0;
L(j)-Y(j)<=0;
H(j)+Y(j)<=1;
sum(RM1(j)*X(j))<=R(k);
sum(RM2(j)*X(j))<=R(k);
sum(ICL(j)*L(j)+ICM(j)*M(j)+ICH(j)*H(j))<=Budget;
和
Here =l= means <=
Here =g= means >=
Here =e= means =
我做了什么或尝试过的:
PCL=[50.7,56.8,56.4]=PCM=PCH; %FOR SHORTENING QUESTION I WROTE SAME
CL=[70,75,77.5]=CM=CH;
IL=[55,58,60.2,55.1]=IM-IH;
SP=[0.975,0.975,0.975];
RM1=[0.948,0.9432,0.949];
RM2=[0,0,0];
R=[500,500];
Budget=1000;
%STUCK AT THIS POINT
%X Y Z L M H
%BELOW LINE IS WRONG HOW SHOULD I BUILD THIS
A=[1 0 -100000 0 0 0; 0 -1 0 1 0 0;0 1 0 0 0 1;RM1 0 0 0 0 0;RM2 0 0 0 0 0;0 0 0 IL IM IH];
B=[0;0;1;R(1);R(2);Budget];
OBJ=[-SP 0 0 PCL PCM PCH];
intcon=[2,3];
Aeq=[1 0 0 -CL -CM -CH ; 0 0 -1 1 1 1];
Beq=[0 ; 0];
lb=[0 0 0 0 0 0];
ub=[inf inf inf inf inf];
[x,fval]=intlinprog(OBJ,intcon,A,B,Aeq,Beq,lb,ub);