How can I resolve this sensitivity issue?

I have a constraint in the form

  for n=1:N
      Demand(u) >=demand_threshold;
  end

here, the demand_threshold is a very small value, for example, demand_threshold = 1.0000e-10

When I solve with Mosek, I get

Status: Solved
Optimal value (cvx_optval): +0

Why is it like this? Is it because, cvx is taking 1.0000e-10 as zero? How can I increase the sensitivity?

It would be the solver, Mosek, not CVX, which might have difficulty with the small number. For purposes of constraint satisfaction determination, 1e-10 is essentially zero, because it is less than the feasibility tolerance.

Perhaps you can change units so that demand_threshold is larger. Or if you really want to ensure Demand is strictly positive, then use a larger value, such as at least 1e-6.

But if the optimal value of Demand is going to be driven to a very small number, essentially zero, maybe it’s indicative of your model not being that great, and you should consider changing it to improve its behavior.

I’ve been assuming Demand is a continuous variable, despite you’re labeling this Topic as MIDCP.

https://docs.mosek.com/modeling-cookbook/practical.html#the-quality-of-a-solution