Re: HELP: Reading table from CSV

2020-12-05 Thread Manuel Castro
Thank you.



How could I then pass the values in the table you suggest into the array  
LoadPowerProfile{i in LoadsCount, j in PeriodsCount}




 On Sat, 05 Dec 2020 13:54:55 + Heinrich Schuchardt 
 wrote 


On 12/5/20 2:11 PM, Manuel Castro wrote: 
> Hi all, 
> 
> First, I would like to thank you for the constant support as you have 
> always addressed my questions very promptly. 
> Second, I would like to ask you a question as I am really stuck on this one. 
> 
> I have defined the following in the code: 
> set LoadsCount; 
> set PeriodsCount; 
> param LoadPowerProfile{i in LoadsCount, j in PeriodsCount}; 
> 
> For the sake of discussion let's assume that "LoadsCount" is 1..100 and 
> "PeriodsCount" is 1..8760 (i.e. hourly values through the year). 
> I now want to fill in my array "LoadPowerProfile" with values. For that 
> I have the following table in CSV (of course this is a stylized table 
> just for you to understand what I am up to). 
 
With the GLPK you cannot read cross-tabulated CSV files. 
 
You should create a table where you have separate columns for load, 
hour, value. 
 
Load,Hour,Value 
1,0,3.4 
1,1,5.7 
... 
100,8760,6.7 
 
Best regards 
 
Heinrich 
 
> 
> Load 
> 1 
> 2 
> (…) 
> 8760 
> Load1 
> 11.98 
> 62.51 
> 
> 99.69 
> Load2 
> 86.39 
> 59.50 
> 
> 25.89 
> (...) 
> 
> 
> 
> 
> Load100 
> 67.98 
> 98.71 
> 
> 31.19 
> 
> 
> How do I read the yellow shaded area into my "LoadPowerProfile" array? I 
> would be thankful if you could give me an example of the statement i 
> should use to read this into "LoadPowerProfile" array. 
> 
> Many thanks in advance for all your support. 
> 
> Kind regards, 
> Manuel. 
>

Re: HELP: Reading table from CSV

2020-12-05 Thread Heinrich Schuchardt

On 12/5/20 2:11 PM, Manuel Castro wrote:

Hi all,

First, I would like to thank you for the constant support as you have
always addressed my questions very promptly.
Second, I would like to ask you a question as I am really stuck on this one.

I have defined the following in the code:
set LoadsCount;
set PeriodsCount;
param LoadPowerProfile{i in LoadsCount, j in PeriodsCount};

For the sake of discussion let's assume that "LoadsCount" is 1..100 and
"PeriodsCount" is 1..8760 (i.e. hourly values through the year).
I now want to fill in my array "LoadPowerProfile" with values. For that
I have the following table in CSV (of course this is a stylized table
just for you to understand what I am up to).


With the GLPK you cannot read cross-tabulated CSV files.

You should create a table where you have separate columns for load,
hour, value.

Load,Hour,Value
1,0,3.4
1,1,5.7
...
100,8760,6.7

Best regards

Heinrich



Load
1
2
(…)
8760
Load1
11.98
62.51

99.69
Load2
86.39
59.50

25.89
(...)




Load100
67.98
98.71

31.19


How do I read the yellow shaded area into my "LoadPowerProfile" array? I
would be thankful if you could give me an example of the statement i
should use to read this into "LoadPowerProfile" array.

Many thanks in advance for all your support.

Kind regards,
Manuel.






HELP: Reading table from CSV

2020-12-05 Thread Manuel Castro
Hi all,



First, I would like to thank you for the constant support as you have always 
addressed my questions very promptly.

Second, I would like to ask you a question as I am really stuck on this one.



I have defined the following in the code:
set LoadsCount; 

set PeriodsCount;

param LoadPowerProfile{i in LoadsCount, j in PeriodsCount};



For the sake of discussion let's assume that "LoadsCount" is 1..100 and 
"PeriodsCount" is 1..8760 (i.e. hourly values through the year).

I now want to fill in my array "LoadPowerProfile" with values. For that I have 
the following table in CSV (of course this is a stylized table just for you to 
understand what I am up to). 





Load

1

2

(…)

8760


Load1

11.98

62.51

 

99.69


Load2

86.39

59.50

 

25.89


(...)

 

 

 

 


Load100

67.98

98.71

 

31.19






How do I read the yellow shaded area into my "LoadPowerProfile" array? I would 
be thankful if you could give me an example of the statement i should use to 
read this into "LoadPowerProfile" array.



Many thanks in advance for all your support.



Kind regards,

Manuel.