浙家小伙伴 发表于 2015-9-5 15:25

求问lingo11中gcp的问题怎么修改

如图所示,运行起来就是显示error,不造怎么改。程序如下
min x1+x2+lag1+lag2
s.t.
2) 2 x1+0.3 x2+ LAG1+  LAG2 >= 98
3) 4 x2+0.3 x1+ LAG1-2 LAG2 >= 277
4) x1 +   x2  < 100                                
5) x1 - 2 x2  < 0                                      
end
QCP 4
gin 2



浙家小伙伴 发表于 2015-9-5 15:48

这个是例题里的程序,直接运行就错了不知道为什么

liwenhui 发表于 2015-9-6 09:20

语法错误,LINGO没有这样的语法。

model:
min=x1+x2+lag1+lag2;
2*x1+0.3*x2+LAG1+LAG2>98;
4*x2+0.3*x1+LAG1-2*LAG2>277;
x1+x2<100;                                
x1-2*x2 <0;                                    
end

  Global optimal solution found.
  Objective value:                              107.8704
  Infeasibilities:                              0.000000
  Total solver iterations:                             3

  Model Class:                                        LP

  Total variables:                      4
  Nonlinear variables:                  0
  Integer variables:                    0

  Total constraints:                    5
  Nonlinear constraints:                0

  Total nonzeros:                      16
  Nonlinear nonzeros:                   0

                                Variable           Value        Reduced Cost
                                      X1        35.37037            0.000000
                                      X2        64.62963            0.000000
                                    LAG1        7.870370            0.000000
                                    LAG2        0.000000           0.9444444

                                     Row    Slack or Surplus      Dual Price
                                       1        107.8704           -1.000000
                                       2        0.000000          -0.6851852
                                       3        0.000000          -0.3148148
                                       4        0.000000           0.4648148
                                       5        93.88889            0.000000


页: [1]
查看完整版本: 求问lingo11中gcp的问题怎么修改