Syntax for sets

Problems with syntax of GAMS
Post Reply
Rofice
User
User
Posts: 28
Joined: 6 years ago

Syntax for sets

Post by Rofice »

Hi,
Kindly help me in writing syntax. Set "ssmxr" is the function of (mxr,str). I have two objectives for the set "ssmxr".
(1): it can only take values of selected mixers for linearization (see set smxr).
(2): it can only take first value of str of selected mixers for linearization

Set
mxr number of mixers / 1*3 /
Str process streams / 1*10 /
imxr(mxr,str) mixer-stream (inlet) matches / 1.(1,2) , 2.(4,5), 3.(8,7) /
smxr(mxr) mixer selected for linearization / 2,3 /
ssmxr(mxr,str) only first process stream of the mixers selected for the linearization can exist;
SSmxr(mxr,str)$(imxr(mxr,str) and smxr(mxr)) = yes;
*$(ord(str) eq 1);
*
*yes$(ord(str) eq 1);
display SSmxr;
Manassaldi
User
User
Posts: 118
Joined: 7 years ago
Location: Rosario - Argentina

Re: Syntax for sets

Post by Manassaldi »

Is this code ok?
This select the stream 4 for the mixer 2 and stream 7 for mixer 3.
I hope it is useful to you
Bye

Code: Select all

Set
mxr number of mixers / 1*3 /
Str process streams / 1*10 /
imxr(mxr,str) mixer-stream (inlet) matches / 1.(1,2) , 2.(4,5), 3.(8,7) /
smxr(mxr) mixer selected for linearization / 2,3 /
ssmxr(mxr,str) only first process stream of the mixers selected for the linearization can exist
;
alias(str,strq);

SSmxr(mxr,str)$(smxr(mxr) and ord(str) eq smin(strq$imxr(mxr,strq),ord(strq))) = yes;

display SSmxr;
Rofice
User
User
Posts: 28
Joined: 6 years ago

Re: Syntax for sets

Post by Rofice »

Thanks Sir.
Post Reply