Units#

Submodules#

assume.units.demand module#

class assume.units.demand.Demand(id: str, unit_operator: str, technology: str, bidding_strategies: dict, index: DatetimeIndex, max_power: float, min_power: float, node: str = 'bus0', price: float | Series = 3000.0, location: tuple[float, float] = (0.0, 0.0), **kwargs)#

Bases: SupportsMinMax

A demand unit.

id#

The unique identifier of the unit.

Type:

str

unit_operator#

The operator of the unit.

Type:

str

technology#

The technology of the unit.

Type:

str

bidding_strategies#

The bidding strategies of the unit.

Type:

dict

index#

The index of the unit.

Type:

pandas.DatetimeIndex

max_power#

The maximum power output capacity of the power plant in MW.

Type:

float

min_power#

The minimum power output capacity of the power plant in MW. Defaults to 0.0 MW.

Type:

float, optional

node#

The node of the unit. Defaults to “bus0”.

Type:

str, optional

price#

The price of the unit.

Type:

float

location#

The location of the unit. Defaults to (0.0, 0.0).

Type:

tuple[float, float], optional

as_dict() dict#

Returns the unit as a dictionary.

Returns:

The unit as a dictionary.

Return type:

dict

calculate_marginal_cost(start: Timestamp, power: float) float#

Calculate the marginal cost of the unit returns the marginal cost of the unit based on the provided time and power.

Parameters:
  • start (pandas.Timestamp) – The start time of the dispatch.

  • power (float) – The power output of the unit.

Returns:

the marginal cost of the unit for the given power.

Return type:

float

calculate_min_max_power(start: Timestamp, end: Timestamp, product_type='energy') tuple[pandas.core.series.Series, pandas.core.series.Series]#

Calculates the minimum and maximum power output of the unit and returns the bid volume as both the minimum and maximum power output of the unit.

Parameters:
Returns:

The bid colume as both the minimum and maximum power output of the unit.

Return type:

tuple[pandas.Series, pandas.Series]

execute_current_dispatch(start: Timestamp, end: Timestamp)#

Execute the current dispatch of the unit. Returns the volume of the unit within the given time range.

Parameters:
Returns:

The volume of the unit within the gicen time range.

Return type:

pd.Series

assume.units.powerplant module#

class assume.units.powerplant.PowerPlant(id: str, unit_operator: str, technology: str, bidding_strategies: dict, index: DatetimeIndex, max_power: float, min_power: float = 0.0, efficiency: float = 1.0, additional_cost: float | Series = 0.0, partial_load_eff: bool = False, fuel_type: str = 'others', emission_factor: float = 0.0, ramp_up: float | None = None, ramp_down: float | None = None, hot_start_cost: float = 0, warm_start_cost: float = 0, cold_start_cost: float = 0, min_operating_time: float = 0, min_down_time: float = 0, downtime_hot_start: int = 8, downtime_warm_start: int = 48, heat_extraction: bool = False, max_heat_extraction: float = 0, location: Tuple[float, float] = (0.0, 0.0), node: str = 'bus0', **kwargs)#

Bases: SupportsMinMax

A class for a power plant unit.

