Filter löschen
Filter löschen

Specify Objective Function Value as Tolerance

2 Ansichten (letzte 30 Tage)
David
David am 24 Jul. 2015
Beantwortet: Walter Roberson am 24 Jul. 2015
E.g. I would like to specify that the optimization routine return a solution only if the objective function there is < 1e-12. Is there a way to include this tolerance in the problem setup? Using R2013b with global optimization toolbox.
  2 Kommentare
Walter Roberson
Walter Roberson am 24 Jul. 2015
Which optimization routine are you using?
David
David am 24 Jul. 2015
I'm trying several, including fminunc, fmincon, GlobalSearch, and MultiStart. I didn't include which routine I'm using because I'd like to specify the tolerance in the problem setup, independent of the routine.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 24 Jul. 2015
In particular TolFun is possibly what you are looking for.
However, before placing restrictions on the function value, keep in mind that there might not be anywhere within the defined range where the function returns a value that low, especially within the maximum number of iterations you have allowed. Trying to solve for @(x) x.^2+1 <= 1E-12 is going to take forever if you want it to keep going until it finds a solution that satisfies the constraint.
Even within a global optimizer that offers multiple starts, you can construct functions that have arbitrarily narrow "pits" where the function value is less than 1E-12. For example,
@(x) ~(x(:,1) == 0.90579193707561922455084868488484062254428863525390625 & x(:,2) == 0.12698681629350605515327288230764679610729217529296875)
will return 0 at exactly one floating point pair, and will be 1 everywhere else. You would not be able to find the right pair without enumerating every possible floating point value, which is roughly 2^64 * 2047/2048 possibilities per member . Before telling a minimizer to keep going until it meets a condition, you need to consider how hard it is going to be for that condition to be met, as you probably don't want your program running for a few decades trying to find a difficult case.

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by