如何使用lingo软件编程解决线性规划问题?问题如补充所示。 5
Zj=5*X1j+7*X2j+5*X3j+4*X4j+6*X5j+5*X6j+5*X7j+3*X8j+Pj三年费用minZ=Z1+Z2+Z3=5*X11+7*X21+5*...
Zj=5*X1j+7*X2j+5*X3j+4*X4j+6*X5j+5*X6j+5*X7j+3*X8j+Pj
三年费用min Z=Z1+Z2+Z3
=5*X11+7*X21+5*X31+4*X41+6*X51+5*X61+5*X71+3*X81+P1+
5*X12+7*X22+5*X32+4*X42+6*X52+5*X62+5*X72+3*X82+P2+
5*X13+7*X23+5*X33+4*X43+6*X53+5*X63+5*X73+3*X83+P3
约束条件:
1) 由于第i号井只能在三年中的某一年打造或者不打造,故应有
<=1;
2) 每年的费用不能超过计划即
Z1=5*X11+7*X21+5*X31+4*X41+6*X51+5*X61+5*X71+3*X81+P1;
Z2=5*X12+7*X22+5*X32+4*X42+6*X52+5*X62+5*X72+3*X82+P2;
Z3=5*X13+7*X23+5*X33+4*X43+6*X53+5*X63+5*X73+3*X83+P3;
Z1〈=60,Z2〈=60 , Z3〈=60
3) 每年的水量应满足要求,水量有三部分构成:现有水井的产水量,新建水井的产水量, 管 道铺好后的管道水量。
新建水井产水量:
第一年:
N1=25*X11+36*X21+32*X31+15*X41+31*X51+28*X61+22*X71+12*X81;
第二年:
N2=25*X12+36*X22+32*X32+15*X42+31*X52+28*X62+22*X72+12*X82+25*X11*0.9+36*X21*0.9+32*X31*0.9+15*X41*0.9+31*X51*0.9+28*X61*0.9+22*X71*0.9+12*X81*0.9
第三年:
N3=25*X13+36*X23+32*X33+15*X43+31*X53+28*X63+22*X73+12*X83+25*X12*0.9+36*X22*0.9+32*X32*0.9+15*X42*0.9+31*X52*0.9+28*X62*0.9+22*X72*0.9+12*X82*0.9+25*X11*0.81+ 36*X21*0.81+32*X31*0.81+15*X41*0.81+31*X51*0.81+28*X61*0.81+22*X71*0.81+12*X81*0.81;
第四年:N4=N3*0.9
第五年:N5=N3*0.81
管道水量:前三年为0,后两年为Q
故每年的总水量
W1=43.4754+N1
W2=31.7983+N2
W3=24.0045+N3
W4=20.7178+N4+Q
W5=17.4312+N5+Q
满足,W1>=150, W2>=160, W3>=170, W4>=180, W5>=190
4)每年的铺管道费取整且总管道不小20公里即
Pj=0.66Q^0.51*Li
Pj取整
L1+L2+L3 >= 20 展开
三年费用min Z=Z1+Z2+Z3
=5*X11+7*X21+5*X31+4*X41+6*X51+5*X61+5*X71+3*X81+P1+
5*X12+7*X22+5*X32+4*X42+6*X52+5*X62+5*X72+3*X82+P2+
5*X13+7*X23+5*X33+4*X43+6*X53+5*X63+5*X73+3*X83+P3
约束条件:
1) 由于第i号井只能在三年中的某一年打造或者不打造,故应有
<=1;
2) 每年的费用不能超过计划即
Z1=5*X11+7*X21+5*X31+4*X41+6*X51+5*X61+5*X71+3*X81+P1;
Z2=5*X12+7*X22+5*X32+4*X42+6*X52+5*X62+5*X72+3*X82+P2;
Z3=5*X13+7*X23+5*X33+4*X43+6*X53+5*X63+5*X73+3*X83+P3;
Z1〈=60,Z2〈=60 , Z3〈=60
3) 每年的水量应满足要求,水量有三部分构成:现有水井的产水量,新建水井的产水量, 管 道铺好后的管道水量。
新建水井产水量:
第一年:
N1=25*X11+36*X21+32*X31+15*X41+31*X51+28*X61+22*X71+12*X81;
第二年:
N2=25*X12+36*X22+32*X32+15*X42+31*X52+28*X62+22*X72+12*X82+25*X11*0.9+36*X21*0.9+32*X31*0.9+15*X41*0.9+31*X51*0.9+28*X61*0.9+22*X71*0.9+12*X81*0.9
第三年:
N3=25*X13+36*X23+32*X33+15*X43+31*X53+28*X63+22*X73+12*X83+25*X12*0.9+36*X22*0.9+32*X32*0.9+15*X42*0.9+31*X52*0.9+28*X62*0.9+22*X72*0.9+12*X82*0.9+25*X11*0.81+ 36*X21*0.81+32*X31*0.81+15*X41*0.81+31*X51*0.81+28*X61*0.81+22*X71*0.81+12*X81*0.81;
第四年:N4=N3*0.9
第五年:N5=N3*0.81
管道水量:前三年为0,后两年为Q
故每年的总水量
W1=43.4754+N1
W2=31.7983+N2
W3=24.0045+N3
W4=20.7178+N4+Q
W5=17.4312+N5+Q
满足,W1>=150, W2>=160, W3>=170, W4>=180, W5>=190
4)每年的铺管道费取整且总管道不小20公里即
Pj=0.66Q^0.51*Li
Pj取整
L1+L2+L3 >= 20 展开
展开全部
根据你提供的资料,lingo程序如下:
min =Z1+Z2+Z3;
Z1=5*X11+7*X21+5*X31+4*X41+6*X51+5*X61+5*X71+3*X81+P1;
Z2=5*X12+7*X22+5*X32+4*X42+6*X52+5*X62+5*X72+3*X82+P2;
Z3=5*X13+7*X23+5*X33+4*X43+6*X53+5*X63+5*X73+3*X83+P3;
Z1<=60;Z2<=60; Z3<=60;
N1=25*X11+36*X21+32*X31+15*X41+31*X51+28*X61+22*X71+12*X81;
N2=25*X12+36*X22+32*X32+15*X42+31*X52+28*X62+22*X72+12*X82+25*X11*0.9+36*X21*0.9+32*X31*0.9+15*X41*0.9+31*X51*0.9+28*X61*0.9+22*X71*0.9+12*X81*0.9;
N3=25*X13+36*X23+32*X33+15*X43+31*X53+28*X63+22*X73+12*X83+25*X12*0.9+36*X22*0.9+32*X32*0.9+15*X42*0.9+31*X52*0.9+28*X62*0.9+22*X72*0.9+12*X82*0.9+25*X11*0.81+ 36*X21*0.81+32*X31*0.81+15*X41*0.81+31*X51*0.81+28*X61*0.81+22*X71*0.81+12*X81*0.81;
N4=N3*0.9;
N5=N3*0.81;
W1=43.4754+N1;
W2=31.7983+N2;
W3=24.0045+N3;
W4=20.7178+N4+Q;
W5=17.4312+N5+Q;
W1>=150;W2>=160;W3>=170; W4>=180;W5>=190;
L1+L2+L3 >= 20;
P1=0.66*Q^0.51*L1;
P2=0.66*Q^0.51*L2;
P3=0.66*Q^0.51*L3;
@gin(P1);@gin(P2);@gin(P3);
但个人觉得似乎不太对,有可能的话用原题重新提问
min =Z1+Z2+Z3;
Z1=5*X11+7*X21+5*X31+4*X41+6*X51+5*X61+5*X71+3*X81+P1;
Z2=5*X12+7*X22+5*X32+4*X42+6*X52+5*X62+5*X72+3*X82+P2;
Z3=5*X13+7*X23+5*X33+4*X43+6*X53+5*X63+5*X73+3*X83+P3;
Z1<=60;Z2<=60; Z3<=60;
N1=25*X11+36*X21+32*X31+15*X41+31*X51+28*X61+22*X71+12*X81;
N2=25*X12+36*X22+32*X32+15*X42+31*X52+28*X62+22*X72+12*X82+25*X11*0.9+36*X21*0.9+32*X31*0.9+15*X41*0.9+31*X51*0.9+28*X61*0.9+22*X71*0.9+12*X81*0.9;
N3=25*X13+36*X23+32*X33+15*X43+31*X53+28*X63+22*X73+12*X83+25*X12*0.9+36*X22*0.9+32*X32*0.9+15*X42*0.9+31*X52*0.9+28*X62*0.9+22*X72*0.9+12*X82*0.9+25*X11*0.81+ 36*X21*0.81+32*X31*0.81+15*X41*0.81+31*X51*0.81+28*X61*0.81+22*X71*0.81+12*X81*0.81;
N4=N3*0.9;
N5=N3*0.81;
W1=43.4754+N1;
W2=31.7983+N2;
W3=24.0045+N3;
W4=20.7178+N4+Q;
W5=17.4312+N5+Q;
W1>=150;W2>=160;W3>=170; W4>=180;W5>=190;
L1+L2+L3 >= 20;
P1=0.66*Q^0.51*L1;
P2=0.66*Q^0.51*L2;
P3=0.66*Q^0.51*L3;
@gin(P1);@gin(P2);@gin(P3);
但个人觉得似乎不太对,有可能的话用原题重新提问
追问
上传的时候缺乏这样的约束0-1整数规划:由于第i号井只能在三年中的某一年打造或者不打造,故应有
x11+x12+x13<=1;
X21+X22+X23<=1;
X31+X32+X33<=1;
X41+X42+X43<=1;
X51+X52+X53<=1;
X61+X62+X63<=1;
X71+X72+X73<=1;
X81+X82+X83<=1;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询