$TITLE ROOTS PROBLEM $OFFUPPER * This problem solves finds a polynomial of degree N * with M roots 1 while minimizing the sum * of the absolute values of the roots * SCALAR M order of the polynomial /7/; SCALAR N order of root 1 minus 1 / 3/; SCALAR LB absolute value of lower bound /0/; SCALAR UB upper bound /5/; SETS I index for defining the polynomial / 0*7 / J index for derivative / 0*3 / K index for product /0*7/ ; VARIABLES P(I) polynomial coefficients U(I) for L-1 norm Z l-one norm of coefficients ; INTEGER VARIABLE P ; P.LO("7") = LB + 1 ; P.UP(I) = LB + UB; P.LO(I) = LB- UB ; * P.L("10") = 1 ; * P.L("9") = -5 ; * P.L("8") = -10 ; * P.L("7") = +10 ; * P.L("6") = +5 ; * P.L("5") = -1 ; * P.L("4") = 0 ; * P.L("3") = 0 ; * P.L("2") = 0 ; * P.L("1") = 0 ; * P.L("0") = 0 ; EQUATIONS COST objective function UP(I) upper bound on P UN(I) lower bound on P P1(J) value of J-th derivative at 1 ; COST .. Z =E= SUM(I,U(I)) ; UP(I) .. P(I) - LB =L= U(I) ; UN(I) .. -P(I) + LB =L= U(I) ; P1(J) .. 0 =E= SUM(I$(ORD(I) GE ORD(J)),(P(I)-LB) *(PROD(K$ ((ORD(K) GE (ORD(I)-ORD(J) + 2)) AND (ORD(K) LE ORD(I))), ORD(K) - 1 ))) ; MODEL ROOTS /ALL/; OPTION LIMROW = 30 ; OPTION ITERLIM = 100000 ; SOLVE ROOTS USING MIP MINIMIZING Z ; DISPLAY P.L, Z.L ;