## Defining a binary variable set Topic is solved

Problems with modeling
ICHaLiL
User
Posts: 2
Joined: 1 week ago

### Defining a binary variable set

Hello Everyone,

I'm trying to define a set consists of binary variables. I have defined my problem below:

t=24
binary_variable_i(t) = X_i
t=1

In this problem, I should have different type of binary variables in a set. How can I code this in GAMS?

Thannks

Renger
Posts: 496
Joined: 3 years ago

### Re: Defining a binary variable set

Hi
I might have misunderstood you, but are this you are looking for (see here):

Code: Select all

``````binary variable
myvar(t);
``````
Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist

ICHaLiL
User
Posts: 2
Joined: 1 week ago

### Re: Defining a binary variable set

Yes. That's exactly what I want. Since I'm new on GAMS, questions can be easy. Sorry for that

I've another question. Similar to this question, can I create a set consisting of other sets ?

For example;

Code: Select all

``````set
t             /1*24/
x(t)         /6*8/
y(t)         /14*17/
z(t)         /14*18/
``````
and I'd like to call these x,y,z sets in the equation part depending of a variable i. Is it possible?