problem with undefined index in variables

150 views
Skip to first unread message

Alessandro Oscar Gilardino Arias

unread,
Sep 26, 2015, 12:27:12 AM9/26/15
to AMPL Modeling Language
Dear Bob and Victor,
How are you?

I have a question about a problem I am having in my constraint, the constraint is the following

subject to Inventario_BH40 {(fa,t) in SETD11}:
if t=1 then -sum {(bm,col) in PATRON} PATRONES40[bm,col] * BMC[bm,col,fa,t] + sum{(bh,fa,t1) in SETD2 :t1=1 and t1=t and bh=1} IFBH[bh,fa,t1] - IIBH[bh,fa] + sum{(j,k,t) in SETD2:j=1 and k=fa} Y[j,k,t]
else -sum {(bm,col) in PATRON} PATRONES40[bm,col] * BMC[bm,col,fa,t] + sum{(bh,fa,t1) in SETD2 :t1>1 and t1=t and bh=1} IFBH[bh,fa,t1] - IFBH[bh,fa,t1-1] + sum{(j,k,t1) in SETD2:j=1 and k=fa and t1=t} Y[j,k,t1] = 0;

and I have the following mesages:


modelo_cortes.mod, line 71 (offset 2413):
bh is undefined

modelo_cortes.mod, line 72 (offset 2610):
t1 is not defined

modelo_cortes.mod, line 72 (offset 2610):
bh is undefined

Why I am having those messages??

Thanks in advance!

Robert Fourer

unread,
Sep 27, 2015, 2:13:07 PM9/27/15
to am...@googlegroups.com
These errors occur because you need to parenthesize a summand that involves one term plus or minus another. See for example this explanation from an earlier post:

https://groups.google.com/d/msg/ampl/uhzjwNfxXDk/1XhB3bspAwAJ

Bob Fourer
am...@googlegroups.com

=======
Reply all
Reply to author
Forward
0 new messages