Description of the issue
I have 2 sets i,j
i = m.addSet(name="j", records = ["January","February", "March"], description="months")
j = m.addSet(name="j", records=np.arange(1, 91), description="days in the 3 months")
So I define a parameter over every day which is the daily demand.
Demand_param = m.addParameter("Demand_param" , j, records=Demand_list)
Then I define a variable over the months which would be the capacity for the machinery. I do not want the variable to be defined over the hours’ set cause then it would be unrealistic.
Mach_cap= m.addVariable("Mach_capacity", "positive", i)
Then a variable about the production over the hours set.
Prod= m.addVariable("production", "positive", j)
Finally I need a constraint which will show the model that the production shall not exceed the capacity in an hourly basis. And that is where I have the most trouble. I tried this:
production_max= m.addEquation("produced_max",domain=[ i, j])
production_max[i,j]= (Mach_cap[i] >= Prod[j])
The thing is that with this way the model, will not “know” which hour (j), will correpsond to which monthly capacity (i).
I also tried mapping set i to j. The problem with that is that no element in gamspy (equations, variables etc.) can be defined over a multi-dimensional set apparently.
I do not want to sum up the whole monthly demand because then this would not gurantee that the demand is satisfied on a daily basis, but on a monthly.
Do you have any suggestions?