Artificial intelligent assistant

linearize a sum of linear and piecewise linear functions How can I linearize the following constraint: $$ c_1\max(y + |x| - d_1, 0) + c_2\max(y + |x| - d_2, 0) + e - y \leq 0 \tag{$*$} $$ where $x,y$ are scalar decision variables, and $c_i, d_i, e \geq 0$? I believe the following is correct and would appreciate confirmation \begin{align} c_1(y+|x| - d_1) + c_2(y + |x| - d_2) + e - y \leq 0 \\\ c_1(y+|x| - d_1) + e - y \leq 0 \\\ c_2(y + |x| - d_2) + e - y \leq 0 \\\ e - y \leq 0 \end{align}

That looks correct. At the end you can observe that each of your constraints boils down to $|x|\leq s$, where $s$ is some linear combination of other stuff, and that you can write as $s\geq x, s\geq -x$.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy ff0c2fa40da84d9b3285038a454106e8