I have constructed a function in Matlab that is convex and increasing (qualitatively similar to an exponential function but I am hoping to avoid the successive approximation requirement of exp). In my specification of the function I take a minimum of two convex functions which of course does not, in general, result in a convex function; however for the functions I am using, the result is convex. My function is

function y = cost( x )
y = min( inv_pos( -x ), max( square_pos( x + 3 )/4, 1 ) );

For those unfamiliar with CVX syntax, the function is min( 1/max(-x,0), max(max(x+3,0)^2/4, 1) ). CVX throws the error:

Disciplined convex programming error:
    Cannot perform the operation min( {convex}, {convex} )

Is there any way to convince CVX that my function is indeed convex? Talking to it hasn't been working.



closed as off-topic by Michael Grant, Christian Clason, Max Hutchinson, Brian Borchers, Godric Seer Mar 26 '14 at 18:56

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.


No, there is not. CVX doesn't have the rules it does for arbitrary reasons. They are directly related to the approach it uses to convert problems to solvable form. So it is non-negotiable: if you cannot express a function according to the rules, then CVX cannot handle it, because it cannot convert it to solvable form. Unless you can find a way to express this function according to the ruleset, CVX will not accept it.


Not the answer you're looking for? Browse other questions tagged or ask your own question.