Dear Community,

currently I’m writing my master-thesis using GAMS. I would now like to combine different load-profiles from an Excel-Sheet in order to investigate the impact of the sum of the different load profiles on the scaling of the PV-plant and the Energy-Storage. The following extract shows the most important lines from my model:

Set

t time in hours / h1*h8760 /

;

Parameter

input(*,*)

load_sum(t) electricity demand of the dwelling or community

PVgen(t) PV-generation profile

;

$call gdxxrw i=dataset_DoubleDwelling_Loop.xlsx o=dataset_DoubleDwelling_Loop.gdx par=input rng=Time_series!A1 dim=2

$if errorlevel 1 $abort ‘problems while reading the Excel-file’

$gdxin dataset_DoubleDwelling_Loop.gdx

$load input

load_sum(t) = input(t,**‘%instance%’**) + inputr(t,**‘%random%’**);

PVgen(t) = input(t,‘PVgen’)

;

In order to run the model for different instances (**%instance%**) and random numbers (**%random%**) I’ve written the following .gms, which contains Sets for i and r

set i **instances** /7, 9, 12/

r **random** /28, 4, 16/

;

file frun / Run_DoubleDwelling_Loop.gms /;

put frun ‘* Run file to run ’ card(i):0 ‘instance of TestGeneration’

/" "

/" ";

loop((i,r),

put / ‘$call gams Quartiersspeicher_DoubleDwelling_Loop.gms --instance=’ i.tl:0 ’ --random=’ ord(r):0:0 ‘’

/ " ";

);

By executing this file I get something like this:

- Run file to run 3.00instance of TestGeneration

$call gams Quartiersspeicher_DoubleDwelling_Loop.gms --instance=7 --random=1

$call gams Quartiersspeicher_DoubleDwelling_Loop.gms --instance=7 --random=2

$call gams Quartiersspeicher_DoubleDwelling_Loop.gms --instance=7 --random=3

$call gams Quartiersspeicher_DoubleDwelling_Loop.gms --instance=9 --random=1

$call gams Quartiersspeicher_DoubleDwelling_Loop.gms --instance=9 --random=2

$call gams Quartiersspeicher_DoubleDwelling_Loop.gms --instance=9 --random=3

$call gams Quartiersspeicher_DoubleDwelling_Loop.gms --instance=12 --random=1

$call gams Quartiersspeicher_DoubleDwelling_Loop.gms --instance=12 --random=2

$call gams Quartiersspeicher_DoubleDwelling_Loop.gms --instance=12 --random=3

My problem now is that I do not want to combine each element of set i with each element of set r. I only want to map each element once. I hope the following example illustrates my issue.

Imagine there are the following two sets:

set i instances /7, 9, 12/

r random /28, 4, 16/

The following combinations I wish to investigate:

7 + 28

9 + 4

12 + 16

Maybe it is possible to solve this problem by using a twodimensional set, but I don’t know how this should works.

The GAMS-environment is new for me and I hope someone can helps.

Thank you very much!

Kind regards

Corsafan95