milp的matlab的案例代码_MATLAB MILP优化问题,目标函数以及方程式中的总和

有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 =

sG91d.png

我做了什么或尝试过的:

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);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值