I am trying to formulate the following in linear programming. \begin{cases}\text{if}\,\,a>b\,\,\text{then}\,\,c=a\\\text{else}\,\,c=b.\end{cases}
I tried some things with big $M$, like $$a + my > b+m(1-y),$$ so that $y$ (binary) can be used to pick either $a$ or $b$ or $c$.
I know this does not work, because $y$ will always be $1$ in this example. But even with the help of other examples I cannot seem to figure it out. Any tips?