load dimension are different Topic is solved

Problems with modeling
Post Reply
mape
User
User
Posts: 4
Joined: 6 years ago

load dimension are different

Post by mape »

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
User avatar
bussieck
Moderator
Moderator
Posts: 1033
Joined: 7 years ago

Re: load dimension are different

Post by bussieck »

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:

Code: Select all

set three(*,*,*) / 1.1.1, 2.2.2 /;
$gdxOut three
$unLoad three
$gdxOut
set two(*,*)
$gdxIn three
$load two=three
gives:

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
If you can't figure it out send model and gdx file.

-Michael
mape
User
User
Posts: 4
Joined: 6 years ago

Re: load dimension are different

Post by mape »

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:

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
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
Attachments
gdx2.PNG
gdx.PNG
User avatar
bussieck
Moderator
Moderator
Posts: 1033
Joined: 7 years ago

Re: load dimension are different

Post by bussieck »

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
mape
User
User
Posts: 4
Joined: 6 years ago

Re: load dimension are different

Post by mape »

I finally solved the problem, you helped me a lot!

Thank you very much,

Marina
Post Reply