Page 1 of 1

Re: controling equations with subsets

Posted: Fri Aug 24, 2018 6:52 pm
by Manassaldi
Hi, I hope this can help you.
Bye

constraint(technology)$subset_of_tech(technology).. var(technology) =g= par(technology);

Re: controling equations with subsets

Posted: Mon Aug 27, 2018 1:47 pm
by Manassaldi
Hi, you must always reference to the original set (i, j)

for example:

set
i /i1*i10/
j /j1*j15/
h /h1*h40/
technology(i,j)
subset_of_tech(i,j)
;
technology(i,j)= some set definition
subset_of_tech(i,j)= some set definition

constraint(i,j,h)$(technology(i,j) and subset_of_tech(technology)).. var(i,j,h) =g= par(i,j,h);

equation "constraint" applies to all pairs of values of (i, j) that belong to the subset "technology" and "subset_of_tech" and for all set h.
This happens because the "and" between the two subsets was used

Bye!