设变量x,y满足约束条件y>=0.x-y+1>=0.x+y-3扫码下载作业帮搜索答疑一搜即得

问题描述:

设变量x,y满足约束条件y>=0.x-y+1>=0.x+y-3

扫码下载作业帮
搜索答疑一搜即得

可以用lingo求解,代码如下:
max=2*x+y;
y>=0;
x-y+1>=0;
x+y-3结果为:
Global optimal solution found.
Objective value: 6.000000
Infeasibilities: 0.000000
Total solver iterations: 1
Variable Value Reduced Cost
X 3.000000 0.000000
Y 0.000000 1.000000
Row Slack or Surplus Dual Price
1 6.000000 1.000000
2 0.000000 0.000000
3 4.000000 0.000000
4 0.000000 2.000000

画图,在(3,0)点处取最大值,代入z=2x+y得6