24小时热门版块排行榜    

北京石油化工学院2026年研究生招生接收调剂公告
查看: 417  |  回复: 2

zhangyang25

新虫 (初入文坛)

[求助] matlab工具箱能正常运行,但是跳出warning怎么回事

function f =myfun(x)
f =-x(1) * x(2) * x(3);
function [c , ceq] = mycon(x)
c=[];
ceq = x(2) *x(3) + x(3) *x(1) + x(1) * x(2)-75;
x0=[4;5;6];
   lb=zeros(3,1);
   [x,fval,exitflag,output,lambda]=fmincon(@myfun,x0,[],[],[],[],lb,[],@mycon)
Warning: Trust-region-reflective algorithm does not solve this type of problem, using active-set algorithm. You could also try the interior-point
algorithm: set the Algorithm option to 'interior-point' and rerun.
> In fmincon at 460

Local minimum possible. Constraints satisfied.

fmincon stopped because the size of the current search direction is less than
twice the default value of the step size tolerance and constraints were
satisfied to within the default value of the constraint tolerance.



No active inequalities.

x =

    5.0000
    5.0000
    5.0000


fval =

-125.0000


exitflag =

     4


output =

         iterations: 7
          funcCount: 30
       lssteplength: 1
           stepsize: 1.1815e-006
          algorithm: 'medium-scale: SQP, Quasi-Newton, line-search'
      firstorderopt: 2.4478e-006
    constrviolation: 8.4075e-007
            message: [1x770 char]


lambda =

         lower: [3x1 double]
         upper: [3x1 double]
         eqlin: [0x1 double]
      eqnonlin: 2.5000
       ineqlin: [0x1 double]
    ineqnonlin: [0x1 double]
为什么结果都出来了,还有一个warning,这事怎么回事啊?这个warning会影响我的优化结果吗?谁能把帮帮我。。。
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

csgt0

荣誉版主 (著名写手)

彩色挂图

【答案】应助回帖

★ ★
感谢参与,应助指数 +1
xiegangmai: 金币+2, 谢谢参与! 2012-07-30 21:55:38
你可以看fmincon的帮助,主要是对不同的问题算法有点不一样,它会自动选择合适的,但你可以根据需要设置会更好的解决问题。至于优化结果,fmincon能获得一个极小值,与初始点位置有关系。结果是否正确还得需要自己判断。
showmethemoney
2楼2012-07-30 09:57:45
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

zhangyang25

新虫 (初入文坛)

谢谢你的回答,可是还是不怎么明白,我再琢磨琢磨。。。
3楼2012-08-04 10:55:22
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 zhangyang25 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 一志愿双非085502,267分,过四级求调剂 +3 再忙也要吃饭啊 2026-04-03 3/150 2026-04-04 05:03 by gswylq
[考研] 265求调剂 +17 林深温澜 2026-04-01 20/1000 2026-04-04 01:09 by userper
[考研] 调剂 +6 19945159693 2026-04-03 7/350 2026-04-03 22:04 by 啵啵啵0119
[考研] 考研调剂 +5 小sun要好运 2026-04-03 5/250 2026-04-03 21:43 by 啵啵啵0119
[考研] 315求调剂 +12 小羊小羊_ 2026-04-02 12/600 2026-04-03 18:22 by ls刘帅
[考研] 英一数一408,总分284,二战真诚求调剂 +13 12.27 2026-03-30 15/750 2026-04-03 14:41 by 氮气气气
[考研] 0705理学294求调剂 +3 成果成果cg5 2026-04-03 3/150 2026-04-03 14:04 by simons1972
[考研] 求材料调剂 一志愿南昌大学 328分 +5 yyy..... 2026-04-03 5/250 2026-04-03 13:46 by 百灵童888
[考研] 282求调剂 +3 aaa车辆 2026-04-02 3/150 2026-04-02 21:55 by zllcz
[考研] 085602 找调剂 +3 逆时针快乐 2026-04-02 3/150 2026-04-02 21:23 by dongzh2009
[考研] 285求调剂 +8 AZMK 2026-04-02 11/550 2026-04-02 20:16 by yulian1987
[考研] 求调剂 302分初试 0854 +5 伶可乐 2026-04-02 5/250 2026-04-02 17:53 by 笔落锦州
[考研] 调剂 +3 好好读书。 2026-04-01 6/300 2026-04-02 15:49 by liumengping
[考研] 266分,一志愿电气工程,本科材料,求材料专业调剂 +4 哇呼哼呼哼 2026-04-02 4/200 2026-04-02 13:10 by yulian1987
[考研] 一志愿北交大材料工程,总分358 +4 cs0106 2026-04-01 4/200 2026-04-02 07:42 by 尚水阁主
[考博] 26年申博 +3 staryer 2026-03-30 4/200 2026-04-01 23:21 by ai4pharm
[考研] 食品学硕362求调剂 +3 xuanxianxian 2026-04-01 3/150 2026-04-01 21:05 by 啊李999
[考研] 070300化学354求调剂 +15 101次希望 2026-03-28 15/750 2026-03-31 17:58 by jp9609
[考研] 343求调剂 +8 爱羁绊 2026-03-28 8/400 2026-03-31 16:12 by 不吃魚的貓
[考研] 305求调剂 +8 RuiFairyrui 2026-03-28 8/400 2026-03-29 08:22 by fmesaito
信息提示
请填处理意见