Syntax for sets

Problems with syntax of GAMS
Post Reply
Rofice
User
User
Posts: 19
Joined: 1 year ago

Syntax for sets

Post by Rofice » 5 months ago

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: 83
Joined: 2 years ago
Location: Rosario - Argentina

Re: Syntax for sets

Post by Manassaldi » 5 months ago

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: 19
Joined: 1 year ago

Re: Syntax for sets

Post by Rofice » 5 months ago

Thanks Sir.

Post Reply