QQ登录

只需要一步,快速开始

 注册地址  找回密码
查看: 2105|回复: 2
打印 上一主题 下一主题

程序能够运行,但是出现warning。

[复制链接]
字体大小: 正常 放大
zyz数模        

6

主题

7

听众

254

积分

升级  77%

  • TA的每日心情
    擦汗
    2014-8-8 17:23
  • 签到天数: 88 天

    [LV.6]常住居民II

    自我介绍
    大一学生,专业环境工程。对数学建模感兴趣。

    群组数学建摸协会

    群组第三届数模基础实训

    群组华南理工大学

    群组2014美赛ICMC题备战群

    跳转到指定楼层
    1#
    发表于 2013-8-8 16:59 |只看该作者 |倒序浏览
    |招呼Ta 关注Ta
    这是我定义的函数:
    function f=fun3_3(x);
    f=58*x(1)+54*x(2)+50*x(3)+0.2*sum(x.^2)-560;
    这是主程序:
    A=[-1 -1 0];
    b=-100;
    a1=[40;0;0];
    a2=100*ones(3,1);
    Aeq=[1 1 1];
    beq=[180];
    x0=[10 10 10]';
    [x,fval]=fmincon('fun3_3',x0,A,b,Aeq,beq,a1,a2,[])
    运行之后就出现这个状况:
    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

    Local minimum possible. Constraints satisfied.

    fmincon stopped because the predicted change in the objective function
    is less than the default value of the function tolerance and constraints
    are satisfied to within the default value of the constraint tolerance.

    <stopping criteria details>

    No active inequalities.

    x =

       50.0000
       60.0000
       70.0000


    fval =

       1.1280e+04
    但是答案能够算出来,最近在看规划类的模型,求大神指点,多谢
    zan
    转播转播 分享淘帖0 分享分享0 收藏收藏0 支持支持0 反对反对0 微信微信
    madio        

    3万

    主题

    1310

    听众

    5万

    积分

  • TA的每日心情
    奋斗
    2024-7-1 22:21
  • 签到天数: 2014 天

    [LV.Master]伴坛终老

    自我介绍
    数学中国站长

    社区QQ达人 邮箱绑定达人 优秀斑竹奖 发帖功臣 风雨历程奖 新人进步奖 最具活力勋章

    群组数学建模培训课堂1

    群组数学中国美赛辅助报名

    群组Matlab讨论组

    群组2013认证赛A题讨论群组

    群组2013认证赛C题讨论群组

    这个情况是正常的,系统有提示:Optimization completed because the objective function is non-decreasing in
    feasible directions, to within the default value of the function tolerance,
    and constraints are satisfied to within the default value of the constraint tolerance.
    提示说你的目标函数在可行域内不是单调下降的,所以只找到了局部最优解,如果想寻找全局最优解需要修改初始值,我修改了几个初始值得到的结果都是一样的,可以大致认定它是全局最优解了,你如果对问题的全局最优解有一定的了解,也可以根据这个选择初始点再试!

    点评

    zyz数模  十分感谢你的提示,,,,,  详情 回复 发表于 2013-8-9 16:02
    数学建模社会化
    回复

    使用道具 举报

    zyz数模        

    6

    主题

    7

    听众

    254

    积分

    升级  77%

  • TA的每日心情
    擦汗
    2014-8-8 17:23
  • 签到天数: 88 天

    [LV.6]常住居民II

    自我介绍
    大一学生,专业环境工程。对数学建模感兴趣。

    群组数学建摸协会

    群组第三届数模基础实训

    群组华南理工大学

    群组2014美赛ICMC题备战群

    madio 发表于 2013-8-9 09:52
    这个情况是正常的,系统有提示:Optimization completed because the objective function is non-decreasin ...

    十分感谢你的提示,,,,,
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 注册地址

    qq
    收缩
    • 电话咨询

    • 04714969085
    fastpost

    关于我们| 联系我们| 诚征英才| 对外合作| 产品服务| QQ

    手机版|Archiver| |繁體中文 手机客户端  

    蒙公网安备 15010502000194号

    Powered by Discuz! X2.5   © 2001-2013 数学建模网-数学中国 ( 蒙ICP备14002410号-3 蒙BBS备-0002号 )     论坛法律顾问:王兆丰

    GMT+8, 2025-5-15 13:46 , Processed in 0.548637 second(s), 69 queries .

    回顶部