1
SET i /i1 * i10/ ; 

VARIABLES
x(i)
y
;  

I have an optimization (mip) problem where i need my control variable y to be equal to the second smallest number of x. How can I create an equation to do that?

EQUATIONS
myconstraint ;

myconstraint .. y =E= (second smallest element of x) ;
k.dkhk
  • 481
  • 1
  • 11
  • 24
  • I am usually and R programmer and what i am looking for is something like this: `y = sort(x)[2]` – k.dkhk Feb 02 '19 at 02:27

0 Answers0