fine
Api
Transform a tessif energy system into a fine energy system. |
Internal Functionalities
Create FINE Transmissions out of Tessif's Busses. |
|
Create FINE Sources out of Tessif's Sources. |
|
Create FINE Sinks out of Tessif's Sinks. |
|
Create FINE Conversion (dynamic) out of Tessif's Transformer. |
|
Create FINE Connector as double conversion out of Tessif's Connector. |
|
Create FINE conversion out of Tessif's emitting sources. |
|
Create FINE conversions out of Tessif's emitting storages and the storage itself. |
|
Create FINE Emission Constraints as sink out of Tessif's global constraints. |
tessif.transform.es2es.fine is a tessif module aggregating all the
functionality for automatically transforming a tessif energy system into an
fine energy system.
- tessif.transform.es2es.fine.parse_esM_parameters(tessif_es)[source]
Create the FINE basic energy system model input and gather relevant information.
Note
To build a FINE energy system it is necessary to define all commodities and its units taking place within the energy system. For this purpose all carriers of the underlying tessif energy system are gathered out and stored in a set.Due to that workflow the emission default is defined by the respective global constraint or if any component of the tessif energy system has flow emissions.
- Parameters:
tessif_es¶ (AbstractEnergySystem) – Container of itarable
tessif.model.componentsobjects with the needed informations.- Returns:
region (string) – FINE’s parameters are often related to the specific region, which is specified in this string. (Default set by Tessif)
commodities (set of strings) – FINE’s energy system specified commodities (in tessif carriers).
units (set of strings) – FINE’s energy system specified commodity units (combined with the default unit in tessif).
emission (string) – For post-processing the emission default is stored as a string within the energy system model.
- tessif.transform.es2es.fine.parse_flow_parameters(tessif_es, cmp, interface)[source]
Create FINE’s component specific flow parameters out of tessif’s components.
Note
FINE define the hasCapacityVariable (boolean) for each component. It is assumed that only Sink (Demand) has a False design variable due to the fact it is a given timeseries. Although the design variable is set Flase, if the the
timeseries: minimum equals the maximum. All other design variables are set to True- Parameters:
tessif_es¶ (AbstractEnergySystem) – Container of itarable
tessif.model.componentsobjects.cmp¶ (collections.abc.Iterable) – Container of the specific components information.
interface¶ (collections.abc.Iterable) – Flow to be defined in FINE to which important parameters (e.g. costs and capacity) are assigned.
- Returns:
flow_params – Container of all relevant flow parameters of the specific component.
- Return type:
- tessif.transform.es2es.fine.conversion_factors_identification(tessif_es, cmp)[source]
Create FINE’s commodityConversionFactors out of tessif’s converions.
Note
Representing the efficiency the inflow is always a -1 float and the outflow is taken from tessif conversion. Additionally a transformer component can emit the limitation (e.g CO2) itself given in it’s own tessif flow emissions param as a positive float.
- Parameters:
tessif_es¶ (AbstractEnergySystem) – Container of itarable
tessif.model.componentsobjects that have related flow_emissions.cmp¶ (tessif component) – Container of the specific components information from the respective Tessif Energy System.
- Returns:
commodityConversionFactors – Same parameter as in FINE’s conversion component representing the efficiency and the emissions.
- Return type:
dictionary, assigns commodities (string) to a conversion factors (float)
- tessif.transform.es2es.fine.flow_costs_identification(tessif_es)[source]
Create Tessif costs for later use in es2mapping out of Tessif’s objects.
Note
Since FINE’s component’s can only relate one specific cost to the process, it is neccessary to hand over the exact given ones through tessif. They are calculated to one value out of the single ones during the transformation process.
- Parameters:
tessif_es¶ (~AbstractEnergySystem) – Container of itarable
tessif.model.componentsobjects that have related flow_emissions.- Returns:
flow_costs – to use them later in the es2mapping for correct post processing.
- Return type:
- tessif.transform.es2es.fine.flow_emissions_identification(tessif_es)[source]
Create Tessif emission for later use in es2mapping out of Tessif’s emitting objects.
Note
Since FINE’s conversion component can only relate one specific emission to the process, it is neccessary to hand over the exact given through tessif. They are calculated to one value out of the single ones.
- Parameters:
tessif_es¶ (AbstractEnergySystem) – Container of itarable
tessif.model.componentsobjects that have related flow_emissions.- Returns:
flow_emissions – to use them later in the es2mapping for correct post processing.
- Return type:
- tessif.transform.es2es.fine.expansion_costs_identification(tessif_es)[source]
Create Tessif expansion costs for later use in es2mapping out of Tessif’s objects.
Note
Since FINE’s component’s can only relate one specific cost to the process, it is neccessary to hand over the exact given ones through tessif. They are calculated to one value out of the single ones during the transformation process.
- Parameters:
tessif_es¶ (~AbstractEnergySystem) – Container of itarable
tessif.model.componentsobjects that have related invest per capacity.- Returns:
expansion_costs – to use them later in the es2mapping for correct post processing.
- Return type:
- tessif.transform.es2es.fine.create_FINE_busses(tessif_es)[source]
Create FINE Transmissions out of Tessif’s Busses.
- Parameters:
tessif_es¶ (~AbstractEnergySystem) – Container of itarable
tessif.model.components.Busobjects that are to be transformed into FINE’s transmission objects.- Returns:
fine_bus_dict – Dictionary object containing the transformed
bus objects- Return type:
- tessif.transform.es2es.fine.create_FINE_sources(tessif_es)[source]
Create FINE Sources out of Tessif’s Sources.
- Parameters:
tessif_es¶ (AbstractEnergySystem) – Container of itarable
tessif.model.components.Sourceobjects that are to be transformed into FINE’s Source objects.- Returns:
fine_sources_dict – Dictionary object containing the transformed
Source objects- Return type:
- tessif.transform.es2es.fine.create_FINE_sinks(tessif_es)[source]
Create FINE Sinks out of Tessif’s Sinks.
- Parameters:
tessif_es¶ (AbstractEnergySystem) – Container of itarable
tessif.model.components.Sinkobjects that are to be transformed into FINE’s Sink objects.- Returns:
fine_sources_dict – Dictionary object containing the transformed
Sink objects- Return type:
- tessif.transform.es2es.fine.create_FINE_conversions(tessif_es)[source]
Create FINE Conversion (dynamic) out of Tessif’s Transformer.
Note
FINE’s conversion parameters are related to the inflow. Tessif’s parameters are related to the outflow, which means a recalculation is taking place.
- Parameters:
tessif_es¶ (AbstractEnergySystem) – Container of itarable
tessif.model.components.Transformerobjects that are to be transformed into FINE’s conversion objects.- Returns:
fine_transformer_dict – Dictionary object containing the transformed
Conversion objects- Return type:
- tessif.transform.es2es.fine.create_FINE_storages(tessif_es)[source]
Create FINE Storage out of Tessif’s Storage.
Note
FINE’s Storage is not able to handle flow related emissions. All results are calculated without those emissions. Further, the initial and final SOC is yet not to be adjusted by the user. This causes different results between the models for some py_hard examples.
- Parameters:
tessif_es¶ (AbstractEnergySystem) – Container of itarable
tessif.model.components.Storageobjects that are to be transformed into FINE’s Storage objects.- Returns:
fine_storage_dict (collections.abc.Iterable) – Dictionary object containing the transformed
Storage objectsWarning
——- – If an initial state of charge is given, a warning is issued and further optimization is done without any SOC.
The self-discharge in FINE is normalized, which is why a warning is given as soon as no initial capacity is specified, but a self-discharge rate.
- tessif.transform.es2es.fine.create_FINE_connectors(tessif_es)[source]
Create FINE Connector as double conversion out of Tessif’s Connector.
Note
A conversion component is used that converts a single inflow (-1) to a single outflow (+1) without losses. Since a connector can work in both directions, two conversion components must be created, with opposite flows.
- Parameters:
tessif_es¶ (AbstractEnergySystem) – Container of itarable
tessif.model.components.Connectorobjects that are to be transformed into FINE’s conversion (twice) objects.- Returns:
fine_connector_dict – Dictionary object containing the transformed
Connector objects- Return type:
- tessif.transform.es2es.fine.create_FINE_constraints(tessif_es)[source]
Create FINE Emission Constraints as sink out of Tessif’s global constraints.
- Parameters:
tessif_es¶ (AbstractEnergySystem) – Container the global constraint limiting the optimization process.
- Returns:
fine_constraints_dict – Dictionary object containing the transformed
Constraints objects- Return type:
- tessif.transform.es2es.fine.conversion_as_emitting_sources(tessif_es)[source]
Create FINE conversion out of Tessif’s emitting sources.
Note
Since FINE’s sources can’t have related specific emissions, a corresponding conversion component needs to be created. This transformer is fed by an unlimitted source without any limitations. All flow parameters are related to this transformer, which contains the flow emissions as well as the flow itself with given parameters.
- Parameters:
tessif_es¶ (AbstractEnergySystem) – Container of itarable
tessif.model.components.Sourceobjects that have related flow_emissions.- Returns:
fine_emitting_source_dict – Dictionary object containing the transformed
Conversion objects- Return type:
- tessif.transform.es2es.fine.conversion_as_emitting_storage(tessif_es)[source]
Create FINE conversions out of Tessif’s emitting storages and the storage itself.
Note
This fragment is crucial if the actual used storages do have any emissions - if conversion components added to the es which charge/discharge the storage. - Storage commodity is renamed due to precise formulation for the optimization process -> name it back later - conversion input/output need to be deleted for post processing capabillities
FINE’s Storage is not able to handle flow related emissions. All results are calculated without those emissions. Further, the initial and final SOC is yet not to be adjusted by the user. This causes different results between the models for some py_hard examples.
- Parameters:
tessif_es¶ (AbstractEnergySystem) – Container of itarable
tessif.model.components.Storageobjects that have related flow_emissions.- Returns:
fine_emission_storages_dict (collections.abc.Iterable) – Dictionary object containing the transformed
Storage objectsstorage_conversions_dict (collections.abc.Iterable) – Dictionary object containing the storage related
Conversion objectsWarning
——- – If an initial state of charge is given, a warning is issued and further optimization is done without any SOC.
The self-discharge in FINE is normalized, which is why a warning is given as soon as no initial capacity is specified, but a self-discharge rate.
- tessif.transform.es2es.fine.transform(tessif_es, **kwargs)[source]
Transform a tessif energy system into a fine energy system.
- Parameters:
tessif_es¶ (
tessif.model.energy_system.AbstractEnergySystem) – The tessif energy system that is to be transformed into an fine energy system.- Returns:
esM – The fine energy system that was transformed out of the tessif energy system.
- Return type:
FINE.energySystemModel.EnergySystemModel
Examples
Use the example hub’s
create_storage_example()utility for showcasing basic usage:Create the a storage example:
>>> from tessif.examples.data.tsf.py_hard import create_storage_example >>> tessif_es = create_storage_example()
Transform the
tessif energy system:>>> fine_es = transform(tessif_es)
Simulate the fine energy system:
>>> import tessif.simulate as simulate >>> optimized_fine_es = simulate.fine_from_es(fine_es)
Extract some results:
>>> import tessif.transform.es2mapping.fine as transform_fine_results >>> load_results = transform_fine_results.LoadResultier(optimized_fine_es) >>> print(load_results.node_load['Powerline']) Powerline Generator Storage Demand Storage 1990-07-13 00:00:00 -19.0 -0.0 10.0 9.0 1990-07-13 01:00:00 -19.0 -0.0 10.0 9.0 1990-07-13 02:00:00 -19.0 -0.0 7.0 12.0 1990-07-13 03:00:00 -0.0 -10.0 10.0 0.0 1990-07-13 04:00:00 -0.0 -10.0 10.0 0.0