How can I create constraints to make sure $x=1$ if $k\geq 0$ and $x=0$ if $k<0$, where $x\in \{0,1\}$ and $k\in \mathbb{R}$?
Here is my attempt: \begin{equation}\label{cons:1} \begin{aligned} k\leq Mx \end{aligned} \end{equation}
Considering $M$ as the big-M, the above constraint makes sure $x=1$ if $k>0$. Surely, it is missing all other components.