MATLAB的fminimax函数,谁了解啊,麻烦进来看下,谢啦

来源:百度知道 编辑:UC知道 时间:2024/06/18 06:33:00
谢谢刚刚那个帮我解决问题的人,不过又有问题了
按刚刚高手的方法,我换了另外一个方程,但是结果就出不来了,

程序如下:
function hh
x0=[0,1,0,0,1,0,0,1,1,0,1,0,1,0,0,1];
aeq=[1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0;...
0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0;...
0,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0;...
0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0;...
0,0,1,0,0,0,0,0,0,0,1,0,0,0,1,0;...
0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1;...
0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0];
beq=[1;1;1;1;1;1;1];
lb=zeros(16,1);
ub=[1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1];
[x,fval,exitflag]=fminimax(@fun1,x0,[],[],aeq,beq,lb,ub,@fun2)
V=-fun2(x)
function f=fun1(x)
f=[1/(x(1)/(10*x(1)+30*0.1*x(2)+20*1.25*x(3)+25*x(4))+x(5)/(8*x(5)+10*x(6)+5*0.9*x(7)+9*x(8))-0.014)+1/(x(6)/(8*x(5)+10*x(6)+5*0.9*x(7)+9*x(8))+x(13)/(12*x(13)+7*0.9*x(14)+15*1.25*x(15)+20*x(16))-0.014)+0.9/(x(7)/(8*x(5)+10*x(6)+5*0.9*x(7)+9*x(8))+x(9)/(8*0.9*x(9)+40*0.1*x(10)+18*1.25*x(11)+6*x(12))+x(14)/(12*x(13)+7*0.9*x(14)+15*1.25*x(

没有问题啊!?结果是:

Optimization terminated: magnitude of directional derivative in search
direction less than 2*options.TolFun and maximum constraint violation
is less than options.TolCon.
Active inequalities (to within options.TolCon = 1e-006):
lower upper ineqlin ineqnonlin
3 2 9
8 6
9 7
10 12
13
14

x =

Columns 1 through 12

0.1164 1.0000 -0.0000 0.6726 0.8836 1.0000 1.0000 0.0000 -0.0000 0.0000 0.2641 1.0000

Columns 13 through 16

0.0000 -0.0000 0.7359 0.3274

fval =

104.8100
105.0249

exitflag =

105.0249

V =

0.0325
0.