用matlab解决线性规划问题,用matlab进行线性规划的时候出现问题了 求解决,duality concept是什么意思...

>> f=[0;0;0;-0.77;-0.63;-0.70;-0.575];

A=[-1 0 0 0 0 0 0

1 0 0 0 0 0 0

0 -1 -1 0 0 0 0

0 1 1 0 0 0 0

0.2 0.85 1 0 0 0 0

0 0 0 7.5 6.1 9.0 7.35

0 0 0 1.4 0 1.65 0];

b=[0;8.2;0;3.5;9;96.5;7.5];

Aeq=[1 1 0 -1 -1 0 0

1 0 -1 0 0 1 1];

beq=[-2.5;8.2];

[x,fval,exitflag,output] = linprog(f,A,b,Aeq,beq)

Exiting: One or more of the residuals, duality gap, or total relative error

has stalled:

the dual appears to be infeasible (and the primal unbounded).

(The primal residual < TolFun=1.00e-008.)

x =

1.0e+021 *

0.0000

4.9454

-4.9454

4.9454

-0.0000

-4.1961

-0.7493

fval =

-4.3984e+020

exitflag =

-3

output =

iterations: 19

algorithm: 'large-scale: interior point'

cgiterations: 0

message: [1x217 char]

constrviolation: 9.1668e+005

firstorderopt: 8.7498e+019

应该还加个x,y>0

否则解有点问题

代码如下

>> f=[0;0;0;-0.77;-0.63;-0.70;-0.575];

A=[-1 0 0 0 0 0 0

1 0 0 0 0 0 0

0 -1 -1 0 0 0 0

0 1 1 0 0 0 0

0.2 0.85 1 0 0 0 0

0 0 0 7.5 6.1 9.0 7.35

0 0 0 1.4 0 1.65 0];

b=[0;8.2;0;3.5;9;96.5;7.5];

Aeq=[1 1 0 -1 -1 0 0

1 0 -1 0 0 1 1];

beq=[2.5;8.2];

lb=zeros(7,1);

[x,fval,exitflag,output] = linprog(f,A,b,Aeq,beq,lb)

Optimization terminated.

x =

8.2000

3.5000

0.0000

5.3571

8.8429

0.0000

0.0000

fval =

-9.6960

exitflag =

1

output =

iterations: 8

algorithm: 'large-scale: interior point'

cgiterations: 0

message: 'Optimization terminated.'

constrviolation: 4.4409e-014

firstorderopt: 1.2641e-009

max w+2=9.6960

w=7.6960

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值