Luke Li
unread,Jun 7, 2011, 3:28:37 AM6/7/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to AMPL Modeling Language
Dear all,
Does anyone know how to define a range of summation? Either in
variable declaration or constraint declaration.
For example, I have a linear variable V[t,n,k,i,j], then I need
another variable C[t,n,k,i,j], which is a summation of V[t,n,k,i,j]
from i-1 to i+1 and j-1 to j+1.
Put numbers in this.
When i = j = 2, V[t,n,2,2,2] is a linear variable, and C[t,n,k,2,2] is
dependent on V.
C[t,n, k,2,2]=V[t,n, k,1,1]+V[t,n,k,1,2]+V[t,n,k,1,3]+ V[t,n,k,2,1] +
V[t,n,k,2,2] + V[t,n,k,2,3]+ V[t,n,k,3,1]+V[t,n,k,3,2]V[t,n,k,3,3];
Any help would be appreciated.
Regards
Luke