how to minimize the non-smooth function (- min(x,y) )
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I want to minimize - min(x,y) subject to the constraint x + y <= 10 .
Which function / Tool should I use?
0 comentarios
Respuestas (3)
Walter Roberson
el 29 de Sept. de 2015
If the function is not smooth then it could have any number of "exceptions" that are arbitrarily narrow. You would need a global minimizer and even then it might not be able to find the minimum.
For example, x - (A*(x-17)).^(-1000) is effectively x except in the range [17-1/A, 17+1/A] with it being x-1 at those boundaries and effectively negative infinity inside the boundaries.
Because your non-smooth formula might have any number of narrow arbitrarily deep minima, the only way to minimize would be to examine every floating point number pair that satisfies the boundary condition.
If you had more information about the manner in which the function was non-smooth, it is possible that work-arounds might be found to allow minimization. For example if the location of the jumps was known ahead of time, then the problem could be broken up into a series of minimizations over limited ranges of values, with the global minima chosen as the smallest of those piecewise minima.
0 comentarios
JJLeov
el 29 de Sept. de 2015
3 comentarios
Walter Roberson
el 30 de Sept. de 2015
The constrained minimizer fmincon() requires the Optimization Toolbox. If you do not have that then you need to reason you way through.
When you have a function in two variables in which the variables can be interchanged without affecting the form of the function, then you know that the optimum is going to occur when (A) the two variables are the same, or when at least one of them is +/- infinity, or at least one of them sets up a 0 or an infinity that makes the other one irrelevant, or at the boundary conditions of at least one of the variables. Or (B) possibly along a shape such as a circle, or every x within the constraints. The (A) group involves tests at a finite number of points; the (B) group involves an infinite number of solutions.
Johan Löfberg
el 1 de Oct. de 2015
Editada: Walter Roberson
el 1 de Oct. de 2015
You can write this particular instance using linear programming. Note that you are minimizing max(-x,-y). The function max is a convex function, and you can rewrite this using an epigraph reformulation (standard practice in optimization modelling). Introduce a new variable z, and you can minimize z under the constraints -x<=z, -y <=z, x+y<=10. Of course, you could just as well have worked with the concave min operator and z >= -min(x,y) to obtain z + min(x,y)>=0 which is equivalent to z + x >=0, z + y >=0.
I assume you actually want to solve something more complex though, as this trivially is solved manually.
0 comentarios
Ver también
Categorías
Más información sobre Linear Programming and Mixed-Integer Linear Programming en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!