## define a parameter as a matrix

Problems with modeling
jkhalid
User Posts: 1
Joined: 1 year ago

### define a parameter as a matrix

Hi,
I have a 24 hour data for some load values at nodes 3, 4,5. The values for these nodes are in column 3, 4, and 5 in my .txt file.
Now I have to define a parameter P(i,t).
i is the number of nodes , in my case i is from 1 to 6.
t is the index of time periods, that is t is from 1 to 24.

I want to put non zero values for only those nodes for which I have the value in my txt file. Rest should be all zero.
That means
P(1,t) = 0,
P(2,t) = 0,
P(3,t) = 24 rows of non zero values,
P(4,t) = 24 rows of non zero values,
P(5,t) = 24 rows of non zero values,
P(6,t) = 0,
I am pretty new to GAMS and stuck on this part. Can someone guide me on how to do that?

Thank you

Fred
Posts: 121
Joined: 2 years ago

### Re: define a parameter as a matrix

Hi,

There is a Tutorial on data exchange with text files available that might be of interest to you: https://www.gams.com/latest/docs/UG_Dat ... ASCII.html

I hope this helps!

Best,
Fred