艾优 发表于 2008-4-8 10:02

约束非线性最优化求解问题请教

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

[ 本帖最后由 eight 于 2008-4-8 10:09 编辑 ]

eight 发表于 2008-4-8 10:09

原帖由 艾优 于 2008-4-8 10:02 发表 http://www.chinavib.com/forum/images/common/back.gif
我在做信赖域方法,其中要求子问题(非线性有约束的)的最优解,怎样求啊?除了使用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)),,[],[],[],[],)
      returns X = .

    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 = 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),,[],[],[],[],[],[],@(x) mycon(x,a2),options)

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

    Reference page in Help browser
       doc fmincon
页: [1]
查看完整版本: 约束非线性最优化求解问题请教