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:
objectMethods
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
- 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.
- 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]¶
- residual_load(sector='electricity')[source]¶
Calculates the residual load for the specified sector.
See
residual_loadfor 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:
DisaggregationMethods
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:
DisaggregationMethods
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
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.