openTEPES 4.17.6__py3-none-any.whl → 4.17.7__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 +12 -12
- openTEPES/openTEPES_InputData.py +108 -112
- openTEPES/openTEPES_Main.py +2 -2
- openTEPES/openTEPES_ModelFormulation.py +5 -5
- {opentepes-4.17.6.dist-info → opentepes-4.17.7.dist-info}/METADATA +1 -1
- {opentepes-4.17.6.dist-info → opentepes-4.17.7.dist-info}/RECORD +10 -10
- {opentepes-4.17.6.dist-info → opentepes-4.17.7.dist-info}/LICENSE +0 -0
- {opentepes-4.17.6.dist-info → opentepes-4.17.7.dist-info}/WHEEL +0 -0
- {opentepes-4.17.6.dist-info → opentepes-4.17.7.dist-info}/entry_points.txt +0 -0
openTEPES/__init__.py
CHANGED
|
@@ -14,7 +14,7 @@ Open Generation, Storage, and Transmission Operation and Expansion Planning Mode
|
|
|
14
14
|
>>> import openTEPES as oT
|
|
15
15
|
>>> oT.routine("9n", "C:\\Users\\UserName\\Documents\\GitHub\\openTEPES", "glpk")
|
|
16
16
|
"""
|
|
17
|
-
__version__ = "4.17.
|
|
17
|
+
__version__ = "4.17.7"
|
|
18
18
|
|
|
19
19
|
from .openTEPES_Main import main
|
|
20
20
|
from .openTEPES import *
|
openTEPES/openTEPES.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - September
|
|
2
|
+
Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - September 20, 2024
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
# import dill as pickle
|
|
@@ -39,8 +39,8 @@ def openTEPES_run(DirName, CaseName, SolverName, pIndOutputResults, pIndLogConso
|
|
|
39
39
|
idxDict['y' ] = 1
|
|
40
40
|
|
|
41
41
|
#%% model declaration
|
|
42
|
-
mTEPES = ConcreteModel('Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - Version 4.17.
|
|
43
|
-
print( 'Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - Version 4.17.
|
|
42
|
+
mTEPES = ConcreteModel('Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - Version 4.17.7 - September 20, 2024')
|
|
43
|
+
print( 'Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - Version 4.17.7 - September 20, 2024', file=open(_path+'/openTEPES_version_'+CaseName+'.log','w'))
|
|
44
44
|
|
|
45
45
|
pIndOutputResults = [j for i,j in idxDict.items() if i == pIndOutputResults][0]
|
|
46
46
|
pIndLogConsole = [j for i,j in idxDict.items() if i == pIndLogConsole ][0]
|
|
@@ -81,9 +81,9 @@ def openTEPES_run(DirName, CaseName, SolverName, pIndOutputResults, pIndLogConso
|
|
|
81
81
|
mTEPES.del_component(mTEPES.st)
|
|
82
82
|
mTEPES.del_component(mTEPES.n )
|
|
83
83
|
mTEPES.del_component(mTEPES.n2)
|
|
84
|
-
mTEPES.st = Set(
|
|
85
|
-
mTEPES.n = Set(
|
|
86
|
-
mTEPES.n2 = Set(
|
|
84
|
+
mTEPES.st = Set(doc='stages', initialize=[stt for stt in mTEPES.stt if st == stt if mTEPES.pStageWeight[stt] and sum(1 for (p,sc,st,nn) in mTEPES.s2n)])
|
|
85
|
+
mTEPES.n = Set(doc='load levels', initialize=[nn for nn in mTEPES.nn if (p,sc,st,nn) in mTEPES.s2n ])
|
|
86
|
+
mTEPES.n2 = Set(doc='load levels', initialize=[nn for nn in mTEPES.nn if (p,sc,st,nn) in mTEPES.s2n ])
|
|
87
87
|
|
|
88
88
|
# load levels multiple of cycles for each ESS/generator
|
|
89
89
|
mTEPES.nesc = [(n,es) for n,es in mTEPES.n*mTEPES.es if mTEPES.n.ord(n) % mTEPES.pStorageTimeStep [es] == 0]
|
|
@@ -162,9 +162,9 @@ def openTEPES_run(DirName, CaseName, SolverName, pIndOutputResults, pIndLogConso
|
|
|
162
162
|
mTEPES.del_component(mTEPES.st)
|
|
163
163
|
mTEPES.del_component(mTEPES.n )
|
|
164
164
|
mTEPES.del_component(mTEPES.n2)
|
|
165
|
-
mTEPES.st = Set(
|
|
166
|
-
mTEPES.n = Set(
|
|
167
|
-
mTEPES.n2 = Set(
|
|
165
|
+
mTEPES.st = Set(doc='stages', initialize=[stt for stt in mTEPES.stt if mTEPES.pStageWeight[stt] and sum(1 for p,sc,stt,nn in mTEPES.s2n)])
|
|
166
|
+
mTEPES.n = Set(doc='load levels', initialize=[nn for nn in mTEPES.nn if sum(1 for p,sc,st in mTEPES.ps*mTEPES.st if (p,sc,st, nn) in mTEPES.s2n)])
|
|
167
|
+
mTEPES.n2 = Set(doc='load levels', initialize=[nn for nn in mTEPES.nn if sum(1 for p,sc,st in mTEPES.ps*mTEPES.st if (p,sc,st, nn) in mTEPES.s2n)])
|
|
168
168
|
|
|
169
169
|
# load levels multiple of cycles for each ESS/generator
|
|
170
170
|
mTEPES.nesc = [(n,es) for n,es in mTEPES.n*mTEPES.es if mTEPES.n.ord(n) % mTEPES.pStorageTimeStep [es] == 0]
|
|
@@ -198,9 +198,9 @@ def openTEPES_run(DirName, CaseName, SolverName, pIndOutputResults, pIndLogConso
|
|
|
198
198
|
mTEPES.del_component(mTEPES.st)
|
|
199
199
|
mTEPES.del_component(mTEPES.n )
|
|
200
200
|
mTEPES.del_component(mTEPES.n2)
|
|
201
|
-
mTEPES.st = Set(
|
|
202
|
-
mTEPES.n = Set(
|
|
203
|
-
mTEPES.n2 = Set(
|
|
201
|
+
mTEPES.st = Set(doc='stages', initialize=[stt for stt in mTEPES.stt if mTEPES.pStageWeight[stt] and sum(1 for p,sc,stt,nn in mTEPES.s2n)])
|
|
202
|
+
mTEPES.n = Set(doc='load levels', initialize=[nn for nn in mTEPES.nn if sum(1 for p,sc,st in mTEPES.ps*mTEPES.st if (p,sc,st, nn) in mTEPES.s2n)])
|
|
203
|
+
mTEPES.n2 = Set(doc='load levels', initialize=[nn for nn in mTEPES.nn if sum(1 for p,sc,st in mTEPES.ps*mTEPES.st if (p,sc,st, nn) in mTEPES.s2n)])
|
|
204
204
|
|
|
205
205
|
# load levels multiple of cycles for each ESS/generator
|
|
206
206
|
mTEPES.nesc = [(n,es) for n,es in mTEPES.n*mTEPES.es if mTEPES.n.ord(n) % mTEPES.pStorageTimeStep [es] == 0]
|
openTEPES/openTEPES_InputData.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - September
|
|
2
|
+
Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - September 20, 2024
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
import datetime
|
|
@@ -203,24 +203,24 @@ def InputData(DirName, CaseName, mTEPES, pIndLogConsole):
|
|
|
203
203
|
dictSets.load(filename=_path+'/oT_Dict_ZoneToArea_' +CaseName+'.csv', set='znar', format='set')
|
|
204
204
|
dictSets.load(filename=_path+'/oT_Dict_AreaToRegion_'+CaseName+'.csv', set='arrg', format='set')
|
|
205
205
|
|
|
206
|
-
mTEPES.pp = Set(initialize=dictSets['p' ],
|
|
207
|
-
mTEPES.scc = Set(initialize=dictSets['sc' ],
|
|
208
|
-
mTEPES.stt = Set(initialize=dictSets['st' ],
|
|
209
|
-
mTEPES.nn = Set(initialize=dictSets['n' ],
|
|
210
|
-
mTEPES.gg = Set(initialize=dictSets['g' ],
|
|
211
|
-
mTEPES.gt = Set(initialize=dictSets['gt' ],
|
|
212
|
-
mTEPES.nd = Set(initialize=dictSets['nd' ],
|
|
213
|
-
mTEPES.ni = Set(initialize=dictSets['nd' ],
|
|
214
|
-
mTEPES.nf = Set(initialize=dictSets['nd' ],
|
|
215
|
-
mTEPES.zn = Set(initialize=dictSets['zn' ],
|
|
216
|
-
mTEPES.ar = Set(initialize=dictSets['ar' ],
|
|
217
|
-
mTEPES.rg = Set(initialize=dictSets['rg' ],
|
|
218
|
-
mTEPES.cc = Set(initialize=dictSets['cc' ],
|
|
219
|
-
mTEPES.c2 = Set(initialize=dictSets['cc' ],
|
|
220
|
-
mTEPES.lt = Set(initialize=dictSets['lt' ],
|
|
221
|
-
mTEPES.ndzn = Set(initialize=dictSets['ndzn'],
|
|
222
|
-
mTEPES.znar = Set(initialize=dictSets['znar'],
|
|
223
|
-
mTEPES.arrg = Set(initialize=dictSets['arrg'],
|
|
206
|
+
mTEPES.pp = Set(initialize=dictSets['p' ], doc='periods', within=PositiveIntegers)
|
|
207
|
+
mTEPES.scc = Set(initialize=dictSets['sc' ], doc='scenarios' )
|
|
208
|
+
mTEPES.stt = Set(initialize=dictSets['st' ], doc='stages' )
|
|
209
|
+
mTEPES.nn = Set(initialize=dictSets['n' ], doc='load levels' )
|
|
210
|
+
mTEPES.gg = Set(initialize=dictSets['g' ], doc='units' )
|
|
211
|
+
mTEPES.gt = Set(initialize=dictSets['gt' ], doc='technologies' )
|
|
212
|
+
mTEPES.nd = Set(initialize=dictSets['nd' ], doc='nodes' )
|
|
213
|
+
mTEPES.ni = Set(initialize=dictSets['nd' ], doc='nodes' )
|
|
214
|
+
mTEPES.nf = Set(initialize=dictSets['nd' ], doc='nodes' )
|
|
215
|
+
mTEPES.zn = Set(initialize=dictSets['zn' ], doc='zones' )
|
|
216
|
+
mTEPES.ar = Set(initialize=dictSets['ar' ], doc='areas' )
|
|
217
|
+
mTEPES.rg = Set(initialize=dictSets['rg' ], doc='regions' )
|
|
218
|
+
mTEPES.cc = Set(initialize=dictSets['cc' ], doc='circuits' )
|
|
219
|
+
mTEPES.c2 = Set(initialize=dictSets['cc' ], doc='circuits' )
|
|
220
|
+
mTEPES.lt = Set(initialize=dictSets['lt' ], doc='electric line types' )
|
|
221
|
+
mTEPES.ndzn = Set(initialize=dictSets['ndzn'], doc='node to zone' )
|
|
222
|
+
mTEPES.znar = Set(initialize=dictSets['znar'], doc='zone to area' )
|
|
223
|
+
mTEPES.arrg = Set(initialize=dictSets['arrg'], doc='area to region' )
|
|
224
224
|
|
|
225
225
|
try:
|
|
226
226
|
import csv
|
|
@@ -230,37 +230,37 @@ def InputData(DirName, CaseName, mTEPES, pIndLogConsole):
|
|
|
230
230
|
num_lines = sum(1 for _ in reader)
|
|
231
231
|
return num_lines
|
|
232
232
|
|
|
233
|
-
mTEPES.rs = Set(initialize=[],
|
|
234
|
-
mTEPES.r2h = Set(initialize=[],
|
|
235
|
-
mTEPES.h2r = Set(initialize=[],
|
|
236
|
-
mTEPES.r2r = Set(initialize=[],
|
|
237
|
-
mTEPES.p2r = Set(initialize=[],
|
|
238
|
-
mTEPES.r2p = Set(initialize=[],
|
|
233
|
+
mTEPES.rs = Set(initialize=[], doc='reservoirs' )
|
|
234
|
+
mTEPES.r2h = Set(initialize=[], doc='reservoir to hydro' )
|
|
235
|
+
mTEPES.h2r = Set(initialize=[], doc='hydro to reservoir' )
|
|
236
|
+
mTEPES.r2r = Set(initialize=[], doc='reservoir to reservoir' )
|
|
237
|
+
mTEPES.p2r = Set(initialize=[], doc='pumped-hydro to reservoir')
|
|
238
|
+
mTEPES.r2p = Set(initialize=[], doc='reservoir to pumped-hydro')
|
|
239
239
|
|
|
240
240
|
if count_lines_in_csv( _path+'/oT_Dict_Reservoir_' +CaseName+'.csv') > 1:
|
|
241
241
|
dictSets.load(filename=_path+'/oT_Dict_Reservoir_' +CaseName+'.csv', set='rs' , format='set')
|
|
242
242
|
mTEPES.del_component(mTEPES.rs)
|
|
243
|
-
mTEPES.rs = Set(initialize=dictSets['rs' ],
|
|
243
|
+
mTEPES.rs = Set(initialize=dictSets['rs' ], doc='reservoirs' )
|
|
244
244
|
if count_lines_in_csv( _path+'/oT_Dict_ReservoirToHydro_' +CaseName+'.csv') > 1:
|
|
245
245
|
dictSets.load(filename=_path+'/oT_Dict_ReservoirToHydro_' +CaseName+'.csv', set='r2h', format='set')
|
|
246
246
|
mTEPES.del_component(mTEPES.r2h)
|
|
247
|
-
mTEPES.r2h = Set(initialize=dictSets['r2h'],
|
|
247
|
+
mTEPES.r2h = Set(initialize=dictSets['r2h'], doc='reservoir to hydro' )
|
|
248
248
|
if count_lines_in_csv( _path+'/oT_Dict_HydroToReservoir_' +CaseName+'.csv') > 1:
|
|
249
249
|
dictSets.load(filename=_path+'/oT_Dict_HydroToReservoir_' +CaseName+'.csv', set='h2r', format='set')
|
|
250
250
|
mTEPES.del_component(mTEPES.h2r)
|
|
251
|
-
mTEPES.h2r = Set(initialize=dictSets['h2r'],
|
|
251
|
+
mTEPES.h2r = Set(initialize=dictSets['h2r'], doc='hydro to reservoir' )
|
|
252
252
|
if count_lines_in_csv( _path+'/oT_Dict_ReservoirToReservoir_' +CaseName+'.csv') > 1:
|
|
253
253
|
dictSets.load(filename=_path+'/oT_Dict_ReservoirToReservoir_' +CaseName+'.csv', set='r2r', format='set')
|
|
254
254
|
mTEPES.del_component(mTEPES.r2r)
|
|
255
|
-
mTEPES.r2r = Set(initialize=dictSets['r2r'],
|
|
255
|
+
mTEPES.r2r = Set(initialize=dictSets['r2r'], doc='reservoir to reservoir' )
|
|
256
256
|
if count_lines_in_csv( _path+'/oT_Dict_PumpedHydroToReservoir_'+CaseName+'.csv') > 1:
|
|
257
257
|
dictSets.load(filename=_path+'/oT_Dict_PumpedHydroToReservoir_'+CaseName+'.csv', set='p2r', format='set')
|
|
258
258
|
mTEPES.del_component(mTEPES.p2r)
|
|
259
|
-
mTEPES.p2r = Set(initialize=dictSets['p2r'],
|
|
259
|
+
mTEPES.p2r = Set(initialize=dictSets['p2r'], doc='pumped-hydro to reservoir')
|
|
260
260
|
if count_lines_in_csv( _path+'/oT_Dict_ReservoirToPumpedHydro_'+CaseName+'.csv') > 1:
|
|
261
261
|
dictSets.load(filename=_path+'/oT_Dict_ReservoirToPumpedHydro_'+CaseName+'.csv', set='r2p', format='set')
|
|
262
262
|
mTEPES.del_component(mTEPES.r2p)
|
|
263
|
-
mTEPES.r2p = Set(initialize=dictSets['r2p'],
|
|
263
|
+
mTEPES.r2p = Set(initialize=dictSets['r2p'], doc='reservoir to pumped-hydro')
|
|
264
264
|
except:
|
|
265
265
|
pass
|
|
266
266
|
|
|
@@ -559,64 +559,64 @@ def InputData(DirName, CaseName, mTEPES, pIndLogConsole):
|
|
|
559
559
|
sBrList = [(ni,nf) for n,(ni,nf) in enumerate(sBr) if (ni,nf) not in sBr[:n]]
|
|
560
560
|
|
|
561
561
|
#%% defining subsets: active load levels (n,n2), thermal units (t), RES units (r), ESS units (es), candidate gen units (gc), candidate ESS units (ec), all the electric lines (la), candidate electric lines (lc), candidate DC electric lines (cd), existing DC electric lines (cd), electric lines with losses (ll), reference node (rf), and reactive generating units (gq)
|
|
562
|
-
mTEPES.p = Set(
|
|
563
|
-
mTEPES.sc = Set(
|
|
564
|
-
mTEPES.ps = Set(
|
|
565
|
-
mTEPES.st = Set(
|
|
566
|
-
mTEPES.n = Set(
|
|
567
|
-
mTEPES.n2 = Set(
|
|
568
|
-
mTEPES.g = Set(
|
|
569
|
-
mTEPES.t = Set(
|
|
570
|
-
mTEPES.re = Set(
|
|
571
|
-
mTEPES.es = Set(
|
|
572
|
-
mTEPES.h = Set(
|
|
573
|
-
mTEPES.el = Set(
|
|
574
|
-
mTEPES.hp = Set(
|
|
575
|
-
mTEPES.ch = Set(
|
|
576
|
-
mTEPES.bo = Set(
|
|
577
|
-
mTEPES.hh = Set(
|
|
578
|
-
mTEPES.gc = Set(
|
|
579
|
-
mTEPES.gd = Set(
|
|
580
|
-
mTEPES.ec = Set(
|
|
581
|
-
mTEPES.bc = Set(
|
|
582
|
-
mTEPES.br = Set(
|
|
583
|
-
mTEPES.ln = Set(
|
|
584
|
-
mTEPES.la = Set(
|
|
585
|
-
mTEPES.ls = Set(
|
|
586
|
-
mTEPES.lc = Set(
|
|
587
|
-
mTEPES.cd = Set(
|
|
588
|
-
mTEPES.ed = Set(
|
|
589
|
-
mTEPES.ll = Set(
|
|
590
|
-
mTEPES.rf = Set(
|
|
591
|
-
mTEPES.gq = Set(
|
|
592
|
-
mTEPES.sq = Set(
|
|
593
|
-
mTEPES.sqc = Set(
|
|
594
|
-
mTEPES.shc = Set(
|
|
562
|
+
mTEPES.p = Set(doc='periods' , initialize=[pp for pp in mTEPES.pp if pPeriodWeight [pp] > 0.0 and sum(pDuration[pp,sc,n] for sc,n in mTEPES.scc*mTEPES.nn)])
|
|
563
|
+
mTEPES.sc = Set(doc='scenarios' , initialize=[scc for scc in mTEPES.scc ])
|
|
564
|
+
mTEPES.ps = Set(doc='periods/scenarios' , initialize=[(p,sc) for p,sc in mTEPES.p*mTEPES.sc if pScenProb [p,sc] > 0.0 and sum(pDuration[p,sc,n ] for n in mTEPES.nn)])
|
|
565
|
+
mTEPES.st = Set(doc='stages' , initialize=[stt for stt in mTEPES.stt if pStageWeight [stt] > 0.0])
|
|
566
|
+
mTEPES.n = Set(doc='load levels' , initialize=[nn for nn in mTEPES.nn if sum(pDuration [p,sc,nn] for p,sc in mTEPES.ps) > 0])
|
|
567
|
+
mTEPES.n2 = Set(doc='load levels' , initialize=[nn for nn in mTEPES.nn if sum(pDuration [p,sc,nn] for p,sc in mTEPES.ps) > 0])
|
|
568
|
+
mTEPES.g = Set(doc='generating units' , initialize=[gg for gg in mTEPES.gg if (pRatedMaxPowerElec [gg] > 0.0 or pRatedMaxCharge[gg] > 0.0 or pRatedMaxPowerHeat [gg] > 0.0) and pElecGenPeriodIni[gg] <= mTEPES.p.last() and pElecGenPeriodFin[gg] >= mTEPES.p.first() and pGenToNode.reset_index().set_index(['index']).isin(mTEPES.nd)['Node'][gg]]) # excludes generators with empty node
|
|
569
|
+
mTEPES.t = Set(doc='thermal units' , initialize=[g for g in mTEPES.g if pRatedLinearOperCost[g ] > 0.0])
|
|
570
|
+
mTEPES.re = Set(doc='RES units' , initialize=[g for g in mTEPES.g if pRatedLinearOperCost[g ] == 0.0 and pRatedMaxStorage[g] == 0.0 and pProductionFunctionH2[g ] == 0.0 and pProductionFunctionHeat[g ] == 0.0 and pProductionFunctionHydro[g ] == 0.0])
|
|
571
|
+
mTEPES.es = Set(doc='ESS units' , initialize=[g for g in mTEPES.g if (pRatedMaxCharge[g ] > 0.0 or pRatedMaxStorage[g] > 0.0 or pProductionFunctionH2[g ] > 0.0 or pProductionFunctionHeat[g ] > 0.0) and pProductionFunctionHydro[g ] == 0.0])
|
|
572
|
+
mTEPES.h = Set(doc='hydro units' , initialize=[g for g in mTEPES.g if pProductionFunctionH2[g ] == 0.0 and pProductionFunctionHeat[g ] == 0.0 and pProductionFunctionHydro[g ] > 0.0])
|
|
573
|
+
mTEPES.el = Set(doc='electrolyzer units' , initialize=[es for es in mTEPES.es if pProductionFunctionH2[es] > 0.0 and pProductionFunctionHeat[es] == 0.0 and pProductionFunctionHydro[es] == 0.0])
|
|
574
|
+
mTEPES.hp = Set(doc='heat pump & elec boiler units' , initialize=[es for es in mTEPES.es if pProductionFunctionH2[es] == 0.0 and pProductionFunctionHeat[es] > 0.0 and pProductionFunctionHydro[es] == 0.0])
|
|
575
|
+
mTEPES.ch = Set(doc='CHP & fuel boiler units' , initialize=[g for g in mTEPES.g if pRatedMaxPowerHeat[g ] > 0.0 and pProductionFunctionHeat [g ] == 0.0])
|
|
576
|
+
mTEPES.bo = Set(doc=' fuel boiler units' , initialize=[ch for ch in mTEPES.ch if pRatedMaxPowerElec [ch] == 0.0 and pRatedMaxPowerHeat[ch] > 0.0 and pProductionFunctionHeat [ch] == 0.0])
|
|
577
|
+
mTEPES.hh = Set(doc=' hydrogen boiler units' , initialize=[bo for bo in mTEPES.bo if pProductionFunctionH2ToHeat[bo] > 0.0])
|
|
578
|
+
mTEPES.gc = Set(doc='candidate units' , initialize=[g for g in mTEPES.g if pGenInvestCost [g ] > 0.0])
|
|
579
|
+
mTEPES.gd = Set(doc='retirement units' , initialize=[g for g in mTEPES.g if pGenRetireCost [g ] > 0.0])
|
|
580
|
+
mTEPES.ec = Set(doc='candidate ESS units' , initialize=[es for es in mTEPES.es if pGenInvestCost [es] > 0.0])
|
|
581
|
+
mTEPES.bc = Set(doc='candidate boiler units' , initialize=[bo for bo in mTEPES.bo if pGenInvestCost [bo] > 0.0])
|
|
582
|
+
mTEPES.br = Set(doc='all input electric branches', initialize=sBrList )
|
|
583
|
+
mTEPES.ln = Set(doc='all input electric lines' , initialize=dfNetwork.index)
|
|
584
|
+
mTEPES.la = Set(doc='all real electric lines' , initialize=[ln for ln in mTEPES.ln if pLineX [ln] != 0.0 and pLineNTCFrw[ln] > 0.0 and pLineNTCBck[ln] > 0.0 and pElecNetPeriodIni[ln] <= mTEPES.p.last() and pElecNetPeriodFin[ln] >= mTEPES.p.first()])
|
|
585
|
+
mTEPES.ls = Set(doc='all real switch electric lines' , initialize=[la for la in mTEPES.la if pIndBinLineSwitch [la] ])
|
|
586
|
+
mTEPES.lc = Set(doc='candidate electric lines' , initialize=[la for la in mTEPES.la if pNetFixedCost [la] > 0.0])
|
|
587
|
+
mTEPES.cd = Set(doc=' DC electric lines' , initialize=[la for la in mTEPES.la if pNetFixedCost [la] > 0.0 and pLineType[la] == 'DC'])
|
|
588
|
+
mTEPES.ed = Set(doc=' DC electric lines' , initialize=[la for la in mTEPES.la if pNetFixedCost [la] == 0.0 and pLineType[la] == 'DC'])
|
|
589
|
+
mTEPES.ll = Set(doc='loss electric lines' , initialize=[la for la in mTEPES.la if pLineLossFactor [la] > 0.0 and pIndBinNetLosses > 0 ])
|
|
590
|
+
mTEPES.rf = Set(doc='reference node' , initialize=[pReferenceNode])
|
|
591
|
+
mTEPES.gq = Set(doc='gen reactive units' , initialize=[gg for gg in mTEPES.gg if pRMaxReactivePower [gg] > 0.0 and pElecGenPeriodIni[gg] <= mTEPES.p.last() and pElecGenPeriodFin[gg] >= mTEPES.p.first()])
|
|
592
|
+
mTEPES.sq = Set(doc='synchr reactive units' , initialize=[gg for gg in mTEPES.gg if pRMaxReactivePower [gg] > 0.0 and pGenToTechnology[gg] == 'SynchronousCondenser' and pElecGenPeriodIni[gg] <= mTEPES.p.last() and pElecGenPeriodFin[gg] >= mTEPES.p.first()])
|
|
593
|
+
mTEPES.sqc = Set(doc='synchr reactive candidate')
|
|
594
|
+
mTEPES.shc = Set(doc='shunt candidate')
|
|
595
595
|
if pIndHydroTopology == 1:
|
|
596
|
-
mTEPES.rn = Set(
|
|
596
|
+
mTEPES.rn = Set(doc='candidate reservoirs' , initialize=[rs for rs in mTEPES.rs if pRsrInvestCost [rs] > 0.0 and pRsrPeriodIni[rs] <= mTEPES.p.last() and pRsrPeriodFin[rs] >= mTEPES.p.first()])
|
|
597
597
|
else:
|
|
598
|
-
mTEPES.rn = Set(
|
|
598
|
+
mTEPES.rn = Set(doc='candidate reservoirs' , initialize=[] )
|
|
599
599
|
if pIndHydrogen == 1:
|
|
600
|
-
mTEPES.pn = Set(
|
|
601
|
-
mTEPES.pa = Set(
|
|
602
|
-
mTEPES.pc = Set(
|
|
600
|
+
mTEPES.pn = Set(doc='all input hydrogen pipes' , initialize=dfNetworkHydrogen.index )
|
|
601
|
+
mTEPES.pa = Set(doc='all real hydrogen pipes' , initialize=[pn for pn in mTEPES.pn if pH2PipeNTCFrw [pn] > 0.0 and pH2PipeNTCBck[pn] > 0.0 and pH2PipePeriodIni[pn] <= mTEPES.p.last() and pH2PipePeriodFin[pn] >= mTEPES.p.first()])
|
|
602
|
+
mTEPES.pc = Set(doc='candidate hydrogen pipes' , initialize=[pa for pa in mTEPES.pa if pH2PipeFixedCost [pa] > 0.0])
|
|
603
603
|
# existing hydrogen pipelines (pe)
|
|
604
604
|
mTEPES.pe = mTEPES.pa - mTEPES.pc
|
|
605
605
|
else:
|
|
606
|
-
mTEPES.pn = Set(
|
|
607
|
-
mTEPES.pa = Set(
|
|
608
|
-
mTEPES.pc = Set(
|
|
606
|
+
mTEPES.pn = Set(doc='all input hydrogen pipes' , initialize=[])
|
|
607
|
+
mTEPES.pa = Set(doc='all real hydrogen pipes' , initialize=[])
|
|
608
|
+
mTEPES.pc = Set(doc='candidate hydrogen pipes' , initialize=[])
|
|
609
609
|
|
|
610
610
|
if pIndHeat == 1:
|
|
611
|
-
mTEPES.hn = Set(
|
|
612
|
-
mTEPES.ha = Set(
|
|
613
|
-
mTEPES.hc = Set(
|
|
611
|
+
mTEPES.hn = Set(doc='all input heat pipes' , initialize=dfNetworkHeat.index)
|
|
612
|
+
mTEPES.ha = Set(doc='all real heat pipes' , initialize=[hn for hn in mTEPES.hn if pHeatPipeNTCFrw [hn] > 0.0 and pHeatPipeNTCBck[hn] > 0.0 and pHeatPipePeriodIni[hn] <= mTEPES.p.last() and pHeatPipePeriodFin[hn] >= mTEPES.p.first()])
|
|
613
|
+
mTEPES.hc = Set(doc='candidate heat pipes' , initialize=[ha for ha in mTEPES.ha if pHeatPipeFixedCost [ha] > 0.0])
|
|
614
614
|
# existing heat pipes (he)
|
|
615
615
|
mTEPES.he = mTEPES.ha - mTEPES.hc
|
|
616
616
|
else:
|
|
617
|
-
mTEPES.hn = Set(
|
|
618
|
-
mTEPES.ha = Set(
|
|
619
|
-
mTEPES.hc = Set(
|
|
617
|
+
mTEPES.hn = Set(doc='all input heat pipes' , initialize=[])
|
|
618
|
+
mTEPES.ha = Set(doc='all real heat pipes' , initialize=[])
|
|
619
|
+
mTEPES.hc = Set(doc='candidate heat pipes' , initialize=[])
|
|
620
620
|
|
|
621
621
|
# non-RES units, they can be committed and also contribute to the operating reserves
|
|
622
622
|
mTEPES.nr = mTEPES.g - mTEPES.re
|
|
@@ -638,7 +638,7 @@ def InputData(DirName, CaseName, mTEPES, pIndLogConsole):
|
|
|
638
638
|
pStageToLevel = pStageToLevel.loc[pStageToLevel['level_2'].keys().isin(mTEPES.ps*mTEPES.st)]
|
|
639
639
|
pStageToLevel = pStageToLevel.loc[pStageToLevel['level_2'].isin(mTEPES.n)].reset_index().set_index(['level_0','level_1','Stage','level_2'])
|
|
640
640
|
|
|
641
|
-
mTEPES.s2n = Set(initialize=pStageToLevel.index,
|
|
641
|
+
mTEPES.s2n = Set(initialize=pStageToLevel.index, doc='load level to stage')
|
|
642
642
|
# all the stages must have the same duration
|
|
643
643
|
pStageDuration = pd.Series([sum(pDuration[p,sc,n] for p,sc,st2,n in mTEPES.s2n if st2 == st) for st in mTEPES.st], index=mTEPES.st)
|
|
644
644
|
# for st in mTEPES.st:
|
|
@@ -648,8 +648,8 @@ def InputData(DirName, CaseName, mTEPES, pIndLogConsole):
|
|
|
648
648
|
# delete all the load level belonging to stages with duration equal to zero
|
|
649
649
|
mTEPES.del_component(mTEPES.n )
|
|
650
650
|
mTEPES.del_component(mTEPES.n2)
|
|
651
|
-
mTEPES.n = Set(
|
|
652
|
-
mTEPES.n2 = Set(
|
|
651
|
+
mTEPES.n = Set(doc='load levels', initialize=[nn for nn in mTEPES.nn if sum(pDuration[p,sc,nn] for p,sc in mTEPES.ps) > 0])
|
|
652
|
+
mTEPES.n2 = Set(doc='load levels', initialize=[nn for nn in mTEPES.nn if sum(pDuration[p,sc,nn] for p,sc in mTEPES.ps) > 0])
|
|
653
653
|
# instrumental sets
|
|
654
654
|
def CreateInstrumentalSets(mTEPES, pIndHydroTopology, pIndHydrogen, pIndHeat) -> None:
|
|
655
655
|
'''
|
|
@@ -782,24 +782,24 @@ def InputData(DirName, CaseName, mTEPES, pIndLogConsole):
|
|
|
782
782
|
if pIndHeat == 1:
|
|
783
783
|
pIndBinHeatPipeInvest = pIndBinHeatPipeInvest.map(idxDict)
|
|
784
784
|
|
|
785
|
-
# define AC existing lines non-switchable
|
|
786
|
-
mTEPES.lea = Set(
|
|
785
|
+
# define AC existing lines non-switchable lines
|
|
786
|
+
mTEPES.lea = Set(doc='AC existing lines and non-switchable lines', initialize=[le for le in mTEPES.le if pIndBinLineSwitch[le] == 0 and not pLineType[le] == 'DC'])
|
|
787
787
|
# define AC candidate lines and switchable lines
|
|
788
|
-
mTEPES.lca = Set(
|
|
788
|
+
mTEPES.lca = Set(doc='AC candidate lines and switchable lines', initialize=[la for la in mTEPES.la if (pIndBinLineSwitch[la] == 1 or pNetFixedCost[la] > 0.0) and not pLineType[la] == 'DC'])
|
|
789
789
|
|
|
790
790
|
mTEPES.laa = mTEPES.lea | mTEPES.lca
|
|
791
791
|
|
|
792
|
-
# define DC existing lines non-switchable
|
|
793
|
-
mTEPES.led = Set(
|
|
792
|
+
# define DC existing lines non-switchable lines
|
|
793
|
+
mTEPES.led = Set(doc='DC existing lines and non-switchable lines', initialize=[le for le in mTEPES.le if pIndBinLineSwitch[le] == 0 and pLineType[le] == 'DC'])
|
|
794
794
|
# define DC candidate lines and switchable lines
|
|
795
|
-
mTEPES.lcd = Set(
|
|
795
|
+
mTEPES.lcd = Set(doc='DC candidate lines and switchable lines', initialize=[la for la in mTEPES.la if (pIndBinLineSwitch[la] == 1 or pNetFixedCost[la] > 0.0) and pLineType[la] == 'DC'])
|
|
796
796
|
|
|
797
797
|
mTEPES.lad = mTEPES.led | mTEPES.lcd
|
|
798
798
|
|
|
799
799
|
# line type
|
|
800
800
|
pLineType = pLineType.reset_index().set_index(['level_0','level_1','level_2','LineType'])
|
|
801
801
|
|
|
802
|
-
mTEPES.pLineType = Set(initialize=pLineType.index,
|
|
802
|
+
mTEPES.pLineType = Set(initialize=pLineType.index, doc='line type')
|
|
803
803
|
|
|
804
804
|
if pAnnualDiscRate == 0.0:
|
|
805
805
|
pDiscountedWeight = pd.Series([ pPeriodWeight[p] for p in mTEPES.p], index=mTEPES.p)
|
|
@@ -814,15 +814,11 @@ def InputData(DirName, CaseName, mTEPES, pIndLogConsole):
|
|
|
814
814
|
pNodeToGen = pGenToNode.reset_index().set_index('Node').set_axis(['Generator'], axis=1)[['Generator']]
|
|
815
815
|
pNodeToGen = pNodeToGen.loc[pNodeToGen['Generator'].isin(mTEPES.g)].reset_index().set_index(['Node', 'Generator'])
|
|
816
816
|
|
|
817
|
-
mTEPES.n2g = Set(initialize=pNodeToGen.index,
|
|
817
|
+
mTEPES.n2g = Set(initialize=pNodeToGen.index, doc='node to generator')
|
|
818
818
|
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
mTEPES.z2g = Set(initialize=mTEPES.zn*mTEPES.g, ordered=False, doc='zone to generator', filter=lambda mTEPES,zn,g: (zn,g) in pZone2Gen )
|
|
824
|
-
mTEPES.a2g = Set(initialize=mTEPES.ar*mTEPES.g, ordered=False, doc='area to generator', filter=lambda mTEPES,ar,g: (ar,g) in pArea2Gen )
|
|
825
|
-
mTEPES.r2g = Set(initialize=mTEPES.rg*mTEPES.g, ordered=False, doc='region to generator', filter=lambda mTEPES,rg,g: (rg,g) in pRegion2Gen)
|
|
819
|
+
mTEPES.z2g = Set(doc='zone to generator', initialize=[(zn,g) for (nd,g,zn ) in mTEPES.n2g*mTEPES.zn if (nd,zn) in mTEPES.ndzn ])
|
|
820
|
+
mTEPES.a2g = Set(doc='area to generator', initialize=[(ar,g) for (nd,g,zn,ar ) in mTEPES.n2g*mTEPES.znar if (nd,zn) in mTEPES.ndzn ])
|
|
821
|
+
mTEPES.r2g = Set(doc='region to generator', initialize=[(rg,g) for (nd,g,zn,ar,rg) in mTEPES.n2g*mTEPES.znar*mTEPES.rg if (nd,zn) in mTEPES.ndzn and [ar,rg] in mTEPES.arrg])
|
|
826
822
|
|
|
827
823
|
# mTEPES.z2g = Set(initialize = [(zn,g) for zn,g in mTEPES.zn*mTEPES.g if (zn,g) in pZone2Gen])
|
|
828
824
|
|
|
@@ -830,15 +826,15 @@ def InputData(DirName, CaseName, mTEPES, pIndLogConsole):
|
|
|
830
826
|
pTechnologyToGen = pGenToTechnology.reset_index().set_index('Technology').set_axis(['Generator'], axis=1)[['Generator']]
|
|
831
827
|
pTechnologyToGen = pTechnologyToGen.loc[pTechnologyToGen['Generator'].isin(mTEPES.g)].reset_index().set_index(['Technology', 'Generator'])
|
|
832
828
|
|
|
833
|
-
mTEPES.t2g = Set(initialize=pTechnologyToGen.index,
|
|
829
|
+
mTEPES.t2g = Set(initialize=pTechnologyToGen.index, doc='technology to generator')
|
|
834
830
|
|
|
835
831
|
# ESS and RES technologies
|
|
836
832
|
def Create_ESS_RES_Sets(mTEPES) -> None:
|
|
837
|
-
mTEPES.ot = Set(
|
|
838
|
-
mTEPES.ht = Set(
|
|
839
|
-
mTEPES.et = Set(
|
|
840
|
-
mTEPES.rt = Set(
|
|
841
|
-
mTEPES.nt = Set(
|
|
833
|
+
mTEPES.ot = Set(doc='ESS technologies', initialize=[gt for gt in mTEPES.gt if sum(1 for es in mTEPES.es if (gt,es) in mTEPES.t2g)])
|
|
834
|
+
mTEPES.ht = Set(doc='hydro technologies', initialize=[gt for gt in mTEPES.gt if sum(1 for h in mTEPES.h if (gt,h ) in mTEPES.t2g)])
|
|
835
|
+
mTEPES.et = Set(doc='ESS & hydro technologies', initialize=[gt for gt in mTEPES.gt if sum(1 for eh in mTEPES.eh if (gt,eh) in mTEPES.t2g)])
|
|
836
|
+
mTEPES.rt = Set(doc=' RES technologies', initialize=[gt for gt in mTEPES.gt if sum(1 for re in mTEPES.re if (gt,re) in mTEPES.t2g)])
|
|
837
|
+
mTEPES.nt = Set(doc='non-RES technologies', initialize=[gt for gt in mTEPES.gt if sum(1 for nr in mTEPES.nr if (gt,nr) in mTEPES.t2g)])
|
|
842
838
|
|
|
843
839
|
mTEPES.psgt = Set(initialize=[(p,sc, gt) for p,sc, gt in mTEPES.ps *mTEPES.gt if sum(1 for g in mTEPES.g if (p,g ) in mTEPES.pg and (gt,g ) in mTEPES.t2g)])
|
|
844
840
|
mTEPES.psot = Set(initialize=[(p,sc, ot) for p,sc, ot in mTEPES.ps *mTEPES.ot if sum(1 for es in mTEPES.es if (p,es) in mTEPES.pes and (ot,es) in mTEPES.t2g)])
|
|
@@ -859,7 +855,7 @@ def InputData(DirName, CaseName, mTEPES, pIndLogConsole):
|
|
|
859
855
|
pExclusiveGenToGen = pGenToExclusiveGen.reset_index().set_index('MutuallyExclusive').set_axis(['Generator'], axis=1)[['Generator']]
|
|
860
856
|
pExclusiveGenToGen = pExclusiveGenToGen.loc[pExclusiveGenToGen['Generator'].isin(mTEPES.g)].reset_index().set_index(['MutuallyExclusive', 'Generator'])
|
|
861
857
|
|
|
862
|
-
mTEPES.g2g = Set(
|
|
858
|
+
mTEPES.g2g = Set(doc='mutually exclusive generator to generator', initialize=[(gg,g) for gg,g in mTEPES.g*mTEPES.g if (gg,g) in pExclusiveGenToGen])
|
|
863
859
|
|
|
864
860
|
# minimum and maximum variable power, charge, and storage capacity
|
|
865
861
|
pMinPowerElec = pVariableMinPowerElec.replace(0.0, pRatedMinPowerElec)
|
|
@@ -1998,8 +1994,8 @@ def SettingUpVariables(OptModel, mTEPES):
|
|
|
1998
1994
|
# activate only period, scenario, and load levels to formulate
|
|
1999
1995
|
mTEPES.del_component(mTEPES.st)
|
|
2000
1996
|
mTEPES.del_component(mTEPES.n )
|
|
2001
|
-
mTEPES.st = Set(
|
|
2002
|
-
mTEPES.n = Set(
|
|
1997
|
+
mTEPES.st = Set(doc='stages', initialize=[stt for stt in mTEPES.stt if st == stt and mTEPES.pStageWeight[stt] and sum(1 for (p,sc,st,nn) in mTEPES.s2n)])
|
|
1998
|
+
mTEPES.n = Set(doc='load levels', initialize=[nn for nn in mTEPES.nn if (p,sc,st,nn) in mTEPES.s2n ])
|
|
2003
1999
|
|
|
2004
2000
|
if len(mTEPES.n):
|
|
2005
2001
|
mTEPES.psn1 = Set(initialize=[(p,sc,n) for p,sc,n in mTEPES.ps*mTEPES.n])
|
|
@@ -2047,8 +2043,8 @@ def SettingUpVariables(OptModel, mTEPES):
|
|
|
2047
2043
|
# activate all the periods, scenarios, and load levels again
|
|
2048
2044
|
mTEPES.del_component(mTEPES.st)
|
|
2049
2045
|
mTEPES.del_component(mTEPES.n )
|
|
2050
|
-
mTEPES.st = Set(
|
|
2051
|
-
mTEPES.n = Set(
|
|
2046
|
+
mTEPES.st = Set(doc='stages', initialize=[stt for stt in mTEPES.stt if mTEPES.pStageWeight[stt] and sum(1 for (p,sc,stt,nn) in mTEPES.s2n)])
|
|
2047
|
+
mTEPES.n = Set(doc='load levels', initialize=[nn for nn in mTEPES.nn if sum(1 for st in mTEPES.st if (p,sc,st, nn) in mTEPES.s2n)])
|
|
2052
2048
|
|
|
2053
2049
|
# fixing the ESS inventory at the end of the following pStorageTimeStep (daily, weekly, monthly) if between storage limits, i.e.,
|
|
2054
2050
|
# for daily ESS is fixed at the end of the week, for weekly ESS is fixed at the end of the month, for monthly ESS is fixed at the end of the year
|
|
@@ -2125,21 +2121,21 @@ def SettingUpVariables(OptModel, mTEPES):
|
|
|
2125
2121
|
# fixing the ENS in nodes with no demand
|
|
2126
2122
|
for p,sc,n,nd in mTEPES.psnnd:
|
|
2127
2123
|
if mTEPES.pDemandElec[p,sc,n,nd] == 0.0:
|
|
2128
|
-
OptModel.vENS[p,sc,n,nd].fix(0.0)
|
|
2124
|
+
OptModel.vENS [p,sc,n,nd].fix(0.0)
|
|
2129
2125
|
nFixedVariables += 1
|
|
2130
2126
|
|
|
2131
2127
|
if mTEPES.pIndHydrogen == 1:
|
|
2132
2128
|
# fixing the H2 ENS in nodes with no hydrogen demand
|
|
2133
2129
|
for p,sc,n,nd in mTEPES.psnnd:
|
|
2134
|
-
if mTEPES.pDemandH2[p,sc,n,nd] ==
|
|
2135
|
-
OptModel.vH2NS[p,sc,n,nd].fix (0.0)
|
|
2130
|
+
if mTEPES.pDemandH2[p,sc,n,nd] == 0.0:
|
|
2131
|
+
OptModel.vH2NS [p,sc,n,nd].fix (0.0)
|
|
2136
2132
|
nFixedVariables += 1
|
|
2137
2133
|
|
|
2138
2134
|
if mTEPES.pIndHeat == 1:
|
|
2139
2135
|
# fixing the heat ENS in nodes with no heat demand
|
|
2140
2136
|
for p,sc,n,nd in mTEPES.psnnd:
|
|
2141
|
-
if mTEPES.pDemandHeat[p,sc,n,nd] ==
|
|
2142
|
-
OptModel.vHeatNS[p,sc,n,nd].fix (0.0)
|
|
2137
|
+
if mTEPES.pDemandHeat[p,sc,n,nd] == 0.0:
|
|
2138
|
+
OptModel.vHeatNS [p,sc,n,nd].fix (0.0)
|
|
2143
2139
|
nFixedVariables += 1
|
|
2144
2140
|
def AvoidForbiddenInstallationsAndRetirements(mTEPES, OptModel) -> int:
|
|
2145
2141
|
'''
|
openTEPES/openTEPES_Main.py
CHANGED
|
@@ -660,7 +660,7 @@
|
|
|
660
660
|
# For more information on this, and how to apply and follow the GNU AGPL, see
|
|
661
661
|
# <https://www.gnu.org/licenses/>.
|
|
662
662
|
|
|
663
|
-
# Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) -
|
|
663
|
+
# Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - September 20, 2024
|
|
664
664
|
# simplicity and transparency in power systems planning
|
|
665
665
|
|
|
666
666
|
# Developed by
|
|
@@ -685,7 +685,7 @@ import time
|
|
|
685
685
|
# import pkg_resources
|
|
686
686
|
from .openTEPES import openTEPES_run
|
|
687
687
|
|
|
688
|
-
print('\033[1;32mOpen Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - Version 4.17.
|
|
688
|
+
print('\033[1;32mOpen Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - Version 4.17.7 - September 20, 2024\033[0m')
|
|
689
689
|
print('\033[34m#### Academic research license - for non-commercial use only ####\033[0m \n')
|
|
690
690
|
|
|
691
691
|
parser = argparse.ArgumentParser(description='Introducing main parameters...')
|
|
@@ -1,5 +1,5 @@
|
|
|
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) - September 20, 2024
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
import time
|
|
@@ -1314,8 +1314,8 @@ def NetworkCycles(mTEPES, pIndLogConsole):
|
|
|
1314
1314
|
pUniqueCircuits = pUniqueCircuits[pUniqueCircuits['0/1'] == 1]
|
|
1315
1315
|
|
|
1316
1316
|
# unique and parallel circuits of existing lines
|
|
1317
|
-
mTEPES.ucte = Set(
|
|
1318
|
-
mTEPES.pct = Set(
|
|
1317
|
+
mTEPES.ucte = Set(doc='unique circuits', initialize=[lea for lea in mTEPES.lea if lea in pUniqueCircuits['0/1' ]])
|
|
1318
|
+
mTEPES.pct = Set(doc='parallel circuits', initialize=[br for br in mTEPES.br if br in pNoCircuits['No.Circuits']])
|
|
1319
1319
|
mTEPES.cye = RangeSet(0,len(mTEPES.nce)-1)
|
|
1320
1320
|
|
|
1321
1321
|
# graph with all AC existing and candidate lines
|
|
@@ -1339,10 +1339,10 @@ def NetworkCycles(mTEPES, pIndLogConsole):
|
|
|
1339
1339
|
pUniqueCircuits = pUniqueCircuits[pUniqueCircuits['0/1'] == 1]
|
|
1340
1340
|
|
|
1341
1341
|
# unique and parallel circuits of candidate lines
|
|
1342
|
-
mTEPES.uctc = Set(
|
|
1342
|
+
mTEPES.uctc = Set(doc='unique circuits', initialize=[laa for laa in mTEPES.laa if laa in pUniqueCircuits['0/1']])
|
|
1343
1343
|
mTEPES.cyc = RangeSet(0,len(mTEPES.ncd)-1)
|
|
1344
1344
|
# candidate lines included in every cycle
|
|
1345
|
-
mTEPES.lcac = Set(
|
|
1345
|
+
mTEPES.lcac = Set(doc='AC candidate circuits in a cycle', initialize=[(cyc,ni,nf,cc) for cyc,ni,nf,cc in mTEPES.cyc*mTEPES.lca if (ni,nf) in list(zip(mTEPES.ncd[cyc], mTEPES.ncd[cyc][1:] + mTEPES.ncd[cyc][:1])) or (nf,ni) in list(zip(mTEPES.ncd[cyc], mTEPES.ncd[cyc][1:] + mTEPES.ncd[cyc][:1]))])
|
|
1346
1346
|
|
|
1347
1347
|
pBigMTheta = pd.DataFrame(0, index=pd.MultiIndex.from_tuples(mTEPES.cyc*mTEPES.lca, names=('No.Cycle', 'NodeI', 'NodeF', 'Circuit')), columns=['rad'])
|
|
1348
1348
|
# for cyc,nii,nff,ccc in mTEPES.cyc*mTEPES.lca:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: openTEPES
|
|
3
|
-
Version: 4.17.
|
|
3
|
+
Version: 4.17.7
|
|
4
4
|
Summary: Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES)
|
|
5
5
|
Home-page: https://pascua.iit.comillas.edu/aramos/openTEPES/index.html
|
|
6
6
|
Author: IIT-EnergySystemModels
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
openTEPES/__init__.py,sha256=
|
|
1
|
+
openTEPES/__init__.py,sha256=938AmMocR2j63IXr6PG95ry5yb9aIe3vQE-PvgoNxTk,832
|
|
2
2
|
openTEPES/openTEPES.mapbox_token,sha256=xsXNkwGp2vzXqQy2zVkyLhhNcNWniK2BMeOFpc5SZHI,93
|
|
3
|
-
openTEPES/openTEPES.py,sha256=
|
|
4
|
-
openTEPES/openTEPES_InputData.py,sha256=
|
|
5
|
-
openTEPES/openTEPES_Main.py,sha256=
|
|
6
|
-
openTEPES/openTEPES_ModelFormulation.py,sha256=
|
|
3
|
+
openTEPES/openTEPES.py,sha256=mvGSFlwWdJqhw7OVuYWR9vAwkPjxO9Xs6UnKMC13wGs,20802
|
|
4
|
+
openTEPES/openTEPES_InputData.py,sha256=F4bJrJJgNeM7lCuwpAigEP9vhyelUYTl9I_PBF1xHVc,207974
|
|
5
|
+
openTEPES/openTEPES_Main.py,sha256=UomHmuMZt0IrshRxaLIiTiQTCwr-tnwC3L9r82MSFXY,39840
|
|
6
|
+
openTEPES/openTEPES_ModelFormulation.py,sha256=QUHA39lNxb6Wfrg23lJ84dcEIrDLRwuErKMiHOM6q98,112645
|
|
7
7
|
openTEPES/openTEPES_OutputResults.py,sha256=W_oEYQb0L2EYFhbVlMldzXP214mJe6lggzAahrJnYtA,203163
|
|
8
8
|
openTEPES/openTEPES_ProblemSolving.py,sha256=wsFwr3gyH9vdNHstV7RwB-NRZrtftTBfXzuFf7zEg90,14722
|
|
9
9
|
openTEPES/openTEPES_gitinfo.py,sha256=6fA1fa-JcyusSc_HcjPiCgnV9zn-fZwdG-kK0a5Fxc8,2004
|
|
@@ -335,8 +335,8 @@ openTEPES/sSEP/oT_Dict_Storage_sSEP.csv,sha256=H2rJXZvoMuT-25sI2GpG8IuiNKD-dxuty
|
|
|
335
335
|
openTEPES/sSEP/oT_Dict_Technology_sSEP.csv,sha256=MCTpplzz7_eVPKQfOw35c86ib6CTtW6UK6JrbCJ8wls,170
|
|
336
336
|
openTEPES/sSEP/oT_Dict_ZoneToArea_sSEP.csv,sha256=AUDCs5Bg6sw9f2pVjGP1o4IJjXFF_VrokOGf_V3QsEI,24
|
|
337
337
|
openTEPES/sSEP/oT_Dict_Zone_sSEP.csv,sha256=TBud-fvbFbiAsuutxTYe8wWlv_x1P8oyWXILMpYiXJc,13
|
|
338
|
-
opentepes-4.17.
|
|
339
|
-
opentepes-4.17.
|
|
340
|
-
opentepes-4.17.
|
|
341
|
-
opentepes-4.17.
|
|
342
|
-
opentepes-4.17.
|
|
338
|
+
opentepes-4.17.7.dist-info/entry_points.txt,sha256=gNNPrDaTsRuRJXI1FLNgqMX1CiJ45bEp1dEDH7ZB8Oc,49
|
|
339
|
+
opentepes-4.17.7.dist-info/LICENSE,sha256=4O7bphXVzRuYavtsWzpLGuM3E-fp3HTRna7F4yIfnS4,35184
|
|
340
|
+
opentepes-4.17.7.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
|
|
341
|
+
opentepes-4.17.7.dist-info/METADATA,sha256=n9mjU9Av6PJ7Isq3VCcxz22D_uTYxPn1F2YIvN9-VQA,17808
|
|
342
|
+
opentepes-4.17.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|