Bug with Shiftable Energy Unit
Summary
A ShiftableEnergyUnit does not respects the profil given as a parameter. It considers the maximum of energy it can use, and if mandatory is True, e_min=e_max however, pmin != pmax
Steps to reproduce
Create a ShiftableProductionUnit with power_value = [1,2,3,4,5,6] Create a VariableConsumptionUnit show the power after solving with p.get_value()
Example Project
What is the current bug behavior?
The power_values given as a parameter is not respected power_value = [4, 5, 6, 2, 3, 4, 7, 8, 13, 15] and load.p = [0,0,..., 25,25,25,25,25,2]
What is the expected correct behavior?
and load.p = [0,0,... 4, 5, 6, 2, 3, 4, 7, 8, 13, 15]
Possible fixes
add to enable that the energy_unit is on during the same time as indicated in the list power_values :
cst_name_len = 'def_len_power_values'
cst_len = DefinitionConstraint(name=cst_name_len,
exp="lpSum({0}_u[t] for t in "
"time.I) == "
"len({"
"1})".format(self.name,
power_profile))
setattr(self, cst_name_len, cst_len)
Edited by Lou Morriet