Hi,
I have a problem related to the inclusion of a gdx file because I create it but then, when I include it in the algorithm, I get: "error 495: load dimension are different".
I checked similar cases published online but they are all related to problems in specifying rdim and cdim, which is not my case.
Could you please help me finding another possible reason?
Thank you,
Marina
load dimension are different Topic is solved
Re: load dimension are different
Marina,
You have declared the symbol in your GAMS program with a different number of dimensions than the symbol has in GDX. The following example has the same problem:
gives:
If you can't figure it out send model and gdx file.
-Michael
You have declared the symbol in your GAMS program with a different number of dimensions than the symbol has in GDX. The following example has the same problem:
Code: Select all
set three(*,*,*) / 1.1.1, 2.2.2 /;
$gdxOut three
$unLoad three
$gdxOut
set two(*,*)
$gdxIn three
$load two=three
Code: Select all
--- GDXin=C:\Users\Michael\Documents\gamsdir\projdir\three.gdx
--- x.gms(7) 3 Mb 1 Error
*** Error 495 in C:\Users\Michael\Documents\gamsdir\projdir\x.gms
Load dimensions are different
-Michael
Re: load dimension are different
Thank you Michael for your answer.
Unfortunately I'm not able to solve the problem yet. This is the code I used to create the GDX file:
and this is the formulation I used to include the GDX file in the model:
and I'm attaching a couple of screeshots of the GDX file.
I hope this could allow you to identify my error.
Thank you,
Marina
Unfortunately I'm not able to solve the problem yet. This is the code I used to create the GDX file:
Code: Select all
Set r row labels;
Parameters Dt(r)
Ppv(r)
Pwt(r)
Pht(r);
$call GDXXRW.EXE Dt.xlsx Squeeze=N par=Dt rng=a1:b25 trace=3 rdim=1 cdim=1
$call GDXXRW.EXE Ppv.xlsx Squeeze=N par=Ppv rng=a1:b25 trace=3 rdim=1 cdim=1
$call GDXXRW.EXE Pwt.xlsx Squeeze=N par=Pwt rng=a1:c25 trace=3 rdim=1 cdim=1
$call GDXXRW.EXE Pht.xlsx Squeeze=N par=Pht rng=a1:c25 trace=3 rdim=1 cdim=1
$call gdxmerge Dt.gdx Ppv.gdx Pwt.gdx Pht.gdx
and this is the formulation I used to include the GDX file in the model:
Code: Select all
$gdxin merged
$load Dt Ppv Pwt Pht
$gdxin
I hope this could allow you to identify my error.
Thank you,
Marina
Re: load dimension are different
Dt has three dimensions in the GDX file and you declare it as Dt(r) (one dimensional). Not sure what your intension is but this is where GAMS chokes. The symbol Dt comes two dimensional out of gdxxrw (rdim=1 cdim=1) and then you merge things together (with gdxmerge) which add another index position.
Hope this helps,
Michael
Hope this helps,
Michael
Re: load dimension are different
I finally solved the problem, you helped me a lot!
Thank you very much,
Marina
Thank you very much,
Marina