Mathematical Expersion Explanation

Problems with modeling
Post Reply
Mensh95
User
User
Posts: 15
Joined: 1 year ago

Mathematical Expersion Explanation

Post by Mensh95 »

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 KiB) Downloaded 52 times
Thanks in advance
abhosekar
Moderator
Moderator
Posts: 295
Joined: 3 years ago

Re: Mathematical Expersion Explanation

Post by abhosekar »

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)

Code: Select all

set hlp(l,p);
you can then assign elements to this set

Code: Select all

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
Mensh95
User
User
Posts: 15
Joined: 1 year ago

Re: Mathematical Expersion Explanation

Post by Mensh95 »

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
abhosekar
Moderator
Moderator
Posts: 295
Joined: 3 years ago

Re: Mathematical Expersion Explanation

Post by abhosekar »

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
Post Reply