xqq123 发表于 2009-5-27 15:53

急求:请问fmincon优化函数中非线性约束

请问一下各位高手,如果函数中有很多非线性约束应该怎么表示啊
比如:x(1)*x(2)-x(3)=0
          x(4)*x(5)-x(6)=0
谢谢啊!急啊!请知道的帮帮忙吧!

hanihaoma 发表于 2009-5-27 17:20

看 help fmincon 里面很清楚

ChaChing 发表于 2009-5-27 18:11

copy from matlab help

nonlcon
The function that computes the nonlinear inequality constraints c(x)<= 0 and the nonlinear equality constraints ceq(x) = 0. The function nonlcon accepts a vector x and returns two vectors c and ceq. The vector c contains the nonlinear inequalities evaluated at x, and ceq contains the nonlinear equalities evaluated at x. The function nonlcon can be specified as a function handle.
x = fmincon(@myfun,x0,A,b,Aeq,beq,lb,ub,@mycon)
where mycon is a MATLAB function such as
function = mycon(x)
c = ...   % Compute nonlinear inequalities at x.
ceq = ...   % Compute nonlinear equalities at x
页: [1]
查看完整版本: 急求:请问fmincon优化函数中非线性约束