Error 148- The symbol is referenced with more or less indices

Hello everybody,

I have a basic model which I tried to code in GAMS. I see the error 148 when I try to run the model. Could you please gie me a hint what is going on? my code is as follows:

sets
n all nodes/110/
m set of terminals/1
10/
t set of time periods/1*3/;
alias(n,nn),(m,mm),(t,tt);
parameters
fc(m) annual cost
/
1 410052
2 330355
3 291985
4 523541
5 353629
6 423824
7 580160
8 452936
9 415797
10 303724/
cap(m) capacity
/
1 8592
2 2092
3 9284
4 1136
5 8267
6 3492
7 5623
8 2034
9 2834
10 4404
/;

Table D(n,nn) demand between each pairs of nodes
1 2 3 4 5 6 7 8 9 10
1 0 387 210 350 71 387 267 111 382 20
2 131 0 434 392 422 120 35 483 390 57
3 145 57 0 54 349 15 320 59 108 238
4 405 201 154 0 393 67 217 409 296 161
5 181 38 316 110 0 216 110 194 185 61
6 312 211 294 184 385 0 267 275 306 308
7 420 141 17 248 312 2 0 172 111 85
8 484 301 95 213 322 122 386 0 473 494
9 447 246 299 148 164 186 42 38 0 205
10 337 343 447 179 72 31 22 104 214 0;

Table c(m,n) cost between terminal and nodes
1 2 3 4 5 6 7 8 9 10
1 7110.196762 3346.634279 7292.527957 2122.47874 3974.719235 1253.641496 6054.097786 7355.212641 1400.65449 1774.852388
2 6950.957416 3000.37131 7373.990304 2599.040015 3973.686701 1947.939424 5526.270442 7255.170984 1784.845652 2252.765856
3 1039.639361 10255.34714 1640.421897 6237.939403 3605.82598 8067.710022 11845.50413 369.6768859 6396.665147 9188.411887
4 8966.825804 2871.985028 8988.352074 3458.28122 5777.36722 1547.853352 5856.968926 9187.710923 3019.301244 362.4417195
5 2027.986686 9112.128237 1225.027347 4637.052943 2236.316838 6528.064415 11022.41952 1719.986337 4901.651252 7695.858951
6 9904.386352 359.1127957 10581.44891 5643.777547 7159.600548 4112.457416 3044.316836 10292.26603 4920.400797 3205.919525
7 4443.313741 5147.440529 5363.730512 3066.162585 2081.780488 3969.243757 6884.012275 4834.25382 2511.462124 4737.971929
8 5244.258289 5959.621464 7182.215048 6122.470825 4714.933934 6628.568473 6269.866426 5874.160536 5470.211148 7032.634926
9 6742.60024 5090.681389 6315.721653 718.0334254 3456.456712 1298.222246 7867.652509 6823.44583 1006.127725 2535.290319
10 4274.686538 6182.961265 4197.776197 1786.05739 985.4805934 3510.307394 8423.076457 4394.695894 1839.200913 4636.424916 ;

Table cc(m,mm) cost between terminals
1 2 3 4 5 6 7 8 9 10
1 0 702.2143547 7565.653177 1871.722469 6171.102981 3529.425591 2963.238937 5415.605691 1817.288089 3097.262824
2 702.2143547 0 7493.210861 2251.263201 6207.472352 3238.638294 2614.149957 4800.387068 2427.040379 3201.791061
3 7565.653177 7493.210861 0 9382.733344 1708.923638 10563.21963 5117.114128 6238.771113 6955.181378 4559.52026
4 1871.722469 2251.263201 9382.733344 0 7919.988952 2857.050927 4810.508705 6971.072371 2842.1184 4847.277999
5 6171.102981 6207.472352 1708.923638 7919.988952 0 9393.813975 4138.942015 6065.867209 5353.904743 3079.573509
6 3529.425591 3238.638294 10563.21963 2857.050927 9393.813975 0 5464.082906 6318.497448 5229.517091 6436.339643
7 2963.238937 2614.149957 5117.114128 4810.508705 4138.942015 5464.082906 0 3089.359804 3504.699274 1980.923522
8 5415.605691 4800.387068 6238.771113 6971.072371 6065.867209 6318.497448 3089.359804 0 6475.241849 4985.028987
9 1817.288089 2427.040379 6955.181378 2842.1184 5353.904743 5229.517091 3504.699274 6475.241849 0 2473.601625
10 3097.262824 3201.791061 4559.52026 4847.277999 3079.573509 6436.339643 1980.923522 4985.028987 2473.601625 0 ;

