数学建模社区-数学中国
标题:
lingo问题求解????
[打印本页]
作者:
allbluelai
时间:
2012-8-10 09:22
标题:
lingo问题求解????
min=@exp(x1)*(4*x1^2+2*x2^2+4*x1*x2+2*x2+1);
1.5+x1*x2-x1-x2<=0;
-x1*x2<=10;
这个运行的结果如下:
Global optimal solution found.
Objective value: 8.500000
Objective bound: 8.500000
Infeasibilities: 0.000000
Extended solver steps: 3
Total solver iterations: 72
Variable Value Reduced Cost
X1 0.000000 18.50000
X2 1.500000 0.000000
Row Slack or Surplus Dual Price
1 8.500000 -1.000000
2 0.000000 8.000000
3 10.00000 0.000000
但是最小值大概为:
Bestx =
-9.3044 1.0556
BestFval =
0.0284
怎么回事啊????
“ Global optimal solution found.”不是已经显示为全局最小值了吗??
望指教,,谢谢~~~~
作者:
qlb061
时间:
2012-8-13 19:19
本帖最后由 qlb061 于 2012-8-13 19:21 编辑
在使用Lingo求解问题时,默认变量取值非负!除非使用@free函数告知程序某个变量无约束。
因此,加入@free(x1); @free(x2)即可。
min=@exp(x1)*(4*x1^2+2*x2^2+4*x1*x2+2*x2+1);
1.5+x1*x2-x1-x2<=0;
-x1*x2<=10;
@free(x1);
@free(x2);
复制代码
Global optimal solution found.
Objective value: 0.2355038E-01
Objective bound: 0.2355038E-01
Infeasibilities: 0.4941825E-11
Extended solver steps: 19
Total solver iterations: 4053
Variable Value Reduced Cost
X1 -9.547405 0.000000
X2 1.047405 0.000000
Row Slack or Surplus Dual Price
1 0.2355038E-01 -1.000000
2 0.000000 0.1635247E-01
3 0.000000 0.1830450E-01
作者:
allbluelai
时间:
2012-8-13 23:38
qlb061 发表于 2012-8-13 19:19
在使用Lingo求解问题时,默认变量取值非负!除非使用@free函数告知程序某个变量无约束。
因此,加入@free( ...
哦的,,O(∩_∩)O谢谢哈,,我是新手还不怎么懂,,呵呵~~
欢迎光临 数学建模社区-数学中国 (http://www.madio.net/)
Powered by Discuz! X2.5