cronian.demands

Functions to add prosumer’s demands to the optimization model.

Functions

add_prosumer_demands(→ None)

Add the end_use demands of the prosumer to the optimization model.

add_prosumer_base_demand(→ None)

Add prosumer's base demand as Pyomo Param to the optimization model.

add_prosumer_flex_demands(→ None)

Add prosumer's flexible demand as Pyomo Var (with Cons) to the model.

Module Contents

cronian.demands.add_prosumer_demands(model: pyomo.environ.AbstractModel, prosumer: dict, timeseries_data: pandas.DataFrame, number_of_timesteps: int, end_use_demand: str, init_store_level: float = 0) None

Add the end_use demands of the prosumer to the optimization model.

Parameters:
  • model – The Pyomo model to add components to.

  • prosumer – Dictionary containing prosumer details.

  • timeseries_data – Timeseries data containing the availability factors for VRE generators and EVs doing V2G, demand profiles for prosumers, …

  • number_of_timesteps – Number of timesteps to run the optimization for.

  • end_use_demand – Name of end_use demand, e.g., space_heating.

  • init_store_level – Amount of energy to initialize the store with from previously satisfied flexible demand.

cronian.demands.add_prosumer_base_demand(model: pyomo.environ.AbstractModel, prosumer: dict, timeseries_data: pandas.DataFrame, number_of_timesteps: int, end_use_demand: str) None

Add prosumer’s base demand as Pyomo Param to the optimization model.

Parameters:
  • model – Pyomo Abstract model.

  • prosumer – Dictionary containing prosumer details.

  • timeseries_data – Timeseries data containing the availability factors for VRE generators, demand profiles of prosumers, etc.

  • number_of_timesteps – Number of timesteps to run the optimization for.

  • end_use_demand – Name of end_use demand, e.g., space_heating.

Requires model attributes:

  • time

Creates model attributes:

  • <prosumer_id>_<end_use_demand>_base_demand (Param[time]): Demand values without explicit flexibility.

cronian.demands.add_prosumer_flex_demands(model: pyomo.environ.AbstractModel, prosumer: dict, timeseries_data: pandas.DataFrame, number_of_timesteps: int, end_use_demand: str, init_store_level: float = 0) None

Add prosumer’s flexible demand as Pyomo Var (with Cons) to the model.

Flexible demand is modeled as a store, with constraints on its energy level feasible region (e_min and e_max) and energy level consistency.

If init_store_level is given, the energy level feasible region is shifted down by the specified amount, with any resulting negative values for e_min set to 0.

Parameters:
  • model – Pyomo Abstract model.

  • prosumer – Dictionary containing prosumer details.

  • timeseries_data – Timeseries data containing the availability factors for VRE generators, demand profiles of prosumers, etc.

  • number_of_timesteps – Number of timesteps to run the optimization for.

  • end_use_demand – Name of end_use demand (electricity_for_space_heating).

  • init_store_level – Amount of energy to initialize the store with from previously satisfied flexible demand.

Requires model attributes:

  • time

Creates model attributes:

  • <prosumer_id>_<end_use_demand>_flex_demand_min_energy (Param[time]): Minimum required store level for modeling explicitly flexible demand

  • <prosumer_id>_<end_use_demand>_flex_demand_max_energy (Param[time]): Maximum required store level for modeling explicitly flexible demand

  • <prosumer_id>_<end_use_demand>_flex_demand_power (Var[time]): Amount of power being consumed

  • <prosumer_id>_<end_use_demand>_flex_demand_energy (Var[time]): Actual store energy level

  • <prosumer_id>_<end_use_demand>_flex_feasible_energy_level_constraint (Constraint[time]): Limit _flex_demand_energy between min and max

  • <prosumer_id>_<end_use_demand>_flex_flex_energy_level_consistency_constraint (Constraint[time]): Set _flex_demand_energy to increase by _flex_demand_power at each time after step 0.