# Convert nonlinear constraint to linear constraints for mixed-integer linear programming in MATLAB [closed]

The constraint looks something like this

$$b_1 x_1 + b_2 x_2 = 100$$

where $b_1, b_2 \in \{0,1\}$ and $x_1, x_2 \in \mathbb R$ have lower and upper bounds. Also, $b_1 + b_2 = 1$.

## closed as unclear what you're asking by José Carlos Santos, Saad, Rhys, Namaste, HurkylMar 28 '18 at 15:42

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• Is that the only problematic constraint? – Rodrigo de Azevedo Mar 28 '18 at 11:00
• No..there are other constraints but those are linear – Anoop Kumar Mangaraj Mar 28 '18 at 11:21
• Are the $b_i$´s parameters or variables? – callculus Mar 28 '18 at 11:23
• This can be linearized as: \begin{align} &(1-\delta)100 + \delta L_1 \le x_1 \le (1-\delta) 100 + \delta U_1\\ &\delta100 + (1-\delta) L_2 \le x_2 \le \delta 100 + (1-\delta) U_2\\& \delta \in \{0,1\}\\&x_i \in [L_i,U_i] \end{align} – Erwin Kalvelagen Mar 28 '18 at 16:00

$$x_1 = 100 \lor x_2 = 100$$
Let the other equality constraints be of the form $\rm A x = b$. Hence,
$$\begin{array}{rl} \mathrm A \mathrm x = \mathrm b \land \left( x_1 = 100 \lor x_2 = 100 \right) &\equiv \left( \mathrm A \mathrm x = \mathrm b \land x_1 = 100 \right) \lor \left( \mathrm A \mathrm x = \mathrm b \land x_2 = 100 \right)\\ &\equiv \left( \begin{bmatrix} \mathrm A\\ \mathrm e_1^\top\end{bmatrix} \mathrm x = \begin{bmatrix} \mathrm b\\ 100\end{bmatrix} \right) \lor \left( \begin{bmatrix} \mathrm A\\ \mathrm e_2^\top\end{bmatrix} \mathrm x = \begin{bmatrix} \mathrm b\\ 100\end{bmatrix} \right)\end{array}$$