数学建模社区-数学中国

标题: [讨论]令我疑惑的一道题 [打印本页]

作者: liwenhui    时间: 2008-8-17 21:51
标题: [讨论]令我疑惑的一道题

这是湖南的一个网友的问题 

公司生产 , , 三种产品,售价分别为12元,7元和6元.生产每单位产品 需要1小时技术服务,10小时直接劳动, 3千克材料;生产每单位产品 需要2小时服务,4小时直接劳动,2千克材料; 生产每单位产品 需要1小时服务,5小时直接劳动,1千克材料.现在最多只能提供100小时技术服务,700小时直接劳动,400千克材料.生产成本是生产量的非线性函数,如下所示:

   产品                      产品                 产品

产量

单位成本

产量

单位成本

产量

单位成本

0-40

40-100   

100-150

150以上

  10

   9

   8

   7

0-50

50-100    

100以上

   6

   4

   3

0-100  

100以上

  5

  4

   要求建立一个总利润最大的生产计划模型;并编程计算出生产计划及总利润.

 

我用lingo建立的了一个程序,代码如下:


model:
max=(12*x1+7*x2+6*x3)-(c1+c2+c3);
c1=(@if(x1 #le# 40,10,@if(x1 #le# 100,9,@if(x1 #le# 150,8,7))))*x1;
c2=(@if(x2 #le# 50,6,@if(x2 #le# 100,4,3)))*x2;
c3=(@if(x3 #le# 100,5,4))*x3;
x1+2*x2+x3<100;
10*x1+4*x2+5*x3<700;
3*x1+2*x2+x3<400;
@gin(x1);@gin(x2);
@gin(x3);
end

 

或者见附件里的lingo程序:

 

[attach]5644[/attach]

 

我的疑惑是,我的lingo9解出的结果是:

Linearization components added:
      Constraints:          90
      Variables:            60
      Integers:             36

   Local optimal solution found.
   Objective value:                              150.0000
   Extended solver steps:                               0
   Total solver iterations:                           435


                       Variable           Value        Reduced Cost
                             X1        0.000000            0.000000
                             X2        50.00000           0.6000000
                             X3        0.000000            0.000000
                             C1        0.000000            0.000000
                             C2        200.0000            0.000000
                             C3        0.000000           0.2000000

                            Row    Slack or Surplus      Dual Price
                              1        150.0000            1.000000
                              2        0.000000           -1.000000
                              3        0.000000           -1.000000
                              4        0.000000          -0.8000000
                              5        0.000000            2.000000
                              6        500.0000            0.000000
                              7        300.0000            0.000000

 

而湖南网友的lingo10解出的结果是:

 

Linearization components added:
      Constraints:          90
      Variables:            60
      Integers:             36

  Local optimal solution found.
  Objective value:                              210.0000
  Extended solver steps:                               0
  Total solver iterations:                            83


                       Variable           Value        Reduced Cost
                             X1        70.00000          -0.9000000
                             X2        0.000000            0.000000
                             X3        0.000000           0.2500000
                             C1        630.0000            0.000000
                             C2        0.000000            0.000000
                             C3        0.000000            0.000000

                            Row    Slack or Surplus      Dual Price
                              1        210.0000            1.000000
                              2        0.000000           -1.000000
                              3        0.000000           -1.000000
                              4        0.000000           -1.000000
                              5        30.00000            0.000000
                              6        0.000000           0.2500000
                              7        190.0000            0.000000

 


 

不知道这是什么原因,我百思不得其解,请有兴趣的网友把程序拿去运行以下,然后把您的结果发出来讨论一下。

[此贴子已经被作者于2008-8-17 21:53:24编辑过]

hnjm01.rar.rar

671 Bytes, 下载次数: 0, 下载积分: 体力 -2 点

hnjm01.rar


作者: madio    时间: 2008-8-18 09:44
找到的是局部最优解,当然会有不同,这样看lingo10要比lingo9有一定的改进,所以得到的局部最优解比较好!
作者: high_jah    时间: 2008-11-26 21:15
整形非线性规划问题,Lingo解起来是比较辛苦的。估计是高版本的Lingo在非线性规划问题求解上面有所改善吧。
作者: mathcd    时间: 2009-2-5 21:16
我用lingo11算出的结果是:
Global optimal solution found.
  Objective value:                              210.0000
  Objective bound:                              210.0000
  Infeasibilities:                              0.000000
  Extended solver steps:                               1
  Total solver iterations:                            30


                       Variable           Value        Reduced Cost
                             X1        70.00000           -3.000000
                             X2        0.000000           -1.000000
                             X3        0.000000           -1.000000
                             C1        630.0000            0.000000
                             C2        0.000000            0.000000
                             C3        0.000000            0.000000

                            Row    Slack or Surplus      Dual Price
                              1        210.0000            1.000000
                              2        0.000000           -1.000000
                              3        0.000000           -1.000000
                              4        0.000000           -1.000000
                              5        30.00000            0.000000
                              6        0.000000            0.000000
                              7        190.0000            0.000000

自己看着办吧。




欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) Powered by Discuz! X2.5