Parameters:
  • id (str) – The ID of the storage unit.

  • unit_operator (str) – The operator of the unit.

  • technology (str) – The technology of the unit.

  • bidding_strategies (dict) – The bidding strategies of the unit.

  • index (pandas.DatetimeIndex) – The index of the unit.

  • max_power (float) – The maximum power output capacity of the power plant in MW.

  • min_power (float, optional) – The minimum power output capacity of the power plant in MW. Defaults to 0.0 MW.

  • efficiency (float, optional) – The efficiency of the power plant in converting fuel to electricity. Defaults to 1.0.

  • additional_cost (Union[float, pd.Series], optional) – Additional costs associated with power generation, in EUR/MWh. Defaults to 0.

  • partial_load_eff (bool, optional) – Does the efficiency vary at part loads? Defaults to False.

  • fuel_type (str, optional) – The type of fuel used by the power plant for power generation. Defaults to “others”.

  • emission_factor (float, optional) – The emission factor associated with the power plant’s fuel type (CO2 emissions per unit of energy produced). Defaults to 0.0.

  • ramp_up (Union[float, None], optional) – The ramp-up rate of the power plant, indicating how quickly it can increase power output. Defaults to None.

  • ramp_down (Union[float, None], optional) – The ramp-down rate of the power plant, indicating how quickly it can decrease power output. Defaults to None.

  • hot_start_cost (float, optional) – The cost of a hot start, where the power plant is restarted after a recent shutdown. Defaults to 0.

  • warm_start_cost (float, optional) – The cost of a warm start, where the power plant is restarted after a moderate downtime. Defaults to 0.

  • cold_start_cost (float, optional) – The cost of a cold start, where the power plant is restarted after a prolonged downtime. Defaults to 0.

  • min_operating_time (float, optional) – The minimum duration that the power plant must operate once started, in hours. Defaults to 0.

  • min_down_time (float, optional) – The minimum downtime required after a shutdown before the power plant can be restarted, in hours. Defaults to 0.

  • downtime_hot_start (int, optional) – The downtime required after a hot start before the power plant can be restarted, in hours. Defaults to 8.

  • downtime_warm_start (int, optional) – The downtime required after a warm start before the power plant can be restarted, in hours. Defaults to 48.

  • heat_extraction (bool, optional) – A boolean indicating whether the power plant can extract heat for external purposes. Defaults to False.

  • max_heat_extraction (float, optional) – The maximum amount of heat that the power plant can extract for external use, in some suitable unit. Defaults to 0.

  • location (Tuple[float, float], optional) – The geographical coordinates (latitude and longitude) of the power plant’s location. Defaults to (0.0, 0.0).

  • node (str, optional) – The identifier of the electrical bus or network node to which the power plant is connected. Defaults to “bus0”.

  • **kwargs (dict, optional) – Additional keyword arguments to be passed to the base class. Defaults to {}.

as_dict() dict#

Returns the attributes of the unit as a dictionary, including specific attributes.

Returns:

The attributes of the unit as a dictionary.

Return type:

dict

calc_marginal_cost_with_partial_eff(power_output: float, timestep: Timestamp = None) float | Series#

Calculates the marginal cost of the unit based on power output and timestamp, considering partial efficiency. Returns the marginal cost of the unit.

Parameters:
  • power_output (float) – The power output of the unit.

  • timestep (pd.Timestamp, optional) – The timestamp of the unit. Defaults to None.

Returns:

The marginal cost of the unit.

Return type:

float | pd.Series

calc_simple_marginal_cost()#

Calculates the marginal cost of the unit (simple method) and returns the marginal cost of the unit.

Returns:

The marginal cost of the unit.

Return type:

float

calculate_marginal_cost(start: datetime, power: float)#

Calculates the marginal cost of the unit based on the provided start time and power output and returns it. Returns the marginal cost of the unit.

Parameters:
  • start (datetime.datetime) – The start time of the dispatch.

  • power (float) – The power output of the unit.

Returns:

The marginal cost of the unit.

Return type:

float

calculate_min_max_power(start: Timestamp, end: Timestamp, product_type='energy') tuple[pandas.core.series.Series, pandas.core.series.Series]#

Calculates the minimum and maximum power output of the unit and returns it.

Parameters:
  • start (pandas.Timestamp) – The start time of the dispatch.

  • end (pandas.Timestamp) – The end time of the dispatch.

  • product_type (str, optional) – The product type of the unit. Defaults to “energy”.

Returns:

The minimum and maximum power output of the unit.

Return type:

tuple[pandas.Series, pandas.Series]

Note

The calculation does not include ramping constraints and can be used for arbitrary start times in the future.

execute_current_dispatch(start: Timestamp, end: Timestamp)#

Executes the current dispatch of the unit based on the provided timestamps.

The dispatch is only executed, if it is in the constraints given by the unit. Returns the volume of the unit within the given time range.

