数模论坛

 找回密码
 注-册-帐-号
搜索
热搜: 活动 交友 discuz
查看: 2442|回复: 4

lingo 问题 请教高手

[复制链接]
发表于 2004-8-24 07:24:50 | 显示全部楼层 |阅读模式
<>第一次用lingo  不知道错哪里了  请赐教!!!</P>
<>model:
sets:
aa/1..15/;
ss/1..7/:s;
cost(ss,aa):c,x,vaule;
pp/1..7/:p;
yy/1..14/:y;
ll/1..14/:l;
tt:t;
endsets
data:
c=
264.3 160.3 140.2 98.6 38 20.5 3.1 21.2 64.2 92 96 105 121.2 128 142
309.3 205.3 100.2 171.6 111 95.5 86 71.2 114.2 142 146 156 171.2 178 192
324.3 220.3 200.2 181.6 121 105.5 96 86.2 48.2 82 86 96 111.2 118 132
354.3 250.3 235.2 216.6 156 140.5 131 116.2 84.2 62 51 61 76.2 83 97
349.3 245.3 225.2 206.6 146 130.5 121 111.2 79.2 57 33 51 71.2 73 87
359.3 255.3 235.2 216.6 156 140.5 131 121.2 84.2 62 51 45 26.2 11 28
369.3 265.3 245.2 226.6 166 150.5 141 131.2 99.2 77 66 56 38.2 26 2;
p=160 155 155 160 155 150 160;
l=104 301 750 606 194 205 201 680 480 300 220 210 420 500;
s=800 800 1000 2000 2000 2000 3000;
enddata
min=@sum(cost(i,j):p(i)*x(i,j)+c(i,j)*x(i,j))+@sum(yy(i)(y(i)^2+y(i))+(l(i)-y(i))*(l(i)-y(i)+1))*0.05);
@sum(cost(i,j)|2#le#j:x(i,j))=y(j)+l(j-1)-y(j-1);
@sum(ss(i):x(i,15))=l(14)-y(14);
@for(yy(i)bnd(0,y(i),l(i)));
@for(aa(i)for(ss(j):x(i,j)&gt;=0));
y(1)=0;
@for(ttbin(t));
@for(ss(i):@bnd(500*t(i),@sum(aa(j):x(i,j)),s(i)*t(i)));
end
</P>
 楼主| 发表于 2004-8-24 19:55:01 | 显示全部楼层

我自己改过来了 呵呵 但是结果有误差

model:
sets:
aa/1..15/;
ss/1..7/:s;
cost(ss,aa):c,x;
pp/1..7/:p;
yy/1..14/:y;
ll/1..14/:l;
tt/1..7/:t;
endsets
data:
c=
264.3 160.3 140.2 98.6 38 20.5 3.1 21.2 64.2 92 96 105 121.2 128 142
309.3 205.3 100.2 171.6 111 95.5 86 71.2 114.2 142 146 156 171.2 178 192
324.3 220.3 200.2 181.6 121 105.5 96 86.2 48.2 82 86 96 111.2 118 132
354.3 250.3 235.2 216.6 156 140.5 131 116.2 84.2 62 51 61 76.2 83 97
349.3 245.3 225.2 206.6 146 130.5 121 111.2 79.2 57 33 51 71.2 73 87
359.3 255.3 235.2 216.6 156 140.5 131 121.2 84.2 62 51 45 26.2 11 28
369.3 265.3 245.2 226.6 166 150.5 141 131.2 99.2 77 66 56 38.2 26 2;
p=160 155 155 160 155 150 160;
l=104 301 750 606 194 205 201 680 480 300 220 210 420 500;
s=800 800 1000 2000 2000 2000 3000;
enddata
min=@sum(cost(i,j)p(i)+c(i,j))*x(i,j))+@sum(yy(i)(y(i)^2+y(i))+(l(i)-y(i))*(l(i)-y(i)+1))*0.05);
@for(ss(i)for(aa(j)gin(x(i,j))));
!@for(ss(i)for(yy(j)|2#le#j:@sum(cost(i,j):x(i,j))=y(j)+l(j-1)-y(j-1)));
@sum(cost(i,j):x(i,j))=5171;
@sum(ss(i):x(i,15))=l(14)-y(14);
@for(yy(i)|2#le#i:@sum(ss(j):x(j,i))=y(i)+l(i-1)-y(i-1));
@for(yy(i)|2#le#i:y(i)&lt;=l(i));
@for(yy(i)|2#le#i:y(i)&gt;=0);
@for(ss(i):@for(aa(j):x(i,j)&gt;=0));
y(1)=0;
@for(ss(i):@sum(aa(j):x(i,j)*@sum(aa(j):x(i,j)-500))&gt;=0);
@for(ss(i):@sum(aa(j):x(i,j))&lt;=s(i));
!@for(tt:@bin(t));
!@for(ss(i):500*t(i)&lt;=@sum(aa(j):x(i,j)));
!@for(ss(i):@sum(aa(j):x(i,j))&lt;=s(i)*t(i));
end
发表于 2004-8-25 05:16:44 | 显示全部楼层
<>写的挺好的,能告诉我原题吗?谢谢</P><>QQ:84233724</P>
发表于 2004-8-25 06:25:27 | 显示全部楼层
<>@sum(cost(i,j)|2#le#j:x(i,j))=y(j)+l(j-1)-y(j-1);
改为:@for(cost(i,j)sum(yy(,j)|2#le#j:x(i,j))=@sum(yy(i):y(j)+l(j-1)-y(j-1)));</P><>我在别人这里上,没有lingo,也不知道对不对了,也不知道改了没有该你原一。</P>
发表于 2004-9-11 00:46:50 | 显示全部楼层
<>请问大家,谁有lingo的教程?书也可以!!谢谢!!!</P>
您需要登录后才可以回帖 登录 | 注-册-帐-号

本版积分规则

小黑屋|手机版|Archiver|数学建模网 ( 湘ICP备11011602号 )

GMT+8, 2024-11-27 20:32 , Processed in 0.054275 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表