Suppose in a model I have the expression $y_{1}(x) = 10 + 5 x^2$ where $x \in [0,20]$ is a continuous variable. In order to be able to use an MILP solver, I piecewise linearise $z_{1} = x^2$, by choosing $\{0,5,10,20\}$ as arbitrary values for $x$, as follows:
$ x = 0 \lambda_{1} + 5 \lambda_{2} + 10 \lambda_{3} + 20 \lambda_{4} \\ z_{1} =0 \lambda_{1} + 25 \lambda_{2} + 100 \lambda_{3} + 400 \lambda_{4} \\ \lambda_{1} + \lambda_{2} + \lambda_{3} + \lambda_{4} = 1 $
In the same model, I have to deal with the function:
$y_{2}(x,d) = 20 + 5 (x-d)^2, d \ge 0$, $d$ is a variable
Is there a way to express $(x-d)^2$ in a linearised form in terms of $\lambda_{1}, \lambda_{2}, \lambda_{3}, \lambda_{4}$?
Please consider that $y_{1}(x)$ could be any nonlinear function, the quadratic form stated here is just an example.