最优化方法——用Lingo对线性规划进行灵敏度分析.doc

上传人:M****1 文档编号:542103841 上传时间:2023-12-31 格式:DOC 页数:8 大小:208.01KB
返回 下载 相关 举报
最优化方法——用Lingo对线性规划进行灵敏度分析.doc_第1页
第1页 / 共8页
最优化方法——用Lingo对线性规划进行灵敏度分析.doc_第2页
第2页 / 共8页
最优化方法——用Lingo对线性规划进行灵敏度分析.doc_第3页
第3页 / 共8页
最优化方法——用Lingo对线性规划进行灵敏度分析.doc_第4页
第4页 / 共8页
最优化方法——用Lingo对线性规划进行灵敏度分析.doc_第5页
第5页 / 共8页
点击查看更多>>
资源描述

《最优化方法——用Lingo对线性规划进行灵敏度分析.doc》由会员分享,可在线阅读,更多相关《最优化方法——用Lingo对线性规划进行灵敏度分析.doc(8页珍藏版)》请在金锄头文库上搜索。

1、lingo软件求解线性规划及灵敏度分析注:以目标函数最大化为例进行讨论,对求最小的问题,有类似的分析方法!所有程序运行环境为lingo10。一、用lingo软件求解线性规划例1:在模型窗口输入:model:max=2*x+3*y;4*x+3*y=10;3*x+5*y12;! the optimal value is :7.454545 ;End如图所示:运行结果如下(点击 工具栏上的solve或点击菜单lingo下的solve即可):Global optimal solution found. Objective value: 7.454545(最优解函数值) Total solver ite

2、rations: 2(迭代次数) Variable (最优解) Value Reduced Cost X 1.272727 0.000000 Y 1.636364 0.000000 Row Slack or Surplus Dual Price 1 7.454545 1.000000 2 0.000000 0.9090909E-01 3 0.000000 0.5454545例2:在模型窗口输入:model:max=5*x1+4*x2;x1+3*x2+x3=90;2*x1+x2+x4=80;x1+x2+x5=45;end运行(solve)结果如下:Global optimal solution

3、found. Objective value: 215.0000 Total solver iterations: 3 Variable Value Reduced Cost X1 35.00000 0.000000 X2 10.00000 0.000000 X3 25.00000 0.000000 X4 0.000000 1.000000 X5 0.000000 3.000000 Row Slack or Surplus Dual Price 1 215.0000 1.000000 2 0.000000 0.000000 3 0.000000 1.000000 4 0.000000 3.00

4、0000例3在模型窗口输入:model:min=-x2+2*x3;x1-2*x2+x3=2;x2-3*x3+x4=1;x2-x3+x5=2;end运行结果如下: Global optimal solution found. Objective value: -1.500000 Total solver iterations: 2 Variable Value Reduced Cost X2 2.500000 0.000000 X3 0.5000000 0.000000 X1 6.500000 0.000000 X4 0.000000 0.5000000 X5 0.000000 0.500000

5、0 Row Slack or Surplus Dual Price 1 -1.500000 -1.000000 2 0.000000 0.000000 3 0.000000 0.5000000 4 0.000000 0.5000000例4:在模型窗口输入:model:min=abs(x)+abs(y)+abs(z);x+y1;2*x+z=4;free(x);free(y);free(z);End求解器状态如下:(可看出是非线性模型!)运行结果为: Linearization components added: Constraints: 12 Variables: 12 Integers: 3

6、Global optimal solution found. Objective value: 3.000000 Extended solver steps: 0 Total solver iterations: 4 Variable Value Reduced Cost X 2.000000 0.000000 Y -1.000000 0.000000 Z 0.000000 0.000000 Row Slack or Surplus Dual Price 1 3.000000 -1.000000 2 0.000000 1.000000 3 0.000000 -1.000000二、用lingo软

7、件进行灵敏度分析实例例5: 在模型窗口输入:Lingo模型:model:max=60*x+30*y+20*z;8*x+6*y+z48;4*x+2*y+1.5*z20;2*x+1.5*y+0.5*z8;y5;end(一)求解报告(solution report)通过菜单LingoSolve可以得到求解报告(solution report)如下:Global optimal solution found at iteration: 0 Objective value: 280.0000 Variable Value Reduced Cost X 2.000000 0.000000 Y 0.000000 5.000000 Z 8.000000 0.000000 Row Slack or Surplus Dual Price 1 280.0000 1.000000 2 24.00000 0.000000 3 0.000000 10.00000 4 0.000000 10.00000 5 5.00000

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 科普知识

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号