Skip to main content

Dear community,

I just rolled into AIMMS, so the application is very new to me.

I came across a problem with implementing constraints into my model. You can see the specific constraint and my model in the attached illustrations. 

After filling in the definition for the constraint, an error popped up, saying "The scope of index "cred" has not been specified.", where "cred" is the index domain for the variable "CarbonCredits".

I already tried to re-implement the whole model, change the index and i messed around with different brackets in different positions. Nonetheless, i kept getting the same error.

I would appreciate it if someone could help me out. A picture (of an example) on how the definition of this constraint should look like would be phenomenal as well.

Thanks in advance, 

Stijn

 


Hi @StijnCremers 

You are having a constraint for all ‘co2’. The variable CarbonCredits specified over index ‘cred’ is not referenced in either the index of the constraint or somehow in a function over ‘cred’ in the constraint (like you do a sum of EnergyQuantity over ‘i’ to eliminate ‘i’). This is why you get this warning. 

Hope this helps,

 

 

 


This makes it clear now, thanks a lot!


 

Hi I have similar problem I am not very good in code I would like to model this variable(see screenshoot below) but I always get the same error ''Index scope 'j' not specified'' when I add J in my index it tells me that the index scope 'j' is already specified, what to do please?

 

 


Hi @Inoox4 , the definition of TTC(t) should be:

sum( (j), NTrucks(j,t) * TC(j) )

So, TC(j) should be included in the sum.


Thank you very much Marcel


@StijnCremers @Inoox4 

Not sure if you are aware, but you can create a full text representation of parts of your code. This can be easier than having to make pictures and upload; besides, than all details of the identifiers / nodes are included. Just click on a (sub)node and use right-mouse menu. You can also select multiple nodes. 

See ‘view text model’ in:

https://how-to.aimms.com/Articles/505/building_the_model_1.html#viewing-the-identifiers

 


Reply


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator