Skip to content

Commit

Permalink
changes in OutputResults
Browse files Browse the repository at this point in the history
  • Loading branch information
arght committed Oct 20, 2024
1 parent 7047f00 commit b910daa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions openTEPES/openTEPES_OutputResults.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=',')

Expand Down

0 comments on commit b910daa

Please sign in to comment.