constrainys in fminsearch function

2 次查看(过去 30 天)
lefteris
lefteris 2012-12-13
Hi,
I want to use fmincon (or another Matlab function) to minimize a function over the vector x=[a, b, c, d].
One of the constraints is b!=d (b not equal to d).
Is it possible to pass any constraint like this in fminsearch? If not, do you know another function or way to implement the estimation?
Thanks in advance!

回答(1 个)

Matt J
Matt J 2012-12-13
编辑:Matt J 2012-12-13
If the function you're minimizing is continuous, there is no point in imposing such a constraint. If the unconstrained minimum does not occur at b=d, then the constraint will get enforced automatically by solving the unconstrained problem.
If the unconstrained minimum does occur at b=d, then the constrained minimum is undefined. The function can always be made arbitrarily smaller by letting
b-d-->0
asymptotically. Any algorithm applied to such a problem would have to converge to the minimizing point satisfying b=d even if each iteration of the algorithm satisfied b~=d. it It would be like trying to minimize
f(x) = x^2 s.t. x>0

类别

Help CenterFile Exchange 中查找有关 Nonlinear Optimization 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by