! MPEC formulation for SIGN function ! y = SIGN(x) returns a value y, where: ! 1 if the corresponding element of X is greater than zero ! -1 if the corresponding element of X is less than zero Model signum Parameters x = -2 End Parameters Variables y >= -1, <= 1 s_a >= 0 s_b >= 0 End Variables Equations ! test sign operator, y = sign(x) x = s_b - s_a minimize s_a*(1+y) + s_b*(1-y) End Equations End Model