I am working on a model and need to load an excel file of a data set. For simplicity, I am bringing not the whole model but something that I can show the problem to resolve the issue. I also upload the excel file here.
My problem is that I do not know how to load the excel file correctly. I got an example of GAMS documentation and it works well but when I try a one-dimensional excel file or even two dimensional one, I get Load dimension are different error.
Code: Select all
Sets OP /op1*op5/ K PUMP /K0*K2/ ; $call gdxxrw.exe Info.xlsx par=h rng=sheet1!A1:A5 parameter h(op) $gdxin Info.gdx $load h $gdxin ; POSITIVE VARIABLES ST(K) G(op) MAKESPAN ; FREE VARIABLE Z; EQUATIONS EQ1 OBJ ; EQ1.. h('op5')*G('op1') =e= st('k2')*h('op1'); OBJ.. Z =E= MAKESPAN; OPTION OPTCR=1E-6; OPTION DECIMALS=5; OPTION LIMROW=100; OPTION LIMCOL=100; OPTION ITERLIM=90000000; OPTION RESLIM=10800; OPTION THREADS=0; MODEL EX2 /ALL/; SOLVE EX2 USING MIP MINIMIZING Z; DISPLAY G.L,ST.L;[attachment=0]Info.xlsx[/attachment]