Errors using sum

Problems with modeling
Post Reply
jamieagz1
User
User
Posts: 1
Joined: 1 year ago

Errors using sum

Post by jamieagz1 »

Hi, I am getting error 148 (Dimension different - The symbol is referenced with more/less
indices as declared) when using the sum equation. I am trying to sum a over w and k

The following 3 lines keep giving me errors, can someone make any suggestions?

EqCost(k)..
Cost(k) =e= sum((a),w$(not sameas(w,k)),TrCost(w,k,a)*Bought(k,w));

EqPollution(k)..
Pollution(k) =e= Used(k)+sum((w,a),w$(not sameas(w,k)),Bought(k,w));

EqBought(k)..
sum(w$(not sameas(w,k),Bought(k,w)) =l= sum((w,a),License(k));
Fred
Posts: 373
Joined: 7 years ago

Re: Errors using sum

Post by Fred »

Hi,

The information provided is not sufficient to help. You seem to have declared some symbol with different domain sets than used in the shared code snippet. But since you did not share the declarations, it is impossible to pinpoint the source if the issue.

I suggest to follow the forum rules and
...send the self-contained, executable GAMS code that reproduces your problem to the group.
Best,
Fred
Post Reply