Hi all,

Is it possible to force GAMS to choose the value for a variable from a specific set of options in an MINLP? For instance, the length of a pipe can only be 2, 5, 16 or 25 metres, how would I define the variable such that GAMS can only choose from amongst these options?

Best,

Pemberai

## Setting Specific Variable Values Topic is solved

### Re: Setting Specific Variable Values

This has little to do with GAMS. Write down your MINLP with regular math constructs then the implementation in GAMS will be easy. Perhaps you should look into some modeling book (e.g. HP Williams, cited a lot by me in this forum). A short hint: have a set of selections set s / s1*s4 / with sizes parameter p(s) / s1 2, s2 5, s3 16, s4 25/. Now introduce a binary variable b(s) with sum(s, b(s)) =e= 1; and l =e= sum(s, p(s)*b(s)); where l is the endogenous length of your pipe.

-Michael

-Michael

### Re: Setting Specific Variable Values

Thank you so much. It worked