Hi Guys,
I am having issues loading a range of data from Excel into GAMS. I keep getting a ‘bad dimension:30’ error, with the 30 referring to the values I am setting for the Rdim and Cdim. The offending piece of code is below, and i’ve attached the Excel sheet being imported from.
I’m tried scouring the Help docs etc, but as far as I can see, everything looks okay.
I am new to GAMS, and programming in general, so any help you can offer in simple terms would be great. I’m going a bit mad with it…
Thanks in advance,
Stevie
$CALL GDXXRW.EXE modelinputs.xls par=pipelinecapacity rng=pipelinecapacity!A1:AE31 rdim=30 cdim=30
parameter pipelinecapacity (i,j) ;
$gdxin modelinputs.gdx
$load pipelinecapacity
display pipelinecapacity
–
gamsworld.xlsx (21.6 KB)
Hi Stevie
Dimension is not the number of columns and rows of the parameter. If you have a 2-dimensional matrix stored like you did, the rdim = 1 and the cdim = 1. If you have a parameter defined over 3 sets, it is a 3-dimensional parameter that can either have rdim = 1 cdim = 2, rdim = 3 cdim = 0, etc. (see the gdxutils for an explanation).
Cheers
Renger
\
Modelworks
Gewerbestrasse 15
3600 Thun – Switzerland
+41 79 818 53 73
Info@modelworks.ch
blog.modelworks.ch
From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Stevie Lochran
Sent: Dienstag, 15. April 2014 19:03
To: gamsworld@googlegroups.com
Subject: ‘Bad Dimension’ error when importing from Excel
Hi Guys,
I am having issues loading a range of data from Excel into GAMS. I keep getting a ‘bad dimension:30’ error, with the 30 referring to the values I am setting for the Rdim and Cdim. The offending piece of code is below, and i’ve attached the Excel sheet being imported from.
I’m tried scouring the Help docs etc, but as far as I can see, everything looks okay.
I am new to GAMS, and programming in general, so any help you can offer in simple terms would be great. I’m going a bit mad with it…
Thanks in advance,
Stevie
$CALL GDXXRW.EXE modelinputs.xls par=pipelinecapacity rng=pipelinecapacity!A1:AE31 rdim=30 cdim=30
parameter pipelinecapacity (i,j) ;
$gdxin modelinputs.gdx
$load pipelinecapacity
display pipelinecapacity
\
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
–
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Hi Renger,
Thank you so much for this. It’s so obvious when someone points it out!
Cheers,
Stevie
On Tuesday, April 15, 2014 6:03:15 PM UTC+1, Stevie Lochran wrote:
Hi Guys,
I am having issues loading a range of data from Excel into GAMS. I keep getting a ‘bad dimension:30’ error, with the 30 referring to the values I am setting for the Rdim and Cdim. The offending piece of code is below, and i’ve attached the Excel sheet being imported from.
I’m tried scouring the Help docs etc, but as far as I can see, everything looks okay.
I am new to GAMS, and programming in general, so any help you can offer in simple terms would be great. I’m going a bit mad with it…
Thanks in advance,
Stevie
$CALL GDXXRW.EXE modelinputs.xls par=pipelinecapacity rng=pipelinecapacity!A1:AE31 rdim=30 cdim=30
parameter pipelinecapacity (i,j) ;
$gdxin modelinputs.gdx
$load pipelinecapacity
display pipelinecapacity
–
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.