Parameters:
Returns:

The volume of the unit within the given time range.

Return type:

pd.Series

init_marginal_cost()#

Initializes the marginal cost of the unit using calc_cimple_marginal_cost().

Args:

set_dispatch_plan(marketconfig: MarketConfig, orderbook: list[assume.common.market_objects.Order]) None#

Adds the dispatch plan from the current market result to the total dispatch plan and calculates the cashflow.

Parameters:
  • marketconfig (MarketConfig) – The market configuration.

  • orderbook (Orderbook) – The orderbook.

assume.units.storage module#

class assume.units.storage.Storage(id: str, unit_operator: str, technology: str, bidding_strategies: dict, max_power_charge: float | Series, max_power_discharge: float | Series, max_volume: float, min_power_charge: float | Series = 0.0, min_power_discharge: float | Series = 0.0, min_volume: float = 0.0, initial_soc: float = 0.5, soc_tick: float = 0.01, efficiency_charge: float = 1, efficiency_discharge: float = 1, additional_cost_charge: float | Series = 0.0, additional_cost_discharge: float | Series = 0.0, emission_factor: float = 0.0, ramp_up_charge: float = None, ramp_down_charge: float = None, ramp_up_discharge: float = None, ramp_down_discharge: float = None, hot_start_cost: float = 0, warm_start_cost: float = 0, cold_start_cost: float = 0, min_operating_time: float = 0, min_down_time: float = 0, downtime_hot_start: int = 8, downtime_warm_start: int = 48, index: DatetimeIndex = None, location: tuple[float, float] = (0, 0), node: str = None, **kwargs)#

Bases: SupportsMinMaxCharge

A class for a storage unit.

Parameters:
  • id (str) – The ID of the storage unit.

  • technology (str) – The technology of the storage unit.

  • node (str) – The node of the storage unit.

  • max_power_charge (float) – The maximum power input of the storage unit in MW (negative value).

  • min_power_charge (float) – The minimum power input of the storage unit in MW (negative value).

  • max_power_discharge (float) – The maximum power output of the storage unit in MW.

  • min_power_discharge (float) – The minimum power output of the storage unit in MW.

  • max_volume (float) – The maximum state of charge of the storage unit in MWh (equivalent to capacity).

  • min_volume (float) – The minimum state of charge of the storage unit in MWh.

  • efficiency_charge (float) – The efficiency of the storage unit while charging.

  • efficiency_discharge (float) – The efficiency of the storage unit while discharging.

  • additional_cost_charge (Union[float, pd.Series], optional) – Additional costs associated with power consumption, in EUR/MWh. Defaults to 0.

  • additional_cost_discharge (Union[float, pd.Series], optional) – Additional costs associated with power generation, in EUR/MWh. Defaults to 0.

  • emission_factor (float) – The emission factor of the storage unit.

  • ramp_up_charge (float) – The ramp up rate of charging the storage unit in MW/15 minutes (negative value).

  • ramp_down_charge (float) – The ramp down rate of charging the storage unit in MW/15 minutes (negative value).

  • ramp_up_discharge (float) – The ramp up rate of discharging the storage unit in MW/15 minutes.

  • ramp_down_discharge (float) – The ramp down rate of discharging the storage unit in MW/15 minutes.

  • hot_start_cost (float) – The hot start cost of the storage unit in €/MW.

  • warm_start_cost (float) – The warm start cost of the storage unit in €/MW.

  • cold_start_cost (float) – The cold start cost of the storage unit in €/MW.

  • downtime_hot_start (float) – Definition of downtime before hot start in h.

  • downtime_warm_start (float) – Definition of downtime before warm start in h.

  • min_operating_time (float) – The minimum operating time of the storage unit in hours.

  • min_down_time (float) – The minimum down time of the storage unit in hours.

  • is_active (bool) – Defines whether or not the unit bids itself or is portfolio optimized.

  • bidding_startegy (str) – In case the unit is active it has to be defined which bidding strategy should be used

