Dear All,

I have a question on how to limit the range of an index and since I’m new to Aimms I can’t find a proper solution. I just want to limit certain indices to a certain range for a specific constraint.

First example (Constraint):

Index Domain:t

Definition: e(t) <= e(t-1) |t<Tmax |t>Tmin

Error Message:

In an inclusion only the middle term is allowed to contain variables, however in the inclusion e(t) <= e(t-1) $ t < Tmax $ t the left term contains variables.

Second Example (Constraint):

Index Domain: (i,j,k,t)

Definition: r(i,j,k,t) <= o(i,k-1,t-1)*RM(i,j) |k>1|t>1

Error Message: The operators <= and > should to be the same for numerical inclusion (or use parenthesis).

As I’m new to aimms I dont seem to understand the principles properly. May someone point me to the right way to do this?

Thank you very much in advance!

Best Regards

Jonas

**Best answer by Gertjan**

You should specify the conditions in the index domain. For example, for the first:

Index Domain: t | (Tmin < t < Tmax)

Definition: e(t) <= e(t-1)

The condition depends a little on how you specified the time set with index t. If they are a set of integer values this works; if they are more something like tp-001… tp-100 or some other named period, you would need to use the ord(t) function to count the element number. Eg

Index Domain: t | (Tmin < ord(t) < Tmax)

Definition: e(t) <= e(t-1)

in above cases the constraint generation will only by for those t that fall within the condition specified.