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.