Set j /0*4/; Parameter cost , sint ; cost = cos(PI/6.0); sint = sin(PI/6.0); Scalar m_s / 10 / ; *$macro y ((x[j]*cost-x[j+1]*sint)$((mod(ord(j)-1,2)=0)and(ord(j) lt card(j)))+(x[j-1]*sint+x[j]*cost)$((mod(ord(j)-1,2)=1)and(ord(j) lt card(j)))+x(j)$(ord(j)=card(j))) *$macro obj -Sum{j,sin(y)*power(sin((ord(j)-1+1)*y*y/PI),2.0*m_s)} $macro y ifthen(mod(ord(j)-1,2)=1, x[j-1]*sint+x[j]*cost, ifthen(ord(j)