# How to apply smooth approximation to non-linear complementarity constraints?

$$P =$$

$$x, if U \geq U^{max}$$

$$y, if U^{up} < U < U^{max}$$

$$z, if U^{down} < U < U^{up}$$

$$\alpha, if U^{min} < U < U^{down}$$

$$\beta, if U \leq U^{min}$$

Where $$P$$, and $$U$$ are variables with bounds expressed as $$P^{min} \leq P \leq P^{max}$$, $$U^{min} \leq U \leq U^{max}$$. $$x, y, z, \alpha$$, and $$\beta$$ represent nonlinear expressions. $$U^{down}$$ and $$U^{up}$$ are parameters.

Need to check boundaries for $$U$$ where $$U^{min} \le U\le U^{max}$$ and then the first and last if conditions. Still define binary variables $$\delta_x, \delta_y$$ and so on for each of the expressions. Add constraints
(1) $$U-U^{max} \le M\delta_x$$
(2) $$U^{max}-U \le M(1-\delta_x)$$

(3) $$U^{up} + e + M(\delta_y-1)\le U \le U^{max}+ e + M(1-\delta_y)$$
Similarly,
(4) $$U^{down} + e + M(\delta_z-1)\le U \le U^{up}+ e + M(1-\delta_z)$$

(5) $$U^{min} + e + M(\delta_a-1)\le U \le U^{down}+ e + M(1-\delta_a)$$

(6) $$U^{min}-U \le M\delta_b$$
(7) $$U-U^{min}\le M(1-\delta_b)$$

(8) $$\delta_x + \delta_y + \delta_z + \delta_a + \delta_b = 1$$

$$P = x\delta_x + y\delta_y +z\delta_z + \alpha\delta_a + \beta\delta_b$$
where M and e are big/small numbers based on scale of the model\

As suggested by Dr. Rob replacing the constraints (1-7) with a single one
$$U^{max}\delta_x + (U^{up}+e)\delta_y + (U^{down}+e)\delta_z + (U^{min}+e)\delta_a \le U \le (U^{max}-e)\delta_y + (U^{up}-e)\delta_z + (U^{down}-e)\delta_a + U^{min}\delta_b$$

If using continuous then define $$0\le \delta\le 1$$ and $$\delta \in R^+$$ as SOS Type 1. For reference from Gurobi

• Thanks for the prompt answer but I am trying to implement it without binary variables as a continuous constraint by using approximation method such as a smooth approximation Jan 27 at 2:08
• You may use sos Type 1 where $\delta$ can be continuous Jan 27 at 2:17
• You can strengthen and simplify by replacing (1) through (7) with \begin{align}&\quad U^\text{max} \delta_x + (U^\text{up} + \epsilon) \delta_y + (U^\text{down} + \epsilon) \delta_z + (U^\text{min} + \epsilon) \delta_\alpha + U^\text{min} \delta_\beta \\ &\le U \\ &\le U^\text{max} \delta_x + (U^\text{max} - \epsilon) \delta_y + (U^\text{up} - \epsilon) \delta_z + (U^\text{down} - \epsilon) \delta_\alpha + U^\text{min} \delta_\beta\end{align} Jan 27 at 16:37