pc_max & pd_max defined as a ratio of the capacity when obj = min_capacity
Description of the new functionality
pc_max & pd_max can be defined by a ratio of the capacity when obj = min_capacity, i.e. pc_max_ratio = 0.5 --> if capa = 20kWh, pc_max = 10kW. pc_max and pd_max have None values because the capacity is set to None with this obj.
Code implementation
pc_max and pd_max set to None BUT if statement in the EnergyUnit inheritance :
EnergyUnit.__init__(...,p_min=-pd_max if pd_max is not None else -1e5, p_max=pc_max if pc_max is not None else 1e5,...)
pc_max and pd_max defined as quantities (as capacity) and used in def_max_discharging and def max_charging
In minimize_capacity:
if pd_max_ratio is not None: def_pd_max = ExternalConstraint(exp='{0}_pd_max == ' '{0}_capacity*{1}'.format( self.name, pd_max_ratio), name='def_pd_max', parent=self) setattr(self, 'def_pd_max', def_pd_max)
Current behaviour
At the moment, def_max_charging and def_max_discharging are not taken into account.