Hello,
I am new to pyomo and I have a question regarding sets.
I have some sets in gams:
Set
i 'hot streams' / 1*2 /
j 'cold streams' / 1*2 /;
Set
k 'temperature locations nok + 1' / 1*3 /
st(k) 'stages';
Singleton Set
firstK(k) 'first temperature location'
lastK(k) 'last temperature location';
st(k) = yes$(ord(k) < card(k));
firstK(k) = yes$(ord(k) = 1);
lastK(k) = yes$(ord(k) = card(k));
How to translate ‘st(k)’, 'firstK(k)', 'lastK(k)' in pyomo?
Another question
How to translate equation with $ in gams to pyomo? Like this:
eh(i,k)$st(k).. fh(i)*(th(i,k) - th(i,k+1)) =e= sum(j, q(i,j,k));
ec(j,k)$st(k).. fc(j)*(tc(j,k) - tc(j,k+1)) =e= sum(i,q(i,j,k));
THX