Skip to main content
Solved

Index scope not specified

  • November 7, 2020
  • 7 replies
  • 1361 views

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

Best answer by Anonymous

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,

 

 

 

7 replies

  • Author
  • Explorer
  • 2 replies
  • November 7, 2020

 


  • 0 replies
  • Answer
  • November 7, 2020

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,

 

 

 


  • Author
  • Explorer
  • 2 replies
  • November 7, 2020

This makes it clear now, thanks a lot!


Forum|alt.badge.img
  • Explorer
  • 3 replies
  • May 17, 2022

 

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?

 

 


Marcel Hunting
AIMMSian
Forum|alt.badge.img+4
  • AIMMSian
  • 258 replies
  • May 18, 2022

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.


Forum|alt.badge.img
  • Explorer
  • 3 replies
  • May 18, 2022

Thank you very much Marcel


  • 0 replies
  • May 21, 2022

@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

 



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

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