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

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

最优化方法——用Lingo对线性规划进行灵敏度分析lingo软件求解线性规划及灵敏度分析注:以目标函数最大化为例进行讨论,对求最小的问题,有类似的分析方法~所有程序运行环境为lingo10。

一、用lingo软件求解线性规划

例1:

max23zxy,,

stxy..4310,, 3512xy,,

xy,0,

在模型窗口输入:

model:

max=2*x+3*y;

4*x+3*y<=10;

3*x+5*y<12;

! the optimal value is :7.454545 ; End

如图所示:

运行结果如下(点击工具栏上的‘solve’或点击菜单‘lingo’下的

‘solve’即可):

Global optimal solution found.

Objective value: 7.454545(最优解函数值)

Total solver iterations: 2(迭代次数)

road, are the structural road traffic within the city. In addition, suitable for high speed, and high-speed, S206, S307, also serve inner-city traffic. Outbound traffic: existing highways (suitable for high-speed, and high speed), darts (S206, S307) and Yi wei road, and so on. After years of constant development, road conditions have been greatly 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:

max54zxx,,12

stxxx..390,,,123

280xxx,,,124

xxx,,,45125

x,0

在模型窗口输入:

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 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.000000

例3

conditions have been greatly speed, and high speed), darts (S206, S307) and Yi wei road, and so on. After years of constant development, road-city traffic. Outbound traffic: existing highways (suitable for

high-speed, S206, S307, also serve inner-ion, suitable for high speed, and highroad, are the structural road traffic within the city. In addit2 min2zxx,,,23

stxxx..22,,,123

xxx,,,31234

xxx,,,2235

x,0

在模型窗口输入:

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.5000000

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:

minxyz,,

stxy..1,,

24xz,,

在模型窗口输入:

model:

min=@abs(x)+@abs(y)+@abs(z);

x+y<1;

2*x+z=4;

@free(x);

@free(y);

@free(z);

greatly nd high speed), darts (S206, S307) and Yi wei road, and so on. After years of constant development, road conditions have beenspeed, a-city traffic. Outbound traffic: existing highways (suitable for high-speed, S206, S307, also serve inner-road, are the structural road

traffic within the city. In addition, suitable for high speed, and high3 End

求解器状态如下:(可看出是非线性模型~)

相关文档
最新文档