defining an objective without an analytic expression for fmincon

21 views
Skip to first unread message

Noam

unread,
Nov 19, 2017, 8:13:28 AM11/19/17
to YALMIP
I want to solve a problem with an objective that doesn't have a closed-form analytic expression.  To give a concrete example, I have a set of 2D variables representing points on which I enforce a set of analytic constraints, and the function I want to minimize is intersection of these points' convex hull with some given shape. 

If I were to try and solve this optimization problem in Matlab, I would formulate the constraints and then write a function that computes objective on each iteration explicitly, by computing the convex hull, intersecting it with the given shape and computing the area. Can I somehow supply such a function that computes the objective to YALMIP and have it call fmincon with that function as the objective callback?

Johan Löfberg

unread,
Nov 19, 2017, 11:57:51 AM11/19/17
to YALMIP
It is really not the intended use of YALMIP which is eveloped for structured optimization. If you have such a complicated unstructured function, isn't it much easier to call fmincon directly by simply passing the function pointer to fmincon

There is a hack called https://yalmip.github.io/command/sdpfun/, but really, if you use this, you typically shouldn't use YAMIP to begin with

Noam

unread,
Nov 19, 2017, 12:06:34 PM11/19/17
to YALMIP
Thank you, Johan. I completely understand this is not YALMIP's original goal. Alas, my constraint-set is so easy to formulate in YALMIP and since I am still trying different ideas for these constraints and constantly modifying them, this chimera can still be very useful for me. Thanks for the tip!

Johan Löfberg

unread,
Nov 19, 2017, 12:13:52 PM11/19/17
to YALMIP
OK. You'll see if it works
Reply all
Reply to author
Forward
0 new messages