Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Energy excess parameters may be calculated incorrectly #559

Closed
smartie2076 opened this issue Sep 9, 2020 · 8 comments · Fixed by #777
Closed

Energy excess parameters may be calculated incorrectly #559

smartie2076 opened this issue Sep 9, 2020 · 8 comments · Fixed by #777
Assignees

Comments

@smartie2076
Copy link
Collaborator

New energy busses now always are connected to the ENERGY_VECTOR of the first asset that is connected to it (comp. here). In case of energyConversion assets, this is actually not quite accurate: If an electricity bus is first defined by a heat pump connected to it, which has energyVector "Heat", the bus is defined incorrectly.

The energy vector of a bus is used to define the excess sink connected to it. As such, currently, the energy excess sinks may right now be of an incorrect energy vector and be counted into the KPI connected to excess energy incorrectly (also considering weighting). As such, one should right now look at the scalar_matrix and not the scalars to determine the excess of sector-coupled systems.

Originally posted by @smartie2076 in #555 (comment)

@smartie2076
Copy link
Collaborator Author

Following warning (5c090e6) is printed out to remind of this issue:

15:02:12-WARNING-The calculation of the Total_excess per sector and their energy equivalent may currently be faulty. Please refer to issue #559

@smartie2076
Copy link
Collaborator Author

To-dos:

@smartie2076
Copy link
Collaborator Author

@mahendrark found how this issue influences the benchmark tests, specifically with mvs_tool -i tests/benchmark_test_inputs/AFG_grid_heatpump_heat -ext csv -f -pdf:

`"energyConsumption": {
"Electricity_bus_excess": {
"costs_investment_over_lifetime": {
"unit": "EUR",
"value": 0.0
},
...
"energyVector": "Heat",`

...so the energyVector or the electricity excess is "heat", which is obviously incorrect. This might be solved via #649.

The energyBusses are processed as following:

"energyBusses": {
"Electricity_bus": {
"Asset_list": {
"Electricity_bus_excess": "Electricity_bus_excess_sink",
"Grid_DSO": "Grid_DSO",
"Grid_DSO_feedin_sink": "Grid_DSO_feedin_sink_sink",
"demand_elec": "demand_elec",
"heat_pump": "heat_pump"
},
"_excess": "Electricity_bus_excess",
"energyVector": "Heat",
"label": "Electricity_bus"
},
"Electricity_pdp_bus": {
"Asset_list": {
"Grid_DSO_consumption": "Grid_DSO_consumption_source"
},
"energyVector": "Electricity",
"label": "Electricity_pdp_bus"
},
"Heat_bus": {
"Asset_list": {
"Heat_DSO": "Heat_DSO",
"Heat_DSO_feedin_sink": "Heat_DSO_feedin_sink_sink",
"Heat_bus_excess": "Heat_bus_excess_sink",
"demand_heat": "demand_heat",
"heat_pump": "heat_pump"
},
"_excess": "Heat_bus_excess",
"energyVector": "Heat",
"label": "Heat_bus"
},
"Heat_pdp_bus": {
"Asset_list": {
"Heat_DSO_consumption": "Heat_DSO_consumption_source"
},
"energyVector": "Heat",
"label": "Heat_pdp_bus"
}
}

@smartie2076
Copy link
Collaborator Author

@mahendrark thought that this might influence the report generated with PR #647, but I think the code itself will still work fine. The result of course is wrong (but that is because of this issue here and will be fixed as soon as this the issue is fixed).

@smartie2076
Copy link
Collaborator Author

With #649 issue might be eased as the energyVector of a energyBus asset is manually defined by the user. When working on this issue, also check again from where the weighting factor of an asset is derived from - LABEL or ENERGY_VECTOR.

@smartie2076 smartie2076 mentioned this issue Jan 11, 2021
11 tasks
@SabineHaas SabineHaas self-assigned this Jan 14, 2021
@SabineHaas SabineHaas mentioned this issue Jan 26, 2021
4 tasks
@SabineHaas
Copy link
Collaborator

SabineHaas commented Jan 27, 2021

how this issue influences the benchmark tests, specifically with mvs_tool -i tests/benchmark_test_inputs/AFG_grid_heatpump_heat -ext csv -f -pdf:

I ran tests/benchmark_test_inputs/AFG_grid_heatpump_heat with overwrite=True, input_type="csv", save_png=True, pdf_report=True which should be equal.

The busses are processed well:

"energyBusses": {
        "Electricity": {
            "Asset_list": {
                "Electricity_excess": "Electricity_excess_sink",
                "Grid_DSO": "Grid_DSO",
                "Grid_DSO_feedin_sink": "Grid_DSO_feedin_sink_sink",
                "demand_elec": "demand_elec",
                "heat_pump": "heat_pump"
            },
            "_excess": "Electricity_excess",
            "energyVector": "Electricity",
            "label": "Electricity"
        },
        "Electricity_pdp": {
            "Asset_list": {
                "Grid_DSO_consumption": "Grid_DSO_consumption_source"
            },
            **"energyVector": "Electricity",**
            "label": "Electricity_pdp"
        },
        "Heat": {
            "Asset_list": {
                "Heat_DSO": "Heat_DSO",
                "Heat_DSO_feedin_sink": "Heat_DSO_feedin_sink_sink",
                "Heat_excess": "Heat_excess_sink",
                "demand_heat": "demand_heat",
                "heat_pump": "heat_pump"
            },
            "_excess": "Heat_excess",
            "energyVector": "Heat",
            "label": "Heat"
        },
        "Heat_pdp": {
            "Asset_list": {
                "Heat_DSO_consumption": "Heat_DSO_consumption_source"
            },
            "energyVector": "Heat",
            "label": "Heat_pdp"
        }

@smartie2076
Copy link
Collaborator Author

Thats because you manually defined the energyVector of each bus now - so I guess the issue solved itself! :D

You only have to delete the error message in E3.calculate_electricity_equivalent_for_a_set_of_aggregated_values now:

    if kpi_name == TOTAL_EXCESS:
        logging.warning(
            f"The calculation of the {TOTAL_EXCESS} per sector and their energy equivalent may currently be faulty. Please refer to issue #559"
        )

@SabineHaas
Copy link
Collaborator

SabineHaas commented Jan 27, 2021

And check that DEFAULT_WEIGHTS_ENERGY_CARRIERS is derived with ENERGY_VECTOR in D2 and E3.

D2 ✅
E3 checked by @smartie2076

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants