Clear Filters
Clear Filters

constrainys in fminsearch function

2 views (last 30 days)
lefteris
lefteris on 13 Dec 2012
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!

Answers (1)

Matt J
Matt J on 13 Dec 2012
Edited: Matt J on 13 Dec 2012
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

Community Treasure Hunt

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

Start Hunting!