Often times I have this issue. For example, I need to have a non-negative coefficient, say $c_0$, in my optimization problem (otherwise the problem is not convex). Moreover, to obtain this $c_0$ I analytically solve a problem in MATLAB. This analytic solution also satisfies $c_0 \geq 0$ but returns $c_0 = 10^{-5}$ and assumes this is zero. However, the solver I use complains that the problem is not convex, so assumes $c_0 < 0$.
I face many variants of this issue, especially if I re-optimize a problem and do some algebraic operations in between. It is hard to prevent this most of the time. My questions may be too broad, but:
- Do you, as OR people, have this issue generally? Is this a famous phenomenon, or is it just me?
- Is there a general way to have the same precision between the programming language (say MATLAB), and the solver (say CPLEX)?