Summations in objective function

Screen Shot 2020-10-30 at 6.11.27 PM.png
How do I enter this objective function into GAMS?

Here is some untested code.
alias(i, ii);
objective =e= sum(i, x(i)*(w(i) + log(P) + log(x/(sum(ii, x(ii)))) ));

  • Atharv

Would the w(i) work even though they’re given as constants?

I assumed w(i) is a parameter. You can certainly define parameters over sets.