lingo 代码
lingo 代码
Variables:x1~the number of acres of corn
x2~the number of acres of tomatoes
x3~the number of acres of beans
x4~the number of acres of peas
x5~the number of acres of carrots
x6~the number of acres of unused land
x7~the number of borrowed amount
1 xi>0
yi=
0 xi=0
Maximize:95x1+1300x2+275x3+345x4+435x5-3000-x7-0.03x7
Subject to
20x1+200x2+55x3+40x4+75x5+(5x1+120x2+25x3+35x4+40x5)7.25+9x6=3000+x7
5x1+120x2+25x3+35x4+40x5+2x6≤1800
x1+x2+x3+x4+x5+x6=100
x7≤12000
xi25yi
xi≥0 and integral for i=1,…,7
0≤yi≤1 and integral
以上是条件限制,求好心大神转换成lingo代码.
max=95*x1+1300*x2+275*x3+345*x4+435*x5-3000-x7-0.03*x7;
20*x1+200*x2+55*x3+40*x4+75*x5+(5*x1+120*x2+25*x3+35*x4+40*x5)*7.25+9*x6=3000+x7;
5*x1+120*x2+25*x3+35*x4+40*x5+2*x6=25*y2;x3>=25*y3;x4>=25*y4;x5>=25*y5;x6>=25*y6;x7>=25*y7;
@gin(x1);@bin(y1);
@gin(x2);@bin(y2);
@gin(x3);@bin(y3);
@gin(x4);@bin(y4);
@gin(x5);@bin(y5);
@gin(x6);@bin(y6);
@gin(x7);@bin(y7);sorry我少给了一个条件要所有的y加起来大于2