|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
各位前辈大家好,我在求解一规划模型中遇到这样的问题:所赋初值与计算结果一样,并没有达到最优解,显示出Optimization terminated: No feasible solution found.
Search direction less than 2*options.TolX but constraints are not satisfied.
具体的程序如下:
>> x0=[0.21;0.29;0.14;0.36];
>>A=[];
>> b=[];
>> Aeq=[1 1 1 1];
>> beq=[1];
>> vlb=[0.1;0.2;0.01;0.25];
>> vub=[0.5;0.3;0.2;0.45];
>> [x,fval]=fmincon('myfun',x0,A,b,Aeq,beq,vlb,vub,'mycon')
Warning: Large-scale (trust region) method does not currently solve this type of problem,
switching to medium-scale (line search).
> In fmincon at 260
其中myfun.M为function f=myfun(x);
f=(x(1)-0.1)^2+(x(2)-0.3)^2+(x(3)-0.15)^2+(x(4)-0.45)^2+(x(1)-0.5)^2+(x(2)-0.24)^2+(x(3)-0.01)^2+(x(4)-0.25)^2+(x(1)-0.1)^2+(x(2)-0.25)^2+(x(3)-0.2)^2+(x(4)-0.45)^2+(x(1)-0.5)^2+(x(2)-0.24)^2+(x(3)-0.01)^2+(x(4)-0.25)^2+(x(1)-0.15)^2+(x(2)-0.2)^2+(x(3)-0.2)^2+(x(4)-0.45)^2
mycon.M为function[g,ceq]=mycon(x);
g=[];
ceq=[x(1)+x(2)+x(3)+x(4)];请大家忙我看一下,万分感谢!
|
|