You can not put an absolute term for a variable directly into a linear model. The model fragment below will not work:
obj.. z=e=sum(j, abs(x(j))); cons(i).. sum(j, a(i,j)*x(j)) =l= b(i); model foo /all/; solve foo minimizing z using lp;
You have to introduce two positive variables xpos(j) and xneg(j), and replace:
abs(x(j)) = xplus(j) + xneg(j)
x(j) = xplus(j) - xneg(j)
Thus the correct model fragment is:
positive variable xplus(j), xneg(j); obj.. z=e=sum(j, xplus(j) + xneg(j)); cons(i).. sum(j, a(i,j)*(xplus(j) - xneg(j))) =l= b(i); model foo /all/; solve foo minimizing z using lp;