how can I fix 148 Dimension different - The symbol is referenced with more/less indices as declared

Problems with syntax of GAMS
Post Reply
M10814020
User
User
Posts: 3
Joined: 1 month ago

how can I fix 148 Dimension different - The symbol is referenced with more/less indices as declared

Post by M10814020 » 4 weeks ago

Thank you for your suggestion
there is success

But all my content is like this
.....................................
Sets
i / 1*8761 /
j / discharge/ ;

Scalar
nt / 0.5 /
ng / 0.35 /
FIT / 3.1683 /
E / 140000 /
Rp / 26000 /
Ypua / 6 /;


Variable
sysben(i)
Renergy
Q(i,j)
IR
Rfood(i) ;
IR.lo =100;
IR.up =1000;

Equation


energy
food(i)
income(i);

energy .. Renergy =e= E * nt * ng * FIT ;
food(i) .. Rfood(i) =e= (sum(j, Q(i,j))/8761) * IR * Rp * Ypua ;
income(i) .. sysben(i) =e= Renergy + Rfood(i) ;

Model practise
/all /;


*=== Import from Excel using GDX utilities

*=== First unload to GDX file (occurs during compilation phase)
$call gdxxrw.exe waterdata.xlsx par=Level rng=sheet!A1:B8762

*=== Now import data from GDX
Parameter Level(i,j);
$gdxin waterdata.gdx
$load Level
$gdxin

*=== Fix variables to values from Excel file
Q.FX(i,j) = Level(i,j);

display Level, Q.L;

solve practise using nlp maximizing sysben ;

display
sysben.L,
Renergy.L,
Q.l,
Rfood.L ,
IR.L ;

......................................


It will show
Error 148(Dimension different - The symbol is referenced with more/less
indices as declared)

I would like to know how to modify this to make it work properly?

Post Reply