I have difficulties in reading data that I need from .gdx file. I have succeeded in loading file from Excel, but I get an error when I try to access index that I need:
Sets
t time intervals / t1*t12 / [b] !! set definition[/b]
i customers / c1*c5 /
r row labels /r1*r97/
c column labels /c1,c2,c3,c4,c5/;
parameter p(r,c); [b]!! reading the table from Excel[/b]
$CALL GDXXRW Curve.xlsx trace=3 par=p rng=Sheet1!a1:f97 rdim=1 cdim=1
$gdxin Curve.gdx
$load p
$gdxin
parameter h; [b] !! reading the scalar[/b]
$CALL GDXXRW load.xlsx trace=3 par=h rng=Sheet1!i2:i2 dim=0
$GDXIN load.gdx
$LOAD h
$GDXIN
cost .. z =e= sum(t, maxLoad - sum(i, u(i,t)*cons(i)*clpu(t)*p(h,i)));
current_load(t) .. sum(i, u(i,t)*cons(i)*clpu(t)*p(i,h)) =l= maxLoad;
Code has multiple errors, but the first one I have difficulties with is when reading p(h,i) (line that is bold). I need data from gdx that is in the h column that I read also from other gdx, and i-th row that is the same as i that I am using for other variables. I am not sure if the code that I have attached is enough, so sorry in advance if something is missing.