multi-vector-simulator icon indicating copy to clipboard operation
multi-vector-simulator copied to clipboard

[Bug] It is not possible to introduce a `maximumCap` to dispatchable sources

Open TheOneAndra opened this issue 4 years ago • 1 comments

Simulation terminates with asset_dict[MAXIMUM_CAP][VALUE] * asset_dict[TIMESERIES_PEAK][VALUE] KeyError: 'timeseries_peak'

This happens when I put a maximumCap on the biogas energyProduction asset. I suspect it is because the biogas asset is a renewableAsset with no input files (no time serie). Therefore my [TIMESERIES_PEAK][VALUE] is most likely 0.

grafik

Full log message


(MVS) C:\Andra\MVS_GitHub>python mvs_tool.py -i C:\Andra\RLI\Master_Thesis\Data\MVS\Input_templates\Greenfield_no_thermal -ext csv -o C:\Andra\RLI\Master_Thesis\Data\MVS\Simulations\Greenfield\210205_GF_Elec_only\max_cap_assets -f -pdf
12:26:56-INFO-Path for logging: C:\Andra\RLI\Master_Thesis\Data\MVS\Simulations\Greenfield\210205_GF_Elec_only\max_cap_assets\mvs_logfile.log
12:26:56-INFO-

 Multi-Vector Simulation Tool (MVS) V0.5.5dev
 Version: 2020-12-18
 Part of the toolbox of H2020 project "E-LAND", Integrated multi-vector management system for Energy isLANDs
 Coded at: Reiner Lemoine Institute (Berlin)
 Contributors: Martha M. Hoffmann


12:26:56-INFO-loading and converting all csv's from C:\Andra\RLI\Master_Thesis\Data\MVS\Input_templates\Greenfield_no_thermal\csv_elements into one json
12:26:56-INFO-Json file created successfully from csv's and stored into C:\Andra\RLI\Master_Thesis\Data\MVS\Input_templates\Greenfield_no_thermal\csv_elements\mvs_csv_config.json


12:26:56-INFO-The energy system modelled includes following energy vectors: Electricity
12:26:56-INFO-Pre-processing all assets in asset group energyProviders.
12:26:56-INFO-Peak demand pricing is taking place 1 times per year, ie. every 12.0 months.
12:26:56-INFO-Asset Transmission_system_operator_consumption_source was added to the energyProduction assets.
12:26:56-INFO-Pre-processing all assets in asset group energyConversion.
12:26:56-INFO-Pre-processing all assets in asset group energyStorage.
12:26:56-ERROR-The age of the asset `Battery storage capacity` (15 years) is lower or equal than the asset lifetime (15 years). This does not make sense, as a replacement is imminent or should already have happened. Please check this value.
12:26:56-ERROR-The age of the asset `Battery input power` (15 years) is lower or equal than the asset lifetime (15 years). This does not make sense, as a replacement is imminent or should already have happened. Please check this value.
12:26:56-ERROR-The age of the asset `Battery output power` (15 years) is lower or equal than the asset lifetime (15 years). This does not make sense, as a replacement is imminent or should already have happened. Please check this value.
12:26:56-INFO-Pre-processing all assets in asset group energyProduction.
Traceback (most recent call last):
  File "mvs_tool.py", line 4, in <module>
    main()
  File "c:\andra\mvs_github\src\multi_vector_simulator\cli.py", line 154, in main
    data_processing.all(dict_values)
  File "c:\andra\mvs_github\src\multi_vector_simulator\C0_data_processing.py", line 73, in all
    process_all_assets(dict_values)
  File "c:\andra\mvs_github\src\multi_vector_simulator\C0_data_processing.py", line 214, in process_all_assets
    asset_function(dict_values, asset_group)
  File "c:\andra\mvs_github\src\multi_vector_simulator\C0_data_processing.py", line 331, in energyProduction
    process_maximum_cap_constraint(dict_values, group, asset)
  File "c:\andra\mvs_github\src\multi_vector_simulator\C0_data_processing.py", line 1743, in process_maximum_cap_constraint
    asset_dict[MAXIMUM_CAP][VALUE] * asset_dict[TIMESERIES_PEAK][VALUE]
KeyError: 'timeseries_peak'

Checklist to make sure that the bug report ist complete:

  • [x] OS: windows, 10
  • [x] Branch: dev, updated on 2021-01-27
  • [x] If applicable: Attach full error message
  • [ ] If applicable: Share screenshots/images of your problem
  • [ ] If applicable: Share used input data

TheOneAndra avatar Feb 05 '21 11:02 TheOneAndra

Your analysis seem correct, one way to fix this would be to write asset_dict[MAXIMUM_CAP][VALUE] * asset_dict.get(TIMESERIES_PEAK, {VALUE: 1})[VALUE]. The method get return the second argument if there would be KeyError. Here we need to return a dict with the key VALUE as the output of asset_dict.get(TIMESERIES_PEAK) will be expected to be a dict with the key VALUE

Bachibouzouk avatar Feb 05 '21 13:02 Bachibouzouk