I am trying to develop a model, solving an optimization problem which has the following objective function:
variable p(i); minimize sum(cost) subject to p>=0
where cost is defined as:
cost(i) = 0, if p(i) = 0, cost(i) = 10*p + 23.6, if 0<p(i)<= 5, cost(i) = 15*p + 45.4, if 5<p(i)<=10, cost(i) = 20*p*p - 10*p + 375, if p(i) > 10
Note that the problem is discontinuous, which means the functions do not match at the breakpoints. As if statement is not allowed to be used in cvx, I think that declaring binary variables as indicators might work, like using the constraint:
$$p(i) - 5 + My >0$$
so that $y$ will be forced to be $1$ when $p(i) \le 5$, and $0$ otherwise. Yet, I still have no idea how to deal with the segment like $5<p(i)\le10$ by indicator variables.
Could anyone help me on this formulation?