I am having quite an issue with an optimization that I need to solve. I have the constraint of the form
r1 == r2*i1
where r1 and r2 are bounded real optimization values, and i1 is a non-negative bounded integer optimization value. This is non-convex and non-linear, but I was wondering if there is a way to rewrite this into a convex-constraint by introducing auxiliary variables. For example
this answer on the MATLAB forums
shows you how it could be done for a binary variable to rewrite it to be linear. This is the dream objective, but I don't think that is feasible for non-negative integer variables. However, the next best thing is then convexity.
Perhaps it is a fundamental issue and there simply is no solution, yet I fail to see it. If that's the case, I am eager to hear it as well.
Cheers!
Lets try referring by to this brilliant response. $ r_2i_1$ where $i_1 \in Z$
Define $ x_j \in \{0,1\}^{M_i-1}$ where $ M_i = \left\lceil \log_2{(U_i + 1)} \right\rceil$
So $ r_2 i_1 = r_2 \sum_{j=0}^{M_i-1}2^jx_j$. Basically expressing the integer variable $i$ in binary form.
The above product of a binary and real variable can be further linearized as
$ z_j \le U_{r2} x_j$
$ -L_{r2}x_j \le z_j \quad$: (can be $ L_{r2}x_j \le z_j$ if $L$ is negative )
$ z_j \le r2 + (1-x_j)U_{r2}$
$ r2 - (1-x_j)L_{r2} \le z_j \quad \forall j \in \{0,...M_i-1 \}$
where $0 \lt U_{r2}$ is upper bound for r2 and $L_{r2}\lt 0$ is lower bound for $r2$.