From b910daacd8f24724e29c0ae960b9786926bd40da Mon Sep 17 00:00:00 2001 From: Andres Ramos <61053256+arght@users.noreply.github.com> Date: Sun, 20 Oct 2024 21:30:45 +0200 Subject: [PATCH] changes in OutputResults --- CHANGELOG.rst | 4 +++- openTEPES/openTEPES_OutputResults.py | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 506c4088..8be73ec5 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,8 +1,10 @@ Change Log ============= -[4.17.8] - 2024-10-17 +[4.17.8] - 2024-10-20 ----------------------- +- [FIXED] writing of the GenerationSurplusHeat file +- [FIXED] computation of pMaxPowerHeat - [FIXED] computation of net demand per node in output results - [CHANGED] if no ending year is given in the input data, the last year is considered year 3000 - [CHANGED] control of invalid electric lines, hydrogen lines, and heat pipelines diff --git a/openTEPES/openTEPES_OutputResults.py b/openTEPES/openTEPES_OutputResults.py index 801eea57..eac5f7ab 100644 --- a/openTEPES/openTEPES_OutputResults.py +++ b/openTEPES/openTEPES_OutputResults.py @@ -616,9 +616,9 @@ def GenerationOperationHeatResults(DirName, CaseName, OptModel, mTEPES, pIndTech # tolerance to consider 0 a number pEpsilon = 1e-6 - sPSNG = [(p,sc,n,chp) for p,sc,n,chp in mTEPES.psnchp if OptModel.vTotalOutputHeat[p,sc,n,chp].ub is not None and OptModel.vTotalOutputHeat[p,sc,n,chp].ub - OptModel.vTotalOutputHeat[p,sc,n,chp]() > pEpsilon] - OutputToFile = pd.Series(data=[(OptModel.vTotalOutputHeat[p,sc,n,chp].ub*OptModel.vGenerationInvest[p,chp]() - OptModel.vTotalOutputHeat[p,sc,n,chp]()) if chp in mTEPES.gc or chp in mTEPES.bc else - (OptModel.vTotalOutputHeat[p,sc,n,chp].ub - OptModel.vTotalOutputHeat[p,sc,n,chp]()) for p,sc,n,chp in sPSNG], index=pd.Index(sPSNG)) + sPSNG = [(p,sc,n,ch) for p,sc,n,ch in mTEPES.psnch if OptModel.vTotalOutputHeat[p,sc,n,ch].ub - OptModel.vTotalOutputHeat[p,sc,n,ch]() > pEpsilon] + OutputToFile = pd.Series(data=[(OptModel.vTotalOutputHeat[p,sc,n,ch].ub*OptModel.vGenerationInvest[p,ch]() - OptModel.vTotalOutputHeat[p,sc,n,ch]()) if ch in mTEPES.gc or ch in mTEPES.bc else + (OptModel.vTotalOutputHeat[p,sc,n,ch].ub - OptModel.vTotalOutputHeat[p,sc,n,ch]()) for p,sc,n,ch in sPSNG], index=pd.Index(sPSNG)) OutputToFile *= 1e3 OutputToFile.to_frame(name='MW').reset_index().pivot_table(index=['level_0','level_1','level_2'], columns='level_3', values='MW').rename_axis(['Period', 'Scenario', 'LoadLevel'], axis=0).rename_axis([None], axis=1).to_csv(_path+'/oT_Result_GenerationSurplusHeat_'+CaseName+'.csv', sep=',')