Mathematical Expersion Explanation

Dear All,

Excuse me for this simple question, but kindly would like to know how to write the below mathematical expression (h belongs to H(l,p)) in GAMS (the one in red rectangular).
image.png
image.png
Here is my GAMS model, am I identifying it in the correct way? Please advise
Kellogg Optimization Model.gms (3.83 KB)
Thanks in advance

There is h (one dimensional set) and there H (two dimensional set). Don’t confuse the two.

Since GAMS is case insensitive, declare another set hlp(l,p)

set hlp(l,p);

you can then assign elements to this set

hlp("H1","NS") = yes;

you can then use set hlp wherever you have H in your formulation. Wherever you have h, you can use the set h.

  • Atharv

Dear Atharv,

Thanks a lot for your explanation

But my question was how to write the expression Sum h ϵ H(l,p). For example, am I writing it correctly in the below code?
<C1(l,p,t)… sum(h$HLP(l,p),ALPHA(h,l,p,t)*MAKE(h,p,t)) =l= U(l,p,t) ;>
image.png
Thanks in advance

Once you have a 2D set, everything else follows. You can write sum over hlp(l, p) as follows.

sum((l, p)$hlp(l, p), …)

will do the needful.

  • Atharv