JuMP constraint with limited dimension of an index

Hi everyboday!
In one constraint, I want to limit my index to a specific intervall within the intervall which is used in all other cases.

More specific this means: index p is normally defined in p = 1:P whereby P=10
Now, I want p being limitied by p >= R[j] as shown in the picture
grafik

Is this a way to do this ? or do I have to implement a for in front of the constraint?

@constraint(m, [i=1:M,j=1:N,p=r[j]:P], X[i,j,p] <= Z[i,j,p])

Thanks in advance for your opinions!

If Iā€™m not mistaken, this should work:

@constraint(m, [i=1:M, j=1:N, p=1:P; p >= r[j]], X[i,j,p] <= Z[i,j,p])
2 Likes