全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 MATLAB等数学软件专版
4072 2
2017-07-08
目标函数程序


function f = objfun(x,H)

f = -x*H*x';


约束条件程序
function [c,ceq] =confun(x)
% 非线性不等式约束
c = [];
% 非线性等式约束
ceq = x*x'-1;


x0是1*29行向量,已赋值;
l是1*29行向量,已赋值为0;
H 是29*29矩阵,已赋值;
调用fmincon函数
[x, fval] = fmincon(@(x)objfun(x,H),x0, [], [], [], [], l, [], @confun);

结果显示
Warning: The default trust-region-reflective algorithm does not solve problems
with the constraints you have specified. FMINCON will use the active-set
algorithm instead. For information on applicable algorithms, see Choosing the
Algorithm in the documentation.
> In fmincon at 500
Warning: Your current settings will run a different algorithm (interior-point) in
a future release.
> In fmincon at 505
Solver stopped prematurely.
fmincon stopped because it exceeded the function evaluation limit,
options.MaxFunEvals = 2900 (the default value).

迭代次数超限制,但结果显然不受条件约束,请教为何?

2.44538174517926e+16           2.53751686447813e+16        4.78432047182774e+16          7.28633632307613e+16        2.27625959789299e+16          1.2786571 0133476e+16        6.86918182864094e+16               3.18967767788137e+16。。。。。。。


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2017-7-8 11:40:51
请教!!!!!!!!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2018-7-18 11:29:51
楼主求赐教
我的出现了这个
fmincon stopped because the size of the current step is less than
the default value of the step size tolerance and constraints are
satisfied to within the default value of the constraint tolerance.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群