GAMS Sum over a subset Topic is solved

Problems with syntax of GAMS
Post Reply
scouser_s
User
User
Posts: 8
Joined: 11 months ago

GAMS Sum over a subset

Post by scouser_s » 1 month ago

I have the following sets, variables, and parameters in a GAMS model.
image.png
Any help is much appreciated.

User avatar
Renger
Posts: 550
Joined: 3 years ago

Re: GAMS Sum over a subset

Post by Renger » 1 month ago

Hi
You can use a condition to sum:

Code: Select all

sum(t$(t.val < h.val+1), ...)
Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist

scouser_s
User
User
Posts: 8
Joined: 11 months ago

Re: GAMS Sum over a subset

Post by scouser_s » 1 month ago

Thank you!

Post Reply