-1
$\begingroup$

$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.

$\endgroup$

2 Answers 2

2
$\begingroup$

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

$\endgroup$
3
  • $\begingroup$ 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 $\endgroup$ Jan 27 at 2:08
  • 1
    $\begingroup$ You may use sos Type 1 where $\delta$ can be continuous $\endgroup$ Jan 27 at 2:17
  • 2
    $\begingroup$ 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} $\endgroup$
    – RobPratt
    Jan 27 at 16:37
3
$\begingroup$

Read

Bintong CHen and Patrick T. Harker, Smooth Approximations to Nonlinear Complementarity Problems, SIAM Journal on Optimization, 7(2), 403-320, 1997

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.