lingo 求和p=xi*yi*C
model:sets:x/x1..x6/:a;y/y1..y6/:b;m(x,y):d;endsetsdata:a=123456;b=222222;enddatas=10...
model:
sets:
x/x1..x6/:a;
y/y1..y6/:b;
m(x,y):d;
endsets
data:
a=1 2 3 4 5 6;
b=2 2 2 2 2 2;
enddata
s=100/@sum(m(J,J):a(J)*b(J));
end
这个得出s后,要再得p=xi*yi*s 该怎么写啊
新手只有25分全给了。
另:有没有关于lingo@for,@sum,线性规划建模详细的教程学习一下,谢谢。 展开
sets:
x/x1..x6/:a;
y/y1..y6/:b;
m(x,y):d;
endsets
data:
a=1 2 3 4 5 6;
b=2 2 2 2 2 2;
enddata
s=100/@sum(m(J,J):a(J)*b(J));
end
这个得出s后,要再得p=xi*yi*s 该怎么写啊
新手只有25分全给了。
另:有没有关于lingo@for,@sum,线性规划建模详细的教程学习一下,谢谢。 展开
1个回答
展开全部
model:
sets:
x/x1..x6/:a,b;
endsets
data:
a=1 2 3 4 5 6;
b=2 2 2 2 2 2;
enddata
calc:
s=100/@sum(x(j):a(J)*b(J));
endcalc
end
Feasible solution found.
Total solver iterations: 0
Variable Value
S 2.380952
A( X1) 1.000000
A( X2) 2.000000
A( X3) 3.000000
A( X4) 4.000000
A( X5) 5.000000
A( X6) 6.000000
B( X1) 2.000000
B( X2) 2.000000
B( X3) 2.000000
B( X4) 2.000000
B( X5) 2.000000
B( X6) 2.000000
model:
sets:
x/x1..x6/:a,b;
endsets
data:
a=1 2 3 4 5 6;
b=2 2 2 2 2 2;
enddata
s=100/@sum(x(j):a(J)*b(J));
end
Feasible solution found.
Total solver iterations: 0
Variable Value
S 2.380952
A( X1) 1.000000
A( X2) 2.000000
A( X3) 3.000000
A( X4) 4.000000
A( X5) 5.000000
A( X6) 6.000000
B( X1) 2.000000
B( X2) 2.000000
B( X3) 2.000000
B( X4) 2.000000
B( X5) 2.000000
B( X6) 2.000000
Row Slack or Surplus
1 0.000000
sets:
x/x1..x6/:a,b;
endsets
data:
a=1 2 3 4 5 6;
b=2 2 2 2 2 2;
enddata
calc:
s=100/@sum(x(j):a(J)*b(J));
endcalc
end
Feasible solution found.
Total solver iterations: 0
Variable Value
S 2.380952
A( X1) 1.000000
A( X2) 2.000000
A( X3) 3.000000
A( X4) 4.000000
A( X5) 5.000000
A( X6) 6.000000
B( X1) 2.000000
B( X2) 2.000000
B( X3) 2.000000
B( X4) 2.000000
B( X5) 2.000000
B( X6) 2.000000
model:
sets:
x/x1..x6/:a,b;
endsets
data:
a=1 2 3 4 5 6;
b=2 2 2 2 2 2;
enddata
s=100/@sum(x(j):a(J)*b(J));
end
Feasible solution found.
Total solver iterations: 0
Variable Value
S 2.380952
A( X1) 1.000000
A( X2) 2.000000
A( X3) 3.000000
A( X4) 4.000000
A( X5) 5.000000
A( X6) 6.000000
B( X1) 2.000000
B( X2) 2.000000
B( X3) 2.000000
B( X4) 2.000000
B( X5) 2.000000
B( X6) 2.000000
Row Slack or Surplus
1 0.000000
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询