Table ccc(n,nn) direct cost between nodes
1 2 3 4 5 6 7 8 9 10
1 0 9582.832828 2483.681542 6039.501469 3289.206743 7753.528552 11002.0479 673.3951292 6062.526289 8805.87605
2 9582.832828 0 10306.37769 5468.832508 6881.492425 4025.888225 2984.98928 9980.000902 4721.449989 3206.785618
3 2483.681542 10306.37769 0 5611.34066 3425.5547 7544.844399 12247.39417 1892.201099 5975.002008 8743.726265
4 6039.501469 5468.832508 5611.34066 0 2760.69647 1948.544328 8123.842441 6109.000327 839.9363071 3175.913254
5 3289.206743 6881.492425 3425.5547 2760.69647 0 4483.38912 8903.519136 3423.813663 2799.245613 5583.823063
6 7753.528552 4025.888225 7544.844399 1948.544328 4483.38912 0 6930.118109 7904.253159 1691.156409 1237.339889
7 11002.0479 2984.98928 12247.39417 8123.842441 8903.519136 6930.118109 0 11520.40854 7309.069229 6189.959693
8 673.3951292 9980.000902 1892.201099 6109.000327 3423.813663 7904.253159 11520.40854 0 6222.953961 9004.066859
9 6062.526289 4721.449989 5975.002008 839.9363071 2799.245613 1691.156409 7309.069229 6222.953961 0 2798.172261
10 8805.87605 3206.785618 8743.726265 3175.913254 5583.823063 1237.339889 6189.959693 9004.066859 2798.172261 0 ;

variables
y(m,t) if a terminal is open at time period t
w(n,nn,t) flow of direct shipment in time period t
x(n,nn,m,mm,t) flow passing pairs of terminals at time period t
z minimum cost;
binary variables y;
positive variables w,x;


Equations
cost objective function
demand(n,nn,t) all demand should be met
capacity(m,t) capacity violation for a terminal
open(m) each terminal opens only once;

cost…z=e=sum((n,nn,t),ccc(n,nn)w(n,nn,t))+sum((m,t),fc(m)y(m,t))+sum((n,nn,t),sum((m,mm),x(n,nn,m,mm,t)(0.5cc(m,mm)+c(m,n)+c(mm,nn))));
demand(n,nn,t)…w(n,nn,t)+sum((m,mm),x(n,nn,m,mm,t)) =e= D(n,nn);
capacity(m,t)…sum((n,nn),sum(mm,x(n,nn,m,mm,t)+x(n,nn,mm,m,t))) =l= cap(m)*sum(tt$(ord(tt) le t),y(m,tt));
open(m)…sum(t,y(m,t)) =l= 1;
model intermodal /all/;
solve intermodal using MIP minimizing z;

the error is here:
capacity(m,t)…sum((n,nn),sum(mm,x(n,nn,m,mm,t)+x(n,nn,mm,m,t))) =l= cap(m
)*sum(tt$(ord(tt) le t),y(m,tt));
**** $148,135


Thanks


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.

change
capacity(m,t)…sum((n,nn),sum(mm,x(n,nn,m,mm,t)+x(n,nn,mm,m,t))) =l= cap(m)*sum(tt$(ord(tt) le t),y(m,tt));
to
capacity(m,t)…sum((n,nn),sum(mm,x(n,nn,m,mm,t)+x(n,nn,mm,m,t))) =l= cap(m)*sum(tt$(ord(tt) le ord(t)),y(m,tt));

