Skip to content

Commit

Permalink
fix some names
Browse files Browse the repository at this point in the history
  • Loading branch information
arght committed Dec 13, 2023
1 parent 0a04b5e commit e860d85
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions doc/rst/MathematicalFormulation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ They are written in **uppercase** letters.
**Electricity demand**
------------------------ ---------------------------------------------------- -------
:math:`D^p_{\omega ni}` Electricity demand in each node GW
:math:`PD_a` Peak demand in each area GW
:math:`PD_{pa}` Peak demand in each area GW
:math:`DUR_n` Duration of each load level h
:math:`CENS` Cost of energy not served. Value of Lost Load (VoLL) €/MWh
======================== ==================================================== =======
Expand Down Expand Up @@ -300,7 +300,7 @@ Output and consumption bounded by investment decision for candidate ESS [p.u.]

Adequacy system reserve margin [p.u.] «``eAdequacyReserveMargin``»

:math:`\sum_{g \in a, EG} \overline{GP}_g A_g + \sum_{g \in a, CG} icg^p_g \overline{GP}_g A_g \geq PD_a RM_{pa} \quad \forall pa`
:math:`\sum_{g \in a, EG} \overline{GP}_g A_g + \sum_{g \in a, CG} icg^p_g \overline{GP}_g A_g \geq PD_{pa} RM_{pa} \quad \forall pa`

Maximum CO2 emission [MtC02] «``eMaxSystemEmission``»

Expand Down
10 changes: 5 additions & 5 deletions doc/rst/OutputResults.rst
Original file line number Diff line number Diff line change
Expand Up @@ -333,15 +333,15 @@ Identifier Identifier Identifier Header Description
Period Scenario Load level Technology CO2 emission per area [MtCO2]
============ ========== ========== ========== =================================

File ``oT_Result_TechnologyReserveUp.csv``
File ``oT_Result_TechnologyOperatingReserveUp.csv``

============ ========== ========== ========== ==========================================
Identifier Identifier Identifier Header Description
============ ========== ========== ========== ==========================================
Period Scenario Load level Technology Upward operating reserve [MW]
============ ========== ========== ========== ==========================================

File ``oT_Result_TechnologyReserveDown.csv``
File ``oT_Result_TechnologyOperatingReserveDown.csv``

============ ========== ========== ========== ==========================================
Identifier Identifier Identifier Header Description
Expand Down Expand Up @@ -456,15 +456,15 @@ Identifier Identifier Identifier Header Description
Period Scenario Load level Technology Energy (Outflows in ESS) [GWh]
============ ========== ========== ========== ==========================================

File ``oT_Result_TechnologyReserveUpESS.csv``
File ``oT_Result_TechnologyOperatingReserveUpESS.csv``

============ ========== ========== ========== ==========================================
Identifier Identifier Identifier Header Description
============ ========== ========== ========== ==========================================
Period Scenario Load level Technology Upward operating reserve [MW]
============ ========== ========== ========== ==========================================

File ``oT_Result_TechnologyReserveDownESS.csv``
File ``oT_Result_TechnologyOperatingReserveDownESS.csv``

============ ========== ========== ========== ==========================================
Identifier Identifier Identifier Header Description
Expand Down Expand Up @@ -539,7 +539,7 @@ Identifier Identifier Identifier Header Description
Period Scenario Load level Reservoir Spilled water in reservoir [hm\ :sup:`3`]
============ ========== ========== ========== ==========================================

File ``oT_Result_TechnologyReservoirSpillage.csv``
File ``oT_Result_TechnologyOperatingReservoirSpillage.csv``

