声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1185|回复: 2

[综合讨论] 约束非线性最优化求解问题请教

[复制链接]
发表于 2008-4-8 10:02 | 显示全部楼层 |阅读模式

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

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

x
我在做信赖域方法,其中要求子问题(非线性有约束的)的最优解,怎样求啊?除了使用fmincon之外还有没有别的函数可以求啊,fmincon要求目标函数跟约束条件放在2个不同的函数中的,不会弄啊,请高人求助!

[ 本帖最后由 eight 于 2008-4-8 10:09 编辑 ]
回复
分享到:

使用道具 举报

发表于 2008-4-8 10:09 | 显示全部楼层
原帖由 艾优 于 2008-4-8 10:02 发表
我在做信赖域方法,其中要求子问题(非线性有约束的)的最优解,怎样求啊?除了使用fmincon之外还有没有别的函数可以求啊,fmincon要求目标函数跟约束条件放在2个不同的函数中的,不会弄啊,请高人求助!
请勿使用多于1个的连续标点符号!发帖前先看版规
发表于 2008-4-8 15:47 | 显示全部楼层
help fmincon 中就有很明确的例子啊,我只把例子给你copy过来,仔细阅读一下吧

Examples
      FUN can be specified using @:
         X = fmincon(@humps,...)
      In this case, F = humps(X) returns the scalar function value F of
      the HUMPS function evaluated at X.

      FUN can also be an anonymous function:
         X = fmincon(@(x) 3*sin(x(1))+exp(x(2)),[1;1],[],[],[],[],[0 0])
      returns X = [0;0].

    If FUN or NONLCON are parameterized, you can use anonymous functions to
    capture the problem-dependent parameters. Suppose you want to minimize
    the objective given in the function myfun, subject to the nonlinear
    constraint mycon, where these two functions are parameterized by their
    second argument a1 and a2, respectively. Here myfun and mycon are
    M-file functions such as

         function f = myfun(x,a1)      
         f = x(1)^2 + a1*x(2)^2;      
                                       
         function [c,ceq] = mycon(x,a2)
         c = a2/x(1) - x(2);
         ceq = [];

    To optimize for specific values of a1 and a2, first assign the values
    to these two parameters. Then create two one-argument anonymous
    functions that capture the values of a1 and a2, and call myfun and
    mycon with two arguments. Finally, pass these anonymous functions to
    FMINCON:

         a1 = 2; a2 = 1.5; % define parameters first
         options = optimset('Algorithm','active-set'); % run active-set algorithm
         x = fmincon(@(x) myfun(x,a1),[1;2],[],[],[],[],[],[],@(x) mycon(x,a2),options)

    See also optimset, optimtool, fminunc, fminbnd, fminsearch, @, function_handle.

    Reference page in Help browser
       doc fmincon

评分

1

查看全部评分

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

本版积分规则

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

GMT+8, 2024-9-23 13:29 , Processed in 0.060578 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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