声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 885|回复: 0

[综合讨论] matlab遇到问题 迷茫中。。。求解答

[复制链接]
发表于 2012-2-23 20:22 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

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)];请大家忙我看一下,万分感谢!
回复
分享到:

使用道具 举报

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-21 08:08 , Processed in 0.055598 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表