On Fri, Jan 2, 2015 at 6:39 PM, Fateme Fotuhi wrote:

Hello everybody,

I have a basic model which I tried to code in GAMS. I see the error 148 when I try to run the model. Could you please gie me a hint what is going on? my code is as follows:

sets
n all nodes/110/
m set of terminals/1
10/
t set of time periods/1*3/;
alias(n,nn),(m,mm),(t,tt);
parameters
fc(m) annual cost
/
1 410052
2 330355
3 291985
4 523541
5 353629
6 423824
7 580160
8 452936
9 415797
10 303724/
cap(m) capacity
/
1 8592
2 2092
3 9284
4 1136
5 8267
6 3492
7 5623
8 2034
9 2834
10 4404
/;

Table D(n,nn) demand between each pairs of nodes
1 2 3 4 5 6 7 8 9 10
1 0 387 210 350 71 387 267 111 382 20
2 131 0 434 392 422 120 35 483 390 57
3 145 57 0 54 349 15 320 59 108 238
4 405 201 154 0 393 67 217 409 296 161
5 181 38 316 110 0 216 110 194 185 61
6 312 211 294 184 385 0 267 275 306 308
7 420 141 17 248 312 2 0 172 111 85
8 484 301 95 213 322 122 386 0 473 494
9 447 246 299 148 164 186 42 38 0 205
10 337 343 447 179 72 31 22 104 214 0;

Table c(m,n) cost between terminal and nodes
1 2 3 4 5 6 7 8 9 10
1 7110.196762 3346.634279 7292.527957 2122.47874 3974.719235 1253.641496 6054.097786 7355.212641 1400.65449 1774.852388
2 6950.957416 3000.37131 7373.990304 2599.040015 3973.686701 1947.939424 5526.270442 7255.170984 1784.845652 2252.765856
3 1039.639361 10255.34714 1640.421897 6237.939403 3605.82598 8067.710022 11845.50413 369.6768859 6396.665147 9188.411887
4 8966.825804 2871.985028 8988.352074 3458.28122 5777.36722 1547.853352 5856.968926 9187.710923 3019.301244 362.4417195
5 2027.986686 9112.128237 1225.027347 4637.052943 2236.316838 6528.064415 11022.41952 1719.986337 4901.651252 7695.858951
6 9904.386352 359.1127957 10581.44891 5643.777547 7159.600548 4112.457416 3044.316836 10292.26603 4920.400797 3205.919525
7 4443.313741 5147.440529 5363.730512 3066.162585 2081.780488 3969.243757 6884.012275 4834.25382 2511.462124 4737.971929
8 5244.258289 5959.621464 7182.215048 6122.470825 4714.933934 6628.568473 6269.866426 5874.160536 5470.211148 7032.634926
9 6742.60024 5090.681389 6315.721653 718.0334254 3456.456712 1298.222246 7867.652509 6823.44583 1006.127725 2535.290319
10 4274.686538 6182.961265 4197.776197 1786.05739 985.4805934 3510.307394 8423.076457 4394.695894 1839.200913 4636.424916 ;

