etrago.disaggregate package

etrago.disaggregate.spatial module

spatial.py defines the methods to run spatial disaggregation on networks.

class etrago.disaggregate.spatial.Disaggregation(original_network, clustered_network, busmap, skip=())[source]

Bases: object

Methods

add_constraints(cluster[, extra_functionality])

Dummy function that allows the extension of extra_functionalites by custom conditions.

construct_partial_network(cluster, scenario)

Compute the partial network that has been merged into a single cluster.

residual_load([sector])

Calculates the residual load for the specified sector.

solve(scenario, solver)

Decompose each cluster into separate units and try to optimize them separately

execute

reindex_with_prefix

solve_partial_network

transfer_results

add_constraints(cluster, extra_functionality=None)[source]

Dummy function that allows the extension of extra_functionalites by custom conditions.

Parameters:
  • cluster – Index of the cluster to disaggregate

  • extra_functionality – extra_functionalities to extend

Returns:

unaltered extra_functionalites

reindex_with_prefix(dataframe, prefix=None)[source]
construct_partial_network(cluster, scenario)[source]

Compute the partial network that has been merged into a single cluster. The resulting network retains the external cluster buses that share some line with the cluster identified by cluster. These external buses will be prefixed by self.id_prefix in order to prevent name clashes with buses in the disaggregation

Parameters:

cluster – Index of the cluster to disaggregate

Returns:

Tuple of (partial_network, external_buses) where partial_network is the result of the partial decomposition and external_buses represent clusters adjacent to cluster that may be influenced by calculations done on the partial network.

execute(scenario, solver=None)[source]
solve(scenario, solver)[source]

Decompose each cluster into separate units and try to optimize them separately

Parameters:
  • scenario

  • solver – Solver that may be used to optimize partial networks

transfer_results(partial_network, externals, bustypes=['loads', 'generators', 'stores', 'storage_units', 'shunt_impedances'], series=None)[source]
solve_partial_network(cluster, partial_network, scenario, solver=None)[source]
residual_load(sector='electricity')[source]

Calculates the residual load for the specified sector.

See residual_load for more information.

Parameters:

sector (str) – Sector to determine residual load for. Possible options are ‘electricity’ and ‘central_heat’. Default: ‘electricity’.

Returns:

Dataframe with residual load for each bus in the network. Columns of the dataframe contain the corresponding bus name and index of the dataframe is a datetime index with the corresponding time step.

Return type:

pd.DataFrame

class etrago.disaggregate.spatial.MiniSolverDisaggregation(original_network, clustered_network, busmap, skip=())[source]

Bases: Disaggregation

Methods

add_constraints(cluster[, extra_functionality])

Dummy function that allows the extension of extra_functionalites by custom conditions.

construct_partial_network(cluster, scenario)

Compute the partial network that has been merged into a single cluster.

residual_load([sector])

Calculates the residual load for the specified sector.

solve(scenario, solver)

Decompose each cluster into separate units and try to optimize them separately

execute

reindex_with_prefix

solve_partial_network

transfer_results

add_constraints(cluster, extra_functionality=<function MiniSolverDisaggregation.<lambda>>)[source]

Dummy function that allows the extension of extra_functionalites by custom conditions.

Parameters:
  • cluster – Index of the cluster to disaggregate

  • extra_functionality – extra_functionalities to extend

Returns:

unaltered extra_functionalites

class etrago.disaggregate.spatial.UniformDisaggregation(original_network, clustered_network, busmap, skip=())[source]

Bases: Disaggregation

Methods

add_constraints(cluster[, extra_functionality])

Dummy function that allows the extension of extra_functionalites by custom conditions.

construct_partial_network(cluster, scenario)

Compute the partial network that has been merged into a single cluster.

residual_load([sector])

Calculates the residual load for the specified sector.

solve(scenario, solver)

Decompose each cluster into separate units and try to optimize them separately

execute

reindex_with_prefix

solve_partial_network

transfer_results

solve_partial_network(cluster, partial_network, scenario, solver=None)[source]
transfer_results(*args, **kwargs)[source]
etrago.disaggregate.spatial.swap_series(s)[source]
etrago.disaggregate.spatial.filter_internal_connector(conn, is_bus_in_cluster)[source]
etrago.disaggregate.spatial.filter_left_external_connector(conn, is_bus_in_cluster)[source]
etrago.disaggregate.spatial.filter_right_external_connector(conn, is_bus_in_cluster)[source]
etrago.disaggregate.spatial.filter_buses(bus, buses)[source]
etrago.disaggregate.spatial.filter_on_buses(connecitve, buses)[source]
etrago.disaggregate.spatial.update_constraints(network, externals)[source]
etrago.disaggregate.spatial.run_disaggregation(self)[source]

etrago.disaggregate.temporal module

temporal.py defines the methods to run temporal disaggregation on networks.

etrago.disaggregate.temporal.temp_disagg_soc(n, n_tsa)[source]

Interpolate state of charges for not-optimized snapshots

Parameters:
  • n (pypsa.Network) – Network in full temporal resolution without optimization results

  • n_tsa (pypsa.Network) – Network in reduced temporal resolution with optimization results

Returns:

  • stores_e_full_ts (pd.DataFrame) – Interpolated store-e timeseries for each snapshot

  • su_soc_full_ts (pd.DataFrame) – Interpolated storage units-soc timeseries for each snapshot

etrago.disaggregate.temporal.dispatch_disaggregation(self)[source]

Function running the tempral disaggregation meaning the optimization of dispatch in the temporally fully resolved network; therfore, the problem is reduced to smaller subproblems by slicing the whole considered time span while keeping inforation on the state of charge of storage units and stores to ensure compatibility and to reproduce saisonality.

Return type:

None.