Originally posted by: JenBerlin
Hi everyone,
I am only just getting started with using CPLEX and have run into an issue in the constraint formulation.
This may be a very silly question, but as a complete beginner I would really appreciate any help from more experienced users :)
Without going into too much detail, I will try to explain what I am trying to do:
Basically, I am trying to address two different properties of a tuple (month and period), and ensure that for each tuple of each possible combination of these two properties, a certain constraint is respected.
The tuple itself contains a lot of information which I am addressing throughout the model. This is all part of a case study and the information was given. As you can see below, the tuple is called Combos and contains information about various combinations of months, periods and fuel types.
// month, period, fuel, revenue, cost, biomass (yes/no) , calorific, so2 )
Combos = {<"June", "WDPeak", "Stockpile", 36.00, 42.56, 0, 25.81, 0.0138 >,
<"June", "WDPeak", "Colombian", 36.00, 43.93, 0, 25.12, 0.0070 >,
The objective function works as it should, but unfortunately the constraints I am trying to impose are not respected in the solution given. No errors are showing when I run the configuration.
I am pretty sure that it is a problem regarding the constraint formulation, as I am trying to address different tuple properties. It is very likely that I am not doing that in the correct way, however, I have been unable to find information about how to properly formulate them :(
This is an example of a constraint as I currently wrote it:
c1:
forall (m in Months)
forall (p in Periods)
sum (x in Combos : m == x.month)
sum (y in Combos : p == y.period)
Efficiency * production[y] <= AvailableHours[m][p] * PlantCapacity;
The idea behind it was to say that for each combination of months and periods, it is not possible to produce more energy than the plant has capacity for, based on the hours available in this specific month/period combination.
If you could give me any tips on why the constraint is not being respected and how I would need to formulate it, that would be very much appreciated.
If any more information is required just let me know. I thought I would try to keep it short for now, but I would be happy to share the files as well if that would help you help me ;)
Thanks a lot,
Jennifer
#CPLEXOptimizers#DecisionOptimization