matlab的fmincon函数问题

我用matlab的fmincon函数求最大值时报错,显示“矩阵接近奇异值,或者缩放错误”,求各位帮忙解答!以下是我的代码:

x0=[1,-1,1,-1,1,1,1,-1];
A=[ -0.0206 -0.0401 -0.0501 -0.0417 -0.1897 -0.2006 -0.0522 -0.0787;
    -1 0 0 0 0 0 0 0;
    0 0 0 0 1 1 0 0;
    0 0 0 0 0 0 1 0;
    0 0 0 0 0 0 0 1;
    -1 -0.0316 -0.0018 -0.2365 -0.0301 -1 0 -0.6561];
b=[-0.035;-0.1;0.3;0.3;0.15;-0.0517];
Aeq=[1 1 1 1 1 1 1 1];
VLB=[0;0;0;0;0;0;0;0];
VUB=[1;1;1;1;1;1;1;1];
[x,fval] = fmincon(@fun4,x0,A,b,Aeq,beq,VLB,VUB,@mycon);

function f=fun4(x)
%f=x(1)*r1+x(2)*r2+x(3)*r3+x(4)*r4+x(5)*r5+x(6)*r6;
f=-(0.0206*x(1)+0.0401*x(2)+0.0501*x(3)+0.0417*x(4)+0.1897*x(5)+0.2006*x(6)+0.0522*x(7)+0.0787*x(8));
end               

function [g,cep]=mycon(x)
g= [x(2)*(0.0106*x(2) +0.087*x(3)+0.0126*x(4)-0.0048*x(5) - 0.0023*x(6) - 0.0037*x(7) - 0.0035*x(8))...
+x(3)*(0.0870*x(2)+0.7140*x(3) + 0.1035*x(4) - 0.0393*x(5) - 0.0192*x(6)-0.0304*x(7)-0.0285*x(8))...
+x(4)*(0.0126*x(2)+0.1035*x(3) + 0.0150*x(4) - 0.0057*x(5) - 0.0028*x(6)-0.0044*x(7)-0.0041*x(8))...
+x(5)*(0.1106*x(5)+0.0539*x(6)+0.0146*x(7)+0.0393*x(8)-0.0048*x(2) -0.0393*x(3)-0.0057*x(4))...
+x(6)*(0.0539*x(5)+0.0262*x(6)+ 0.0071*x(7)+0.0192 *x(8)-0.0023*x(2) -0.0192*x(3)-0.0028*x(4))...
+x(7)*(0.0146*x(5)+0.0071*x(6)+0.0400*x(7)+0.0074*x(8)-0.0037*x(2) -0.0304*x(3)-0.0044*x(4))...
+x(8)*(0.0393*x(5)+ 0.0192*x(6)+0.0074*x(7)+ 0.0521*x(8)-0.0035*x(2) -0.0285*x(3)-0.0041*x(4))- 0.0777];

cep=[x(1)+x(2)+x(3)+x(4)+x(5)+x(6)+x(7)+x(8)-1];
end

以下是问题具体原因:
警告: 矩阵接近奇异值,或者缩放错误。结果可能不准确。RCOND = 4.699182e-17。

In backsolveSys
In solveAugSystem
In leastSquaresLagrangeMults
In nlpStopTest
In barrier
In fmincon (line 813)
In fcmin2222224 (line 13)

Converged to an infeasible point.

fmincon stopped because the size of the current step is less than
the default value of the step size tolerance but constraints are not
satisfied to within the default value of the constraint tolerance.

希望大家帮忙解答!


function F = myfuncon(x,wv,wa,g)
global wv wa g;
F=-(-g*(wv(3,1)-x(1)*sin(x(2)))/(x(1)*cos(x(2))+wv(1,1))+x(1)*(wa(1,1)*cos(x(2))-wa(3,1)*sin(x(2)))+wv(1,1)*wa(1,1)+wv(3,1)*wa(3,1));
end
function y=myfmincon(wv,wa,g)
global wv wa g;
A = [];b = [];
Aeq = []; beq = [];
x0=[0;0];
[x,fval]=fmincon(@myfuncon,x0,A,b,Aeq,beq,[0;-2*pi],[100;2*pi]);
y=x;
end
end
function [va,lamda] = optxestimatecon(wv,wa,g)
global wv wa g;
coder.extrinsic('myfmincon' )
x0=[1;1];
y=myfmincon(wv,wa,g);
va=y(1);
lamda=y(2);
end