Specify Objective Function Value as Tolerance
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Walter Roberson
el 24 de Jul. de 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.
0 comentarios
Ver también
Categorías
Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!