My objective function has undefined subsets in the parameter space that are difficult to discover and add to the fmincon constraints. Is there a return value for my objective function that tells fmincon to ignore a parameter value?
Show older comments
My fmincon objective function contains undefined subsets of the multi-dimensional parameter space, which are difficult to discover and add to the fmincon constraints. Is there a return value for my objective function that tells fmincon to ignore a parameter value? Nan or Inf give errors and I'm reluctant to use a valid number that would confuse the gradient algorithm.
Accepted Answer
More Answers (1)
John D'Errico
on 16 Nov 2017
0 votes
Simple anser: No.
Longer answer: Noooo.
Your function needs to be defined everywhere inside the constraint boundaries. It cannot be discontinuous. So returning inf, nan, or any garbage number will make it discontinuous, and certainly non-differentiable. No, you cannot do what you wish with fmincon.
Categories
Find more on Data Type Identification in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!