openTEPES 4.18.7__py3-none-any.whl → 4.18.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openTEPES/__init__.py +1 -1
- openTEPES/openTEPES.py +3 -4
- openTEPES/openTEPES_InputData.py +209 -109
- openTEPES/openTEPES_Main.py +17 -7
- openTEPES/openTEPES_ModelFormulation.py +101 -60
- openTEPES/openTEPES_OutputResults.py +280 -140
- openTEPES/openTEPES_ProblemSolving.py +30 -29
- openTEPES/sSEP/oT_Data_RampReserveDown_sSEP.csv +8737 -0
- openTEPES/sSEP/oT_Data_RampReserveUp_sSEP.csv +8737 -0
- {opentepes-4.18.7.dist-info → opentepes-4.18.8.dist-info}/METADATA +6 -5
- {opentepes-4.18.7.dist-info → opentepes-4.18.8.dist-info}/RECORD +14 -12
- {opentepes-4.18.7.dist-info → opentepes-4.18.8.dist-info}/WHEEL +0 -0
- {opentepes-4.18.7.dist-info → opentepes-4.18.8.dist-info}/entry_points.txt +0 -0
- {opentepes-4.18.7.dist-info → opentepes-4.18.8.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) -
|
|
2
|
+
Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - January 07, 2026
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
import time
|
|
6
6
|
import os
|
|
7
|
-
import pandas as pd
|
|
8
7
|
import pyomo.environ as pyo
|
|
9
8
|
import psutil
|
|
10
9
|
import logging
|
|
11
10
|
from pyomo.opt import SolverFactory, SolverStatus, TerminationCondition
|
|
12
11
|
from pyomo.util.infeasible import log_infeasible_constraints
|
|
13
|
-
from pyomo.environ import Suffix
|
|
12
|
+
from pyomo.environ import Suffix, UnitInterval
|
|
14
13
|
|
|
15
14
|
def ProblemSolving(DirName, CaseName, SolverName, OptModel, mTEPES, pIndLogConsole, p, sc, st):
|
|
16
15
|
print('Problem solving ****')
|
|
@@ -106,12 +105,14 @@ def ProblemSolving(DirName, CaseName, SolverName, OptModel, mTEPES, pIndLogConso
|
|
|
106
105
|
if mTEPES.NoRepetition == 1:
|
|
107
106
|
for var in OptModel.component_data_objects(pyo.Var, active=True, descend_into=True):
|
|
108
107
|
if not var.is_continuous() and not var.is_fixed() and var.value != None:
|
|
109
|
-
var.fixed
|
|
108
|
+
var.fixed = True # fix the current value
|
|
109
|
+
var.domain = UnitInterval # change the domain to continuous
|
|
110
110
|
nUnfixedVars += 1
|
|
111
111
|
else:
|
|
112
112
|
for var in OptModel.component_data_objects(pyo.Var, active=True, descend_into=True):
|
|
113
113
|
if not var.is_continuous() and not var.is_fixed() and var.value != None and var.index()[0] == p and var.index()[1] == sc:
|
|
114
|
-
var.fixed
|
|
114
|
+
var.fixed = True # fix the current value
|
|
115
|
+
var.domain = UnitInterval # change the domain to continuous
|
|
115
116
|
nUnfixedVars += 1
|
|
116
117
|
|
|
117
118
|
# continuous investment decisions are fixed to their optimal values
|
|
@@ -171,50 +172,50 @@ def ProblemSolving(DirName, CaseName, SolverName, OptModel, mTEPES, pIndLogConso
|
|
|
171
172
|
if mTEPES.NoRepetition == 1:
|
|
172
173
|
for pp,scc in mTEPES.ps:
|
|
173
174
|
print (f'***** Period: {pp}, Scenario: {scc}, Stage: {st} ******')
|
|
174
|
-
print (' Total generation investment cost [MEUR] ',
|
|
175
|
-
|
|
176
|
-
print (' Total generation retirement cost [MEUR] ',
|
|
175
|
+
print (' Total generation investment cost [MEUR] ', mTEPES.pDiscountedWeight[pp] * sum(mTEPES.pGenInvestCost [eb ] * OptModel.vGenerationInvest [pp,eb ]() for eb in mTEPES.eb if (pp,eb) in mTEPES.peb) +
|
|
176
|
+
mTEPES.pDiscountedWeight[pp] * sum(mTEPES.pGenInvestCost [bc ] * OptModel.vGenerationInvestHeat[pp,bc ]() for bc in mTEPES.bc if (pp,bc) in mTEPES.pbc))
|
|
177
|
+
print (' Total generation retirement cost [MEUR] ', mTEPES.pDiscountedWeight[pp] * sum(mTEPES.pGenRetireCost [gd ] * OptModel.vGenerationRetire [pp,gd ]() for gd in mTEPES.gd if (pp,gd) in mTEPES.pgd))
|
|
177
178
|
if mTEPES.pIndHydroTopology == 1 and mTEPES.rn:
|
|
178
|
-
print(' Total reservoir investment cost [MEUR] ',
|
|
179
|
+
print(' Total reservoir investment cost [MEUR] ', mTEPES.pDiscountedWeight[pp] * sum(mTEPES.pRsrInvestCost [rc ] * OptModel.vReservoirInvest [pp,rc ]() for rc in mTEPES.rn if (pp,rc) in mTEPES.prc))
|
|
179
180
|
else:
|
|
180
181
|
print(' Total reservoir investment cost [MEUR] ', 0.0)
|
|
181
|
-
print (' Total network investment cost [MEUR] ',
|
|
182
|
+
print (' Total network investment cost [MEUR] ', mTEPES.pDiscountedWeight[pp] * sum(mTEPES.pNetFixedCost [ni,nf,cc] * OptModel.vNetworkInvest [pp,ni,nf,cc]() for ni,nf,cc in mTEPES.lc if (pp,ni,nf,cc) in mTEPES.plc))
|
|
182
183
|
if mTEPES.pIndHydrogen == 1 and mTEPES.pc:
|
|
183
|
-
print(' Total H2 pipe investment cost [MEUR] ',
|
|
184
|
+
print(' Total H2 pipe investment cost [MEUR] ', mTEPES.pDiscountedWeight[pp] * sum(mTEPES.pH2PipeFixedCost [ni,nf,cc] * OptModel.vH2PipeInvest [pp,ni,nf,cc]() for ni,nf,cc in mTEPES.pc if (pp,ni,nf,cc) in mTEPES.ppc))
|
|
184
185
|
else:
|
|
185
186
|
print(' Total H2 pipe investment cost [MEUR] ', 0.0)
|
|
186
187
|
if mTEPES.pIndHeat == 1 and mTEPES.hc:
|
|
187
|
-
print(' Total heat pipe investment cost [MEUR] ',
|
|
188
|
+
print(' Total heat pipe investment cost [MEUR] ', mTEPES.pDiscountedWeight[pp] * sum(mTEPES.pHeatPipeFixedCost[ni,nf,cc] * OptModel.vHeatPipeInvest [pp,ni,nf,cc]() for ni,nf,cc in mTEPES.hc if (pp,ni,nf,cc) in mTEPES.phc))
|
|
188
189
|
else:
|
|
189
190
|
print(' Total heat pipe investment cost [MEUR] ', 0.0)
|
|
190
|
-
print (' Total generation operation cost [MEUR] ',
|
|
191
|
-
print (' Total consumption operation cost [MEUR] ',
|
|
192
|
-
print (' Total emission cost [MEUR] ',
|
|
193
|
-
print (' Total network losses penalty cost [MEUR] ',
|
|
194
|
-
print (' Total reliability cost [MEUR] ',
|
|
191
|
+
print (' Total generation operation cost [MEUR] ', mTEPES.pDiscountedWeight[pp] * sum(mTEPES.pScenProb [pp,scc ]() * OptModel.vTotalGCost [pp,scc,n ]() for n in mTEPES.n ))
|
|
192
|
+
print (' Total consumption operation cost [MEUR] ', mTEPES.pDiscountedWeight[pp] * sum(mTEPES.pScenProb [pp,scc ]() * OptModel.vTotalCCost [pp,scc,n ]() for n in mTEPES.n ))
|
|
193
|
+
print (' Total emission cost [MEUR] ', mTEPES.pDiscountedWeight[pp] * sum(mTEPES.pScenProb [pp,scc ]() * OptModel.vTotalECost [pp,scc,n ]() for n in mTEPES.n ))
|
|
194
|
+
print (' Total network losses penalty cost [MEUR] ', mTEPES.pDiscountedWeight[pp] * sum(mTEPES.pScenProb [pp,scc ]() * OptModel.vTotalNCost [pp,scc,n ]() for n in mTEPES.n ))
|
|
195
|
+
print (' Total reliability cost [MEUR] ', mTEPES.pDiscountedWeight[pp] * sum(mTEPES.pScenProb [pp,scc ]() * OptModel.vTotalRCost [pp,scc,n ]() for n in mTEPES.n ))
|
|
195
196
|
else:
|
|
196
197
|
print (f'***** Period: {p}, Scenario: {sc}, Stage: {st} ******')
|
|
197
|
-
print (' Total generation investment cost [MEUR] ',
|
|
198
|
-
|
|
199
|
-
print (' Total generation retirement cost [MEUR] ',
|
|
198
|
+
print (' Total generation investment cost [MEUR] ', mTEPES.pDiscountedWeight[p] * sum(mTEPES.pGenInvestCost [eb ] * OptModel.vGenerationInvest [p,eb ]() for eb in mTEPES.eb if (p,eb) in mTEPES.peb) +
|
|
199
|
+
mTEPES.pDiscountedWeight[p] * sum(mTEPES.pGenInvestCost [bc ] * OptModel.vGenerationInvestHeat[p,bc ]() for bc in mTEPES.bc if (p,bc) in mTEPES.pbc))
|
|
200
|
+
print (' Total generation retirement cost [MEUR] ', mTEPES.pDiscountedWeight[p] * sum(mTEPES.pGenRetireCost [gd ] * OptModel.vGenerationRetire [p,gd ]() for gd in mTEPES.gd if (p,gd) in mTEPES.pgd))
|
|
200
201
|
if mTEPES.pIndHydroTopology == 1 and mTEPES.rn:
|
|
201
|
-
print (' Total reservoir investment cost [MEUR] ',
|
|
202
|
+
print (' Total reservoir investment cost [MEUR] ', mTEPES.pDiscountedWeight[p] * sum(mTEPES.pRsrInvestCost [rc ] * OptModel.vReservoirInvest [p,rc ]() for rc in mTEPES.rn if (p,rc) in mTEPES.prc))
|
|
202
203
|
else:
|
|
203
204
|
print (' Total reservoir investment cost [MEUR] ', 0.0)
|
|
204
|
-
print (' Total network investment cost [MEUR] ',
|
|
205
|
+
print (' Total network investment cost [MEUR] ', mTEPES.pDiscountedWeight[p] * sum(mTEPES.pNetFixedCost [ni,nf,cc] * OptModel.vNetworkInvest [p,ni,nf,cc ]() for ni,nf,cc in mTEPES.lc if (p,ni,nf,cc) in mTEPES.plc))
|
|
205
206
|
if mTEPES.pIndHydrogen == 1 and mTEPES.pc:
|
|
206
|
-
print (' Total H2 pipe investment cost [MEUR] ',
|
|
207
|
+
print (' Total H2 pipe investment cost [MEUR] ', mTEPES.pDiscountedWeight[p] * sum(mTEPES.pH2PipeFixedCost [ni,nf,cc] * OptModel.vH2PipeInvest [p,ni,nf,cc ]() for ni,nf,cc in mTEPES.pc if (p,ni,nf,cc) in mTEPES.ppc))
|
|
207
208
|
else:
|
|
208
209
|
print (' Total H2 pipe investment cost [MEUR] ', 0.0)
|
|
209
210
|
if mTEPES.pIndHeat == 1 and mTEPES.hc:
|
|
210
|
-
print (' Total heat pipe investment cost [MEUR] ',
|
|
211
|
+
print (' Total heat pipe investment cost [MEUR] ', mTEPES.pDiscountedWeight[p] * sum(mTEPES.pHeatPipeFixedCost[ni,nf,cc] * OptModel.vHeatPipeInvest [p,ni,nf,cc ]() for ni,nf,cc in mTEPES.hc if (p,ni,nf,cc) in mTEPES.phc))
|
|
211
212
|
else:
|
|
212
213
|
print (' Total heat pipe investment cost [MEUR] ', 0.0)
|
|
213
|
-
print (' Total generation operation cost [MEUR] ',
|
|
214
|
-
print (' Total consumption operation cost [MEUR] ',
|
|
215
|
-
print (' Total emission cost [MEUR] ',
|
|
216
|
-
print (' Total network losses penalty cost [MEUR] ',
|
|
217
|
-
print (' Total reliability cost [MEUR] ',
|
|
214
|
+
print (' Total generation operation cost [MEUR] ', mTEPES.pDiscountedWeight[p] * sum(mTEPES.pScenProb [p,sc ]() * OptModel.vTotalGCost [p,sc,n ]() for n in mTEPES.n ))
|
|
215
|
+
print (' Total consumption operation cost [MEUR] ', mTEPES.pDiscountedWeight[p] * sum(mTEPES.pScenProb [p,sc ]() * OptModel.vTotalCCost [p,sc,n ]() for n in mTEPES.n ))
|
|
216
|
+
print (' Total emission cost [MEUR] ', mTEPES.pDiscountedWeight[p] * sum(mTEPES.pScenProb [p,sc ]() * OptModel.vTotalECost [p,sc,n ]() for n in mTEPES.n ))
|
|
217
|
+
print (' Total network losses penalty cost [MEUR] ', mTEPES.pDiscountedWeight[p] * sum(mTEPES.pScenProb [p,sc ]() * OptModel.vTotalNCost [p,sc,n ]() for n in mTEPES.n ))
|
|
218
|
+
print (' Total reliability cost [MEUR] ', mTEPES.pDiscountedWeight[p] * sum(mTEPES.pScenProb [p,sc ]() * OptModel.vTotalRCost [p,sc,n ]() for n in mTEPES.n ))
|
|
218
219
|
|
|
219
220
|
# Adding SolverResults to mTEPES
|
|
220
221
|
mTEPES.SolverResults = SolverResults
|