设变量x,y满足约束条件y>=0。x-y+1>=0。x+y-3<=0,求目标函数z=2x+y的最大值
2个回答
展开全部
可以用lingo求解,代码如下:
max=2*x+y;
y>=0;
x-y+1>=0;
x+y-3<=0;
结果为:
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
max=2*x+y;
y>=0;
x-y+1>=0;
x+y-3<=0;
结果为:
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
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |