model:
sets:
product/1..5/:x,h,k;
material/1..6/:c,e;
material2/1..6/:g,f;
product2/1..5/;
price/1..7/;
form(product2,price):a;
amount(material,material2):b;
process(material,product):d;
endsets
data:
a=60, 120, 80, 100, 20,
120, 180, 160, 150, 60,
0, 30, 20, 30, 10,
4, 48, 36, 48, 8,
10, 40, 30, 40, 5,
4, 48, 36, 48, 8,
0, 0, 0, 4, 0;
b=1.0012, 0, 0.050, 0, 0, 0,
0, 1.0125, 0.006, 0, 0, 0,
0, 1.0082, 0.004, 0, 0, 0,
0, 0, 0.002, 0.012, 0.0005, 0.150,
1.0050, 0, 0.002, 0, 0, 0,
0, 0.0250, 0.005, 0.005, 0, 2.050;
c=36500000, 60000000, 1800000, 300000, 4000000, 21000000;
d=0.00085, 0.0005, 0.0024, 0.00152, 0.00062, 0.0005,
0.00365, 0.00125, 0.00275, 0.00125, 0.001025, 0.00055,
0.0028, 0.00105, 0.0025, 0.00105, 0.000985, 0.00055,
0.0038, 0.0016, 0.0026, 0.00185, 0.000855, 0.0006,
0.0045, 0.0002, 0.0012, 0.00075, 0.00025, 0.00025;
e=1350, 600, 1800, 1000, 650, 500;
f=3.25, 4, 2.75, 2.85, 2.9, 2.8;
g=3.78, 18.5, 7.4, 6.45, 95.2, 2.18;
h=200000, 70000, 45000, 30000, 35000;
k=6.5, 15.3, 12.2, 14.5, 3.2;
end data
[obj]max=@sum(product(j):k(j)*x(j))-@sum(material2(j):(@sum(material2(j):a(i,j)*x(j)*b(i,j))*g(j)))-@sum(material2(j):(@sum(product(j):x(j)*d(i,j))*f(j)));
@for(material(i):@sum(material2(j):a(i,j)*x(j)*b(i,j))<=c(i););
@for(material(i):@sum(product(j):x(j)*d(i,j))<=e(i););
@for(product(j):x(j)>=h(j););
@for(product(j):@gin(x(j)););
end
急!运行lingo8.0提示属性下标越界,请高人改改,有其他错误的话也一并改一下,谢谢。 程序:
答案:2 悬赏:80 手机版
解决时间 2021-03-18 09:27
- 提问者网友:风月客
- 2021-03-17 10:48
最佳答案
- 五星知识达人网友:老鼠爱大米
- 2021-03-17 11:50
问题不小,把数学表达式列出来看看,才有办法改
矩阵阶数不一样是无法相乘的
例如:@sum(material2(j):(@sum(material2(j):a(i,j)*x(j)*b(i,j))*g(j)))
a为7*5矩阵,而b是6*6矩阵,阶数不一样,没法相乘的
矩阵阶数不一样是无法相乘的
例如:@sum(material2(j):(@sum(material2(j):a(i,j)*x(j)*b(i,j))*g(j)))
a为7*5矩阵,而b是6*6矩阵,阶数不一样,没法相乘的
全部回答
- 1楼网友:杯酒困英雄
- 2021-03-17 13:21
可以私聊我~
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