From e860d85823c393c0dc964d0ad9c958f3aceac08c Mon Sep 17 00:00:00 2001 From: Andres Ramos <61053256+arght@users.noreply.github.com> Date: Wed, 13 Dec 2023 06:25:14 +0100 Subject: [PATCH] fix some names --- doc/rst/MathematicalFormulation.rst | 4 ++-- doc/rst/OutputResults.rst | 10 +++++----- openTEPES/openTEPES_OutputResults.py | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/rst/MathematicalFormulation.rst b/doc/rst/MathematicalFormulation.rst index 7912a213..f55eb5ad 100644 --- a/doc/rst/MathematicalFormulation.rst +++ b/doc/rst/MathematicalFormulation.rst @@ -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 ======================== ==================================================== ======= @@ -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``» diff --git a/doc/rst/OutputResults.rst b/doc/rst/OutputResults.rst index 79c1cda8..52786bb0 100644 --- a/doc/rst/OutputResults.rst +++ b/doc/rst/OutputResults.rst @@ -333,7 +333,7 @@ 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 @@ -341,7 +341,7 @@ 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 @@ -456,7 +456,7 @@ 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 @@ -464,7 +464,7 @@ 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 @@ -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 diff --git a/openTEPES/openTEPES_OutputResults.py b/openTEPES/openTEPES_OutputResults.py index 989b9ba1..9b6a5d7d 100644 --- a/openTEPES/openTEPES_OutputResults.py +++ b/openTEPES/openTEPES_OutputResults.py @@ -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 @@ -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)) @@ -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): @@ -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)) @@ -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 @@ -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