============ ========== ========== ========== =========================================================
Identifier Identifier Identifier Header Description
Expand Down
12 changes: 6 additions & 6 deletions openTEPES/openTEPES_OutputResults.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - December 09, 2023
Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - December 13, 2023
"""

import time
Expand Down Expand Up @@ -316,7 +316,7 @@ def GenerationOperationResults(DirName, CaseName, OptModel, mTEPES, pIndTechnolo
if pIndTechnologyOutput == 1 or pIndTechnologyOutput == 2:
sPSNGT = [(p,sc,n,gt) for p,sc,n,gt in mTEPES.psngt if sum(1 for nr in g2n[gt])]
OutputToFile = pd.Series(data=[sum(OutputToFile[p,sc,n,nr] for nr in g2n[gt]) for p,sc,n,gt in sPSNGT], index=pd.Index(sPSNGT))
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_TechnologyReserveUp_'+CaseName+'.csv', sep=',')
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_TechnologyOperatingReserveUp_'+CaseName+'.csv', sep=',')

if len(mTEPES.eh):
OutputToFile = pd.Series(data=[OptModel.vESSReserveUp [p,sc,n,eh]() for p,sc,n,eh in mTEPES.psneh], index=pd.Index(mTEPES.psneh))
Expand All @@ -328,7 +328,7 @@ def GenerationOperationResults(DirName, CaseName, OptModel, mTEPES, pIndTechnolo
if pIndTechnologyOutput == 1 or pIndTechnologyOutput == 2:
sPSNOT = [(p,sc,n,ot) for p,sc,n,ot in mTEPES.psnot if sum(1 for es in o2e[ot])]
OutputToFile = pd.Series(data=[sum(OutputToFile[p,sc,n,es] for es in o2e[ot]) for p,sc,n,ot in sPSNOT], index=pd.Index(sPSNOT))
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_TechnologyReserveUpESS_'+CaseName+'.csv', sep=',')
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_TechnologyOperatingReserveUpESS_'+CaseName+'.csv', sep=',')

if sum(mTEPES.pOperReserveDw[:,:,:,:]):
if len(mTEPES.nr):
Expand All @@ -341,7 +341,7 @@ def GenerationOperationResults(DirName, CaseName, OptModel, mTEPES, pIndTechnolo
if pIndTechnologyOutput == 1 or pIndTechnologyOutput == 2:
sPSNGT = [(p,sc,n,gt) for p,sc,n,gt in mTEPES.psngt if sum(1 for nr in g2n[gt])]
OutputToFile = pd.Series(data=[sum(OutputToFile[p,sc,n,nr] for nr in g2n[gt]) for p,sc,n,gt in sPSNGT], index=pd.Index(sPSNGT))
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_TechnologyReserveDown_'+CaseName+'.csv', sep=',')
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_TechnologyOperatingReserveDown_'+CaseName+'.csv', sep=',')

if len(mTEPES.eh):
OutputToFile = pd.Series(data=[OptModel.vESSReserveDown[p,sc,n,eh]() for p,sc,n,eh in mTEPES.psneh], index=pd.Index(mTEPES.psneh))
Expand All @@ -353,7 +353,7 @@ def GenerationOperationResults(DirName, CaseName, OptModel, mTEPES, pIndTechnolo
if pIndTechnologyOutput == 1 or pIndTechnologyOutput == 2:
sPSNOT = [(p,sc,n,ot) for p,sc,n,ot in mTEPES.psnot if sum(1 for es in o2e[ot])]
OutputToFile = pd.Series(data=[sum(OutputToFile[p,sc,n,es] for es in o2e[ot]) for p,sc,n,ot in sPSNOT], index=pd.Index(sPSNOT))
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_TechnologyReserveDownESS_'+CaseName+'.csv', sep=',')
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_TechnologyOperatingReserveDownESS_'+CaseName+'.csv', sep=',')

OutputToFile = pd.Series(data=[OptModel.vTotalOutput[p,sc,n,g]() for p,sc,n,g in mTEPES.psng ], index=pd.Index(mTEPES.psng))
OutputToFile *= 1e3
Expand Down Expand Up @@ -1326,7 +1326,7 @@ def ReliabilityResults(DirName, CaseName, OptModel, mTEPES):
OutputToFile2[p,sc] = pDemand.loc[(p,sc)].reset_index().pivot_table(index=['level_0'], values=0, aggfunc='sum').max()
ReserveMargin1 = OutputToFile1 - OutputToFile2
ReserveMargin2 = (OutputToFile1 - OutputToFile2)/OutputToFile2
ReserveMargin1.to_frame(name='MW' ).rename_axis(['Period', 'Scenario'], axis=0).to_csv(_path+'/oT_Result_ReserveMargin_' +CaseName+'.csv', sep=',')
ReserveMargin1.to_frame(name='MW' ).rename_axis(['Period', 'Scenario'], axis=0).to_csv(_path+'/oT_Result_ReserveMarginPower_' +CaseName+'.csv', sep=',')
ReserveMargin2.to_frame(name='p.u.').rename_axis(['Period', 'Scenario'], axis=0).to_csv(_path+'/oT_Result_ReserveMarginPerUnit_'+CaseName+'.csv', sep=',')

# Determination of the index: Largest Unit
Expand Down

0 comments on commit e860d85

Please sign in to comment.