as_dict() dict#

Return the storage unit’s attributes as a dictionary, including specific attributes.

Returns:

The storage unit’s attributes as a dictionary.

Return type:

dict

calculate_marginal_cost(start: Timestamp, power: float) float#

Calculates the marginal cost of the unit based on the provided start time and power output and returns it. Returns the marginal cost of the unit.

Parameters:
  • start (datetime.datetime) – The start time of the dispatch.

  • power (float) – The power output of the unit.

Returns:

The marginal cost of the unit.

Return type:

float

calculate_min_max_charge(start: Timestamp, end: Timestamp, product_type='energy') tuple[pandas.core.series.Series]#

Calculates the min and max charging power for the given time period.

Parameters:
  • start (pandas.Timestamp) – The start of the current dispatch.

  • end (pandas.Timestamp) – The end of the current dispatch.

  • product_type (str) – The product type of the storage unit.

Returns:

The minimum and maximum charge power levels of the storage unit in MW.

Return type:

tuple[pd.Series]

calculate_min_max_discharge(start: Timestamp, end: Timestamp, product_type='energy') tuple[pandas.core.series.Series]#

Calculates the min and max discharging power for the given time period.

Parameters:
  • start (pandas.Timestamp) – The start of the current dispatch.

  • end (pandas.Timestamp) – The end of the current dispatch.

  • product_type (str) – The product type of the storage unit.

Returns:

The minimum and maximum discharge power levels of the storage unit in MW.

Return type:

tuple[pd.Series]

calculate_ramp_charge(soc: float, previous_power: float, power_charge: float, current_power: float = 0, min_power_charge: float = 0) float#

Adjusts the charging power to the ramping constraints.

Parameters:
  • soc (float) – The current state of charge.

  • previous_power (float) – The previous power output of the unit.

  • power_charge (float) – The charging power output of the unit.

  • current_power (float, optional) – The current power output of the unit. Defaults to 0.

  • min_power_charge (float, optional) – The minimum charging power output of the unit. Defaults to 0.

Returns:

The charging power adjusted to the ramping constraints.

Return type:

float

calculate_ramp_discharge(soc: float, previous_power: float, power_discharge: float, current_power: float = 0, min_power_discharge: float = 0) float#

Adjusts the discharging power to the ramping constraints.

Parameters:
  • soc (float) – The current state of charge.

  • previous_power (float) – The previous power output of the unit.

  • power_discharge (float) – The discharging power output of the unit.

  • current_power (float, optional) – The current power output of the unit. Defaults to 0.

  • min_power_discharge (float, optional) – The minimum discharging power output of the unit. Defaults to 0.

Returns:

The discharging power adjusted to the ramping constraints.

Return type:

float

calculate_soc_max_charge(soc) float#

Calculates the maximum charge power depending on the current state of charge.

Parameters:

soc (float) – The current state of charge.

Returns:

The maximum charge power.

Return type:

float

calculate_soc_max_discharge(soc) float#

Calculates the maximum discharge power depending on the current state of charge.

Parameters:

soc (float) – The current state of charge.

Returns:

The maximum discharge power.

Return type:

float

execute_current_dispatch(start: Timestamp, end: Timestamp)#

Executes the current dispatch of the unit based on the provided timestamps.

The dispatch is only executed, if it is in the constraints given by the unit. Returns the volume of the unit within the given time range.

Parameters:
Returns:

The volume of the unit within the given time range.

Return type:

pd.Series

get_starting_costs(op_time)#

Calculates the starting costs of the unit depending on how long it was shut down

Parameters:

op_time (float) – The time the unit was shut down in hours.

Returns:

The starting costs of the unit.

Return type:

float

set_dispatch_plan(marketconfig: MarketConfig, orderbook: list[assume.common.market_objects.Order]) None#

Adds the dispatch plan from the current market result to the total dispatch plan and calculates the cashflow.

Parameters:
  • marketconfig (MarketConfig) – The market configuration.

  • orderbook (Orderbook) – The orderbook.

Module contents#