(This piece function is successive at 63.505 beceuse I approximate some coefficients to express easily. )
And I do not know how to express it in cvx.
and it can not be expressed by the form of max(6.961e-05x+4.433e-04,y0)+max(1.657e-06x^2-1.322e-04*x+0.0065761,y0)-y0,because the quadratic function have some values that exceed y0 when x is between 0 and 63.505.(y0 is the value of the piece function in 63.505.)
Thank you.
The quadratic piece is concave, so I assume you will maximize the piecewise function or use it in a >= constant inequality. Therefore, model the hypograph, y >= t of the piecewise function, and then use t in place of y in your program. In order to do this, you can implement
if x <= 63.505t
then
t <=1st formula for y
else
t <= 2nd formula for y
Thank you,Mark.
In fact,the piecewise function is obtained by many data such as (xi,yi),and I just want to fit these data to a function.
In addition,I found a better way that is from
So I have solved this question.
Thank you very much.
Hi,Mark.
Could you please help me to change the form of
z=0.005*abs(y) exp(14.4 abs(y)/x) and x>100,-3<=y<=3, so that cvx can accept it?
Thank you very much.
This appears to be convex, but I don’t see how ti implement it in CVX. Your last hope probably is that one of the Mosek guys can figure out how to do it, and if not, it’s a candidate for @Erling’s challenge.
Note that the related function, y*exp(y) is not convex for y < -2, and therefore is not convex over its “natural” domain. I do not know any way of implementing that in CVX even for y restricted to be >= -2 (or 0).
The function abs(y)*exp(abs(y)/x), although apparently convex for all y and x, would appear to be no easier, and perhaps more difficult, to implement in CVX than y*exp(y) for y >= -2.
The first one is an exponential cone the other is rotated quadratic.
Now in general it should be OK to replace y with a positive z with z\geq |y| but frankly I haven’t checked all the correct monotonicity details. Either it works or I don’t see another way.
Son of a bitch. i don’t know how I missed that. And I just posted a comment on the Lambert W function a couple of weeks ago, linking to a post on this forum by @Erling. .
Suggestion, include Lambert W in the next version of Conic Modeling Cheatsheet.
In the function of z=0.005*abs(y) exp(14.4 abs(y)/x),x,y and z are N-dimensional vectors(such as N=100). And I want to know how to use exponential cone when variables are N-dimensional vectors.
Thank you.