Model tp130
! Source version 1
! MPEC Example
! SIGN Operator Example
Parameters
opnd = -2
End Parameters
Variables
x[1] = 1, >= -1, <= 1 ! result, ends up with sign(opnd)
x[2] = 1, >= 0 ! slack variable
x[3] = 1, >= 0 ! slack variable
obj
End Variables
Equations
opnd + x[2] - x[3] = 0
obj = x[2]*(1 + x[1]) + x[3]*(1 - x[1])
! best known objective = 0
! begin of best known solution
! x[1] = -1
! x[2] = 2
! x[3] = 0
! end of best known solution
End Equations
End Model