rl-institut / multi-vector-simulator

Multi-vector Simulation Tool assessing and optimizing Local Energy Systems (LES) for the E-LAND project
GNU General Public License v2.0
21 stars 10 forks source link

[Bug] Simulation terminates when: Feed-in tariff of Electricity > LCOE asset #787

Open TheOneAndra opened 3 years ago

TheOneAndra commented 3 years ago

The simulation terminates with the ValueError:

ValueError: Feed-in tariff of Electricity (0.064) > levelized costs of generation for energy asset 'Biogas' (based on is dispatch price) with 0.0576. This may cause an unbound solution and terminate the optimization, if there are no additional costs in the supply line. If this happens, please check the costs of your assets or the feed-in tariff. If both are correct, consider setting a maximum capacity constraint (maximumCap) for the relevant assets.

The biogas asset here is considere as renewableAsset: True with no input file (= dispatchable) Input files: inputs.zip

Checklist to make sure that the bug report ist complete:

TheOneAndra commented 3 years ago

Full log:

(MVS) C:\Andra\MVS_GitHub>python mvs_tool.py -i C:\Andra\RLI\Master_Thesis\Data\MVS\Input_templates\Greenfield_test_sensitivity -ext csv -o C:\Andra\RLI\Master_Thesis\Data\MVS\Simulations\Greenfield\210202_GF_no_constraints_sensitivity\LCOE_error -f -pdf
11:38:53-INFO-Path for logging: C:\Andra\RLI\Master_Thesis\Data\MVS\Simulations\Greenfield\210202_GF_no_constraints_sensitivity\LCOE_error\mvs_logfile.log
11:38:53-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

11:38:53-INFO-loading and converting all csv's from C:\Andra\RLI\Master_Thesis\Data\MVS\Input_templates\Greenfield_test_sensitivity\csv_elements into one json
11:38:53-INFO-Json file created successfully from csv's and stored into C:\Andra\RLI\Master_Thesis\Data\MVS\Input_templates\Greenfield_test_sensitivity\csv_elements\mvs_csv_config.json

11:38:53-INFO-The energy system modelled includes following energy vectors: Electricity, Heat
11:38:53-INFO-Pre-processing all assets in asset group energyProviders.
11:38:53-INFO-Peak demand pricing is taking place 1 times per year, ie. every 12.0 months.
11:38:53-INFO-Asset Transmission_system_operator_consumption_source was added to the energyProduction assets.
11:38:53-INFO-Pre-processing all assets in asset group energyConversion.
11:38:53-INFO-Pre-processing all assets in asset group energyStorage.
11:38:53-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.
11:38:53-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.
11:38:53-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.
11:38:53-INFO-Pre-processing all assets in asset group energyProduction.
11:38:53-INFO-Pre-processing all assets in asset group energyConsumption.
11:38:53-INFO-Processed cost data and added economic values.
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 78, in all
    C1.check_feedin_tariff_vs_levelized_cost_of_generation_of_production(dict_values)
  File "c:\andra\mvs_github\src\multi_vector_simulator\C1_verification.py", line 224, in check_feedin_tariff_vs_levelized_cost_of_generation_of_production
    raise ValueError(msg)
ValueError: Feed-in tariff of Electricity (0.064) > levelized costs of generation for energy asset 'Biogas' (based on is dispatch price) with 0.0576. This may cause an unbound solution and terminate the optimization, if there are no additional costs in the supply line. If this happens, please check the costs of your assets or the feed-in tariff. If both are correct, consider setting a maximum capacity constraint (maximumCap) for the relevant assets.
TheOneAndra commented 3 years ago

It happens with non-dispatchable assets as well:

(MVS) C:\Andra\MVS_GitHub>python mvs_tool.py -i C:\Andra\RLI\Master_Thesis\Data\MVS\Input_templates\Greenfield_test_sensitivity -ext csv -o C:\Andra\RLI\Master_Thesis\Data\MVS\Simulations\Greenfield\210202_GF_no_constraints_sensitivity\test_WT_prices -f -pdf
16:39:05-INFO-Path for logging: C:\Andra\RLI\Master_Thesis\Data\MVS\Simulations\Greenfield\210202_GF_no_constraints_sensitivity\test_WT_prices\mvs_logfile.log
16:39:05-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

