# Tag Info

## New answers tagged linearization

4

I assume that $y$ is constrained to the interval $[0,1]$. (You did not state this explicitly.) Let's assume that you have selected values $r_i$ such that $0=r_1 < r_2 < \dots < r_n = 1.$ If your solver supports SOS2 constraints, you can make $w_1, \dots, w_n$ nonnegative variables with the constraint $\sum_i w_i = 1$ and declare $\lbrace w_1,\dots,... 4 Adding the last constraint is required to guarantee that only one of the$r_i$values is selected for$y$. However, you need an additional constraint to make the relationship between$y$, its piecewise linearisation variables and the remaining of the problem constraints (especially$y=f(x)$), such as: $$y = \sum_{i=1}^{n} r_i \times w_i$$ 1 Have you tried solving the problem directly? This is simply a quadratic non-convex constraint: $$y = \frac{x^2}{1-x}\implies y - yx = x^2$$ So e.g. using Gurobi and Python, you can write: import gurobipy as gp m = gp.Model() x = m.addVar(0, x_ub) y = m.addVar(0, y_ub) m.addConstr(y - y*x == x*x) 3 I assume$X\le1$, since the formulation is infeasible for$x > 1$. What you are doing is a form of piecewise linear approximation of the function$f(x) = x^2/(1-x)$. Choosing$n$is a matter of trial and error. Obviously, the larger$n$is the more accurate the approximation is. Also obvious is that larger$n$means longer solution time (and more memory ... 5 The two denominators are equal to$1\$, so just omit the denominators, yielding a linear constraint.

Top 50 recent answers are included