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.

Parameters:
  • id (str) – unique identifier for the 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 (pd.DatetimeIndex) – the index of the unit

  • max_power (float | pd.Series) – the maximum power output of the unit (kW)

  • min_power (float | pd.Series) – the minimum power output of the unit (kW)

  • node (str) – the node of the unit

  • price (float | pd.Series) – the price of the unit

  • location (tuple[float, float]) – the location of the unit (latitude, longitude)

  • kwargs (dict) – additional keyword arguments

as_dict() dict#

Return 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 (pd.Timestamp) – 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]#

Calculate the minimum and maximum power output of the unit. Returns the bid volume as both the minimum and maximum power output of the unit.

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

  • end (pd.Timestamp) – the end time of the dispatch

  • product_type (str) – the product type of the unit

Returns:

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

Return type:

tuple[pd.Series, pd.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:
  • start (pd.Timestamp) – the start time of the dispatch

  • end (pd.Timestamp) – the end time of the dispatch

Returns:

the volume of the unit within the given 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, fixed_cost: float = 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 powerplant unit

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

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

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

  • index (pd.DatetimeIndex) – The index of the storage 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 poewr plant in converting fuel to electricity (Defaults to 1.0)

  • fixed_cost (float, optional) – The fixed operating cost of the power plant, independent of the power output (Defaults to 0.0 monetary units)

  • partial_load_eff (bool, optional) – Does the efficiency varies 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 plants fuel type -> CO2 emissions per unit of energy produced (Defaults to 0.0.)

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

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

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

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

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

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

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

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

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

  • 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.

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

Returns:

the marginal cost of the unit

Return type:

float | pd.Series

calc_simple_marginal_cost()#

Calculate the marginal cost of the unit (simple method) 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. Returns the marginal cost of the unit.

Parameters:
  • start (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]#

Calculate the minimum and maximum power output of the unit. Returns the minimum and maximum power output of the unit. does not include ramping can be used for arbitrary start times in the future

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

  • end (pd.Timestamp) – the end time of the dispatch

  • product_type (str) – the product type of the unit

Returns:

the minimum and maximum power output of the unit

Return type:

tuple[pd.Series, pd.Series]

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:
  • start (pd.Timestamp) – the start time of the dispatch

  • end (pd.Timestamp) – the end time of the dispatch

Returns:

the volume of the unit within the given time range

Return type:

float

init_marginal_cost()#

Initialize the marginal cost of the unit.

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, variable_cost_charge: float | Series = 0.0, variable_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, fixed_cost: float = 0, 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] = None, node: str = None, **kwargs)#

Bases: SupportsMinMaxCharge

A class for a storage unit.

id#

The ID of the storage unit.

Type:

str

technology#

The technology of the storage unit.

Type:

str

node#

The node of the storage unit.

Type:

str

max_power_charge#

The maximum power input of the storage unit in MW (negative value).

Type:

float

min_power_charge#

The minimum power input of the storage unit in MW (negative value).

Type:

float

max_power_discharge#

The maximum power output of the storage unit in MW.

Type:

float

min_power_discharge#

The minimum power output of the storage unit in MW.

Type:

float

max_volume#

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

Type:

float

min_volume#

The minimum state of charge of the storage unit in MWh.

Type:

float

efficiency_charge#

The efficiency of the storage unit while charging.

Type:

float

efficiency_discharge#

The efficiency of the storage unit while discharging.

Type:

float

variable_cost_charge#

Variable costs to charge the storage unit in €/MW.

Type:

float

variable_costs_discharge#

Variable costs to discharge the storage unit in €/MW.

Type:

float

emission_factor#

The emission factor of the storage unit.

Type:

float

ramp_up_charge#

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

Type:

float, optional

ramp_down_charge#

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

Type:

float, optional

ramp_up_discharge#

The ramp up rate of discharging the storage unit in MW/15 minutes.

Type:

float, optional

ramp_down_discharge#

The ramp down rate of discharging the storage unit in MW/15 minutes.

Type:

float, optional

fixed_cost#

The fixed cost of the storage unit in €/MW. (related to capacity?)

Type:

float, optional

hot_start_cost#

The hot start cost of the storage unit in €/MW.

Type:

float, optional

warm_start_cost#

The warm start cost of the storage unit in €/MW.

Type:

float, optional

cold_start_cost#

The cold start cost of the storage unit in €/MW.

Type:

float, optional

downtime_hot_start#

Definition of downtime before hot start in h.

Type:

float, optional

downtime_warm_start#

Definition of downtime before warm start in h.

Type:

float

min_operating_time#

The minimum operating time of the storage unit in hours.

Type:

float, optional

min_down_time#

The minimum down time of the storage unit in hours.

Type:

float, optional

is_active#

Defines whether or not the unit bids itself or is portfolio optimized.

Type:

bool

bidding_startegy#

In case the unit is active it has to be defined which bidding strategy should be used

Type:

str

kwargs#

Additional keyword arguments.

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 for the given power

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

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

Returns:

the marginal cost for the given power

Return type:

float

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

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

Parameters:
  • start – The start of the current dispatch.

  • end – The end of the current dispatch.

  • product_type – 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]#

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

Parameters:
  • start – The start of the current dispatch.

  • end – The end of the current dispatch.

  • product_type – 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#

calculates the ramp for the given charging power

Parameters:
  • previous_power (float) – the previous power output of the unit

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

  • current_power (float) – the current power output of the unit

Returns:

the ramp for the given charging power

Return type:

float

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

calculates the ramp for the given discharging power

Parameters:
  • previous_power (float) – the previous power output of the unit

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

  • current_power (float) – the current power output of the unit

Returns:

the ramp for the given discharging power

Return type:

float

calculate_soc_max_charge(soc) float#
calculate_soc_max_discharge(soc) float#
execute_current_dispatch(start: Timestamp, end: Timestamp)#

Execute the current dispatch of the storage unit. Returns the dispatched energy in MWh.

Parameters:
  • start – The start of the current dispatch.

  • end – The end of the current dispatch.

Returns:

The dispatched energy in MWh.

Return type:

pd.Series

get_starting_costs(op_time)#

op_time is hours running

Module contents#