最优化方法——用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
what are words歌词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