QQ登录

只需要一步,快速开始

 注册地址  找回密码
查看: 1404|回复: 2
打印 上一主题 下一主题

LINGO求助啊~~!!

[复制链接]
字体大小: 正常 放大

3

主题

4

听众

18

积分

升级  13.68%

  • TA的每日心情
    开心
    2012-2-8 20:27
  • 签到天数: 3 天

    [LV.2]偶尔看看I

    新人进步奖

    跳转到指定楼层
    1#
    发表于 2012-8-2 13:58 |只看该作者 |倒序浏览
    |招呼Ta 关注Ta
    1. model:
    2. sets:
    3. product /1..7/:value;
    4. need /1..14/:demand;
    5. link(product,need):cost,number;
    6. endsets
    7. data:
    8. value=160 155 155 160 155 150 160;
    9. cost=  85.3        85.2        140        38        20.5        3.1        21.2   64.2        92        96        96        116.2        123        132
    10.         135.3        135.2        185        111        95.5        86        71.2   114.2        142        146        146        166.2        173        182
    11.         145.3        145.2        200        121        105.5        96        86.2   48.2        82        86        86        106.2        108        122
    12.         180.3        180.2        230        156        140.5        131        116.2   84.2        62        51        51        71.2        73        87
    13.         175.3        120.2        225        141        125.5        116        106.2   74.2        51        33        78        61.2        63        77
    14.         175.3        170.2        225        146        130.5        121        111.2   79.2        57        45        45        26.2        11        28
    15.         190.3        185.2        240        151        135.5        136        126.5   94.2        67        61        45        38.2        26        2;

    16. demand=500 920 1130 1350 1650 2130 2810 3011 3216 3410 4016 4766 5067 5171;
    17. enddata
    18. !目标函数:求(value(i)*((i)行的和))的和+cost*number的最小值;
    19. min=@sum(link(i,j):cost(i,j)*number(i,j))+@sum(product(i):value(i)*@sum(need(j):number(i,j)));
    20. !number中各行和的要求;
    21. @for(product(i)|i#eq#1:@sum(need(j):number(i,j))>=500;@sum(need(j):number(i,j))<=800);
    22. @for(product(i)|i#eq#2:@sum(need(j):number(i,j))>=500;@sum(need(j):number(i,j))<=800);
    23. @for(product(i)|i#eq#3:@sum(need(j):number(i,j))>=500;@sum(need(j):number(i,j))<=1000);
    24. @for(product(i)|i#eq#4:@sum(need(j):number(i,j))>=500;@sum(need(j):number(i,j))<=2000);
    25. @for(product(i)|i#eq#5:@sum(need(j):number(i,j))>=500;@sum(need(j):number(i,j))<=2000);
    26. @for(product(i)|i#eq#6:@sum(need(j):number(i,j))>=500;@sum(need(j):number(i,j))<=2000);
    27. @for(product(i)|i#eq#7:@sum(need(j):number(i,j))>=500;@sum(need(j):number(i,j))<=3000);
    28. !number中各列和的要求;
    29. @for(need(j)|j#eq#14:@sum(product(i):number(i,j))>=0; @sum(product(i):number(i,j))<=500);
    30. @for(need(j)|j#ge#13 #and# j#le#14:@sum(product(i):number(i,j))>=500; @sum(product(i):number(i,j))<=920);
    31. @for(need(j)|j#ge#12 #and# j#le#14:@sum(product(i):number(i,j))>=920; @sum(product(i):number(i,j))<=1130);
    32. @for(need(j)|j#ge#11 #and# j#le#14:@sum(product(i):number(i,j))>=1130; @sum(product(i):number(i,j))<=1350);
    33. @for(need(j)|j#ge#10 #and# j#le#14:@sum(product(i):number(i,j))>=1350; @sum(product(i):number(i,j))<=1650);
    34. @for(need(j)|j#ge#9  #and# j#le#14:@sum(product(i):number(i,j))>=1650; @sum(product(i):number(i,j))<=2130);
    35. @for(need(j)|j#ge#8  #and# j#le#14:@sum(product(i):number(i,j))>=2130; @sum(product(i):number(i,j))<=2810);
    36. @for(need(j)|j#ge#7  #and# j#le#14:@sum(product(i):number(i,j))>=2810; @sum(product(i):number(i,j))<=3011);
    37. @for(need(j)|j#ge#6  #and# j#le#14:@sum(product(i):number(i,j))>=3011; @sum(product(i):number(i,j))<=3216);
    38. @for(need(j)|j#ge#5  #and# j#le#14:@sum(product(i):number(i,j))>=3216; @sum(product(i):number(i,j))<=3410);
    39. @for(need(j)|j#ge#4  #and# j#le#14:@sum(product(i):number(i,j))>=3410; @sum(product(i):number(i,j))<=4016);
    40. @for(need(j)|j#ge#3  #and# j#le#14:@sum(product(i):number(i,j))>=4016; @sum(product(i):number(i,j))<=4766);
    41. @for(need(j)|j#ge#2  #and# j#le#14:@sum(product(i):number(i,j))>=4766; @sum(product(i):number(i,j))<=5067);
    42. @for(need(j)|j#ge#1  #and# j#le#14:@sum(product(i):number(i,j))>=5067; @sum(product(i):number(i,j))<=5171);
    43. !number中所有元素和的要求;
    44. @for(need(j):@sum(product(i):number(i,j))=5171);
    45. !求整数线性规划;
    46. @for(link (i,j): @gin(number (i,j)));
    复制代码
    程序结果是找不到可行解,是编程出错了吧~~~求高人指教,高人啊高人
    zan
    转播转播0 分享淘帖0 分享分享0 收藏收藏0 支持支持0 反对反对0 微信微信

    3

    主题

    4

    听众

    18

    积分

    升级  13.68%

  • TA的每日心情
    开心
    2012-2-8 20:27
  • 签到天数: 3 天

    [LV.2]偶尔看看I

    新人进步奖

    回复

    使用道具 举报

    0

    主题

    5

    听众

    87

    积分

    升级  86.32%

  • TA的每日心情

    2013-1-5 14:05
  • 签到天数: 25 天

    [LV.4]偶尔看看III

    自我介绍
    我是一个认真学习,刻苦的女生

    群组学术交流A

    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 注册地址

    qq
    收缩
    • 电话咨询

    • 04714969085
    fastpost

    关于我们| 联系我们| 诚征英才| 对外合作| 产品服务| QQ

    手机版|Archiver| |繁體中文 手机客户端  

    蒙公网安备 15010502000194号

    Powered by Discuz! X2.5   © 2001-2013 数学建模网-数学中国 ( 蒙ICP备14002410号-3 蒙BBS备-0002号 )     论坛法律顾问:王兆丰

    GMT+8, 2025-6-15 16:42 , Processed in 0.937365 second(s), 62 queries .

    回顶部