Table cc(m,mm) cost between terminals
1 2 3 4 5 6 7 8 9 10
1 0 702.2143547 7565.653177 1871.722469 6171.102981 3529.425591 2963.238937 5415.605691 1817.288089 3097.262824
2 702.2143547 0 7493.210861 2251.263201 6207.472352 3238.638294 2614.149957 4800.387068 2427.040379 3201.791061
3 7565.653177 7493.210861 0 9382.733344 1708.923638 10563.21963 5117.114128 6238.771113 6955.181378 4559.52026
4 1871.722469 2251.263201 9382.733344 0 7919.988952 2857.050927 4810.508705 6971.072371 2842.1184 4847.277999
5 6171.102981 6207.472352 1708.923638 7919.988952 0 9393.813975 4138.942015 6065.867209 5353.904743 3079.573509
6 3529.425591 3238.638294 10563.21963 2857.050927 9393.813975 0 5464.082906 6318.497448 5229.517091 6436.339643
7 2963.238937 2614.149957 5117.114128 4810.508705 4138.942015 5464.082906 0 3089.359804 3504.699274 1980.923522
8 5415.605691 4800.387068 6238.771113 6971.072371 6065.867209 6318.497448 3089.359804 0 6475.241849 4985.028987
9 1817.288089 2427.040379 6955.181378 2842.1184 5353.904743 5229.517091 3504.699274 6475.241849 0 2473.601625
10 3097.262824 3201.791061 4559.52026 4847.277999 3079.573509 6436.339643 1980.923522 4985.028987 2473.601625 0 ;

Table ccc(n,nn) direct cost between nodes
1 2 3 4 5 6 7 8 9 10
1 0 9582.832828 2483.681542 6039.501469 3289.206743 7753.528552 11002.0479 673.3951292 6062.526289 8805.87605
2 9582.832828 0 10306.37769 5468.832508 6881.492425 4025.888225 2984.98928 9980.000902 4721.449989 3206.785618
3 2483.681542 10306.37769 0 5611.34066 3425.5547 7544.844399 12247.39417 1892.201099 5975.002008 8743.726265
4 6039.501469 5468.832508 5611.34066 0 2760.69647 1948.544328 8123.842441 6109.000327 839.9363071 3175.913254
5 3289.206743 6881.492425 3425.5547 2760.69647 0 4483.38912 8903.519136 3423.813663 2799.245613 5583.823063
6 7753.528552 4025.888225 7544.844399 1948.544328 4483.38912 0 6930.118109 7904.253159 1691.156409 1237.339889
7 11002.0479 2984.98928 12247.39417 8123.842441 8903.519136 6930.118109 0 11520.40854 7309.069229 6189.959693
8 673.3951292 9980.000902 1892.201099 6109.000327 3423.813663 7904.253159 11520.40854 0 6222.953961 9004.066859
9 6062.526289 4721.449989 5975.002008 839.9363071 2799.245613 1691.156409 7309.069229 6222.953961 0 2798.172261
10 8805.87605 3206.785618 8743.726265 3175.913254 5583.823063 1237.339889 6189.959693 9004.066859 2798.172261 0 ;

variables
y(m,t) if a terminal is open at time period t
w(n,nn,t) flow of direct shipment in time period t
x(n,nn,m,mm,t) flow passing pairs of terminals at time period t
z minimum cost;
binary variables y;
positive variables w,x;


Equations
cost objective function
demand(n,nn,t) all demand should be met
capacity(m,t) capacity violation for a terminal
open(m) each terminal opens only once;

cost…z=e=sum((n,nn,t),ccc(n,nn)w(n,nn,t))+sum((m,t),fc(m)y(m,t))+sum((n,nn,t),sum((m,mm),x(n,nn,m,mm,t)(0.5cc(m,mm)+c(m,n)+c(mm,nn))));
demand(n,nn,t)…w(n,nn,t)+sum((m,mm),x(n,nn,m,mm,t)) =e= D(n,nn);
capacity(m,t)…sum((n,nn),sum(mm,x(n,nn,m,mm,t)+x(n,nn,mm,m,t))) =l= cap(m)*sum(tt$(ord(tt) le t),y(m,tt));
open(m)…sum(t,y(m,t)) =l= 1;
model intermodal /all/;
solve intermodal using MIP minimizing z;

the error is here:
capacity(m,t)…sum((n,nn),sum(mm,x(n,nn,m,mm,t)+x(n,nn,mm,m,t))) =l= cap(m
)*sum(tt$(ord(tt) le t),y(m,tt));
**** $148,135


Thanks


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.