16:39:05-INFO-loading and converting all csv's from C:\Andra\RLI\Master_Thesis\Data\MVS\Input_templates\Greenfield_test_sensitivity\csv_elements into one json
16:39:05-INFO-Json file created successfully from csv's and stored into C:\Andra\RLI\Master_Thesis\Data\MVS\Input_templates\Greenfield_test_sensitivity\csv_elements\mvs_csv_config.json

16:39:05-INFO-The energy system modelled includes following energy vectors: Electricity, Heat
16:39:05-INFO-Pre-processing all assets in asset group energyProviders.
16:39:05-INFO-Peak demand pricing is taking place 1 times per year, ie. every 12.0 months.
16:39:06-INFO-Asset Transmission_system_operator_consumption_source was added to the energyProduction assets.
16:39:06-INFO-Pre-processing all assets in asset group energyConversion.
16:39:06-INFO-Pre-processing all assets in asset group energyStorage.
16:39:06-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.
16:39:06-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.
16:39:06-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.
16:39:06-INFO-Pre-processing all assets in asset group energyProduction.
16:39:06-INFO-Pre-processing all assets in asset group energyConsumption.
16:39:06-INFO-Processed cost data and added economic values.
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 78, in all
    C1.check_feedin_tariff_vs_levelized_cost_of_generation_of_production(dict_values)
  File "c:\andra\mvs_github\src\multi_vector_simulator\C1_verification.py", line 224, in check_feedin_tariff_vs_levelized_cost_of_generation_of_production
    raise ValueError(msg)
ValueError: Feed-in tariff of Electricity (0.056) > levelized costs of generation for energy asset 'Wind_turbine' with 0.0334. This may cause an unbound solution and terminate the optimization, if there are no additional costs in the supply line. If this happens, please check the costs of your assets or the feed-in tariff. If both are correct, consider setting a maximum capacity constraint (maximumCap) for the relevant assets.
Bachibouzouk commented 3 years ago

If you want to avoid this locally, go to C1_verification.py", line 224 and replace raise ValueError(msg) by logging.error(msg)

TheOneAndra commented 3 years ago

If you want to avoid this locally, go to C1_verification.py", line 224 and replace raise ValueError(msg) by logging.error(msg)

Thank you! This worked and oemof didn't optimize my asset infinitely. Could that be because in the first check MVS doesn't take into account the losses from the conversion assets @smartie2076 ?

smartie2076 commented 3 years ago

You can look into the function for this - here is the equation that is applied:

 # If energy production asset is a non-dispatchable source (PV plant)
if (
    dict_values[ENERGY_PRODUCTION][production_asset][DISPATCHABILITY]
    is False
):
    # Calculate cost per kWh generated
    levelized_cost_of_generation = (
        dict_values[ENERGY_PRODUCTION][production_asset][
            SIMULATION_ANNUITY
        ][VALUE]
        / dict_values[ENERGY_PRODUCTION][production_asset][
            TIMESERIES_TOTAL
        ][VALUE]
    )
# If energy production asset is a dispatchable source (fuel source)
else:
    log_message_object += " (based on is dispatch price)"
    # Estimate costs based on dispatch price (this is the lower minimum, as actually o&m and investment costs would need to be added as well, but can not be added as the dispatch is not known yet.
    levelized_cost_of_generation = dict_values[ENERGY_PRODUCTION][
        production_asset
    ][DISPATCH_PRICE][VALUE]

Conversion losses are always a problem for our checks. For non-dispatchable assets the conversion losses the dispach costs are not accounted for which needs to be fixed. For dispatchable assets we completely ignore the O&M and investment costs (as we do not know what the dispatch will be).

smartie2076 commented 3 years ago

If you want to avoid this locally, go to C1_verification.py", line 224 and replace raise ValueError(msg) by logging.error(msg)

I would also like this to be done in a PR, as I also prefer logging.error() or logging.warning()messages. Maybe this should be the latter.

@Bachibouzouk is there any argument for the ValueError?

smartie2076 commented 3 years ago

@Bachibouzouk I think there is no argument for it. @ciaradunks this might be an easy entry into the MVS. If you run into issues, @TheOneAndra already uses a local fix, maybe he can help you?

Bachibouzouk commented 3 years ago

I also think there is no argument for ValueError, sorry it went over my radar

smartie2076 commented 3 years ago

This issue is still relevant.