Skip to main content
Solved

Expecting a scalar identifier (no free indices) error

  • November 21, 2020
  • 1 reply
  • 295 views

I have several problems but I think they are related to each other. For all my constraints I get the warning “The index “i” already has a scope” and I also get this warning when I want to enter my data. Also when I want to specify the objective for my Mathematical Program I get the warning: “Expecting a scalar identifier (no free indices)”. I’ve added pictures of one of my constraints, the warning from the Mathematical Program and my Set where I believe the problem might be with the index i. But I don’t really know how to fix it so if someone could help me I would be very grateful. 

 

Best answer by deannezhang

When “i “ is in the index domain field of a constraint, it is equivilant to “for all i”  or “∀ i”.  So in your case, you do not need it for the constraint Energy_demand, since all the i is already summed up. And you do not need it in the mathematical program Total_Cost either.

1 reply

deannezhang
AIMMS Champ
Forum|alt.badge.img+3
  • AIMMS Champ
  • 61 replies
  • Answer
  • November 25, 2020

When “i “ is in the index domain field of a constraint, it is equivilant to “for all i”  or “∀ i”.  So in your case, you do not need it for the constraint Energy_demand, since all the i is already summed up. And you do not need it in the mathematical program Total_Cost either.



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

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