openTEPES 4.17.5rc3__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/9n/oT_Data_RESEnergy_9n.csv +1 -1
- openTEPES/9n7y/oT_Data_Option_9n7y.csv +2 -2
- openTEPES/RTS-GMLC_6y/oT_Dict_AreaToRegion_RTS-GMLC_6y.csv +4 -4
- openTEPES/RTS-GMLC_6y/oT_Dict_Area_RTS-GMLC_6y.csv +4 -4
- openTEPES/RTS-GMLC_6y/oT_Dict_Circuit_RTS-GMLC_6y.csv +5 -5
- openTEPES/RTS-GMLC_6y/oT_Dict_Line_RTS-GMLC_6y.csv +3 -3
- openTEPES/RTS-GMLC_6y/oT_Dict_NodeToZone_RTS-GMLC_6y.csv +74 -74
- openTEPES/RTS-GMLC_6y/oT_Dict_Region_RTS-GMLC_6y.csv +2 -2
- openTEPES/RTS-GMLC_6y/oT_Dict_Scenario_RTS-GMLC_6y.csv +2 -2
- openTEPES/RTS-GMLC_6y/oT_Dict_Storage_RTS-GMLC_6y.csv +3 -3
- openTEPES/RTS-GMLC_6y/oT_Dict_Technology_RTS-GMLC_6y.csv +10 -10
- openTEPES/RTS-GMLC_6y/oT_Dict_ZoneToArea_RTS-GMLC_6y.csv +22 -22
- openTEPES/RTS-GMLC_6y/oT_Dict_Zone_RTS-GMLC_6y.csv +22 -22
- openTEPES/__init__.py +1 -1
- openTEPES/openTEPES.py +12 -12
- openTEPES/openTEPES_InputData.py +118 -115
- openTEPES/openTEPES_Main.py +2 -2
- openTEPES/openTEPES_ModelFormulation.py +6 -6
- openTEPES/openTEPES_OutputResults.py +2 -2
- openTEPES/openTEPES_gitinfo.py +68 -0
- {opentepes-4.17.5rc3.dist-info → opentepes-4.17.7.dist-info}/METADATA +2 -2
- {opentepes-4.17.5rc3.dist-info → opentepes-4.17.7.dist-info}/RECORD +25 -24
- {opentepes-4.17.5rc3.dist-info → opentepes-4.17.7.dist-info}/LICENSE +0 -0
- {opentepes-4.17.5rc3.dist-info → opentepes-4.17.7.dist-info}/WHEEL +0 -0
- {opentepes-4.17.5rc3.dist-info → opentepes-4.17.7.dist-info}/entry_points.txt +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
,,RESEnergy
|
|
2
2
|
2030,Area1,1000
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
,IndBinGenInvest,IndBinGenRetirement,IndBinRsrInvest,IndBinNetInvest,IndBinNetH2Invest,IndBinNetHeatInvest,IndBinGenOperat,IndBinNetLosses,IndBinLineCommit,IndBinSingleNode,IndBinGenRamps,IndBinGenMinTime
|
|
2
|
-
Options,0,0,0,0,0,0,0,1,0,0,0,0
|
|
1
|
+
,IndBinGenInvest,IndBinGenRetirement,IndBinRsrInvest,IndBinNetInvest,IndBinNetH2Invest,IndBinNetHeatInvest,IndBinGenOperat,IndBinNetLosses,IndBinLineCommit,IndBinSingleNode,IndBinGenRamps,IndBinGenMinTime
|
|
2
|
+
Options,0,0,0,0,0,0,0,1,0,0,0,0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Area,Region
|
|
2
|
-
Area_1,Region_1
|
|
3
|
-
Area_2,Region_1
|
|
4
|
-
Area_3,Region_1
|
|
1
|
+
Area,Region
|
|
2
|
+
Area_1,Region_1
|
|
3
|
+
Area_2,Region_1
|
|
4
|
+
Area_3,Region_1
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Area
|
|
2
|
-
Area_1
|
|
3
|
-
Area_2
|
|
4
|
-
Area_3
|
|
1
|
+
Area
|
|
2
|
+
Area_1
|
|
3
|
+
Area_2
|
|
4
|
+
Area_3
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
Circuit
|
|
2
|
-
eac1
|
|
3
|
-
eac2
|
|
4
|
-
eac3
|
|
5
|
-
eac4
|
|
1
|
+
Circuit
|
|
2
|
+
eac1
|
|
3
|
+
eac2
|
|
4
|
+
eac3
|
|
5
|
+
eac4
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
LineType
|
|
2
|
-
AC
|
|
3
|
-
DC
|
|
1
|
+
LineType
|
|
2
|
+
AC
|
|
3
|
+
DC
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
Node,Zone
|
|
2
|
-
Node_101,Zone_11
|
|
3
|
-
Node_102,Zone_12
|
|
4
|
-
Node_103,Zone_11
|
|
5
|
-
Node_104,Zone_11
|
|
6
|
-
Node_105,Zone_11
|
|
7
|
-
Node_106,Zone_12
|
|
8
|
-
Node_107,Zone_12
|
|
9
|
-
Node_108,Zone_12
|
|
10
|
-
Node_109,Zone_13
|
|
11
|
-
Node_110,Zone_13
|
|
12
|
-
Node_111,Zone_13
|
|
13
|
-
Node_112,Zone_13
|
|
14
|
-
Node_113,Zone_14
|
|
15
|
-
Node_114,Zone_16
|
|
16
|
-
Node_115,Zone_16
|
|
17
|
-
Node_116,Zone_16
|
|
18
|
-
Node_117,Zone_17
|
|
19
|
-
Node_118,Zone_17
|
|
20
|
-
Node_119,Zone_15
|
|
21
|
-
Node_120,Zone_15
|
|
22
|
-
Node_121,Zone_17
|
|
23
|
-
Node_122,Zone_17
|
|
24
|
-
Node_123,Zone_15
|
|
25
|
-
Node_124,Zone_16
|
|
26
|
-
Node_201,Zone_21
|
|
27
|
-
Node_202,Zone_22
|
|
28
|
-
Node_203,Zone_21
|
|
29
|
-
Node_204,Zone_21
|
|
30
|
-
Node_205,Zone_21
|
|
31
|
-
Node_206,Zone_22
|
|
32
|
-
Node_207,Zone_22
|
|
33
|
-
Node_208,Zone_22
|
|
34
|
-
Node_209,Zone_23
|
|
35
|
-
Node_210,Zone_23
|
|
36
|
-
Node_211,Zone_23
|
|
37
|
-
Node_212,Zone_23
|
|
38
|
-
Node_213,Zone_24
|
|
39
|
-
Node_214,Zone_26
|
|
40
|
-
Node_215,Zone_26
|
|
41
|
-
Node_216,Zone_26
|
|
42
|
-
Node_217,Zone_27
|
|
43
|
-
Node_218,Zone_27
|
|
44
|
-
Node_219,Zone_25
|
|
45
|
-
Node_220,Zone_25
|
|
46
|
-
Node_221,Zone_27
|
|
47
|
-
Node_222,Zone_27
|
|
48
|
-
Node_223,Zone_25
|
|
49
|
-
Node_224,Zone_26
|
|
50
|
-
Node_301,Zone_31
|
|
51
|
-
Node_302,Zone_32
|
|
52
|
-
Node_303,Zone_31
|
|
53
|
-
Node_304,Zone_31
|
|
54
|
-
Node_305,Zone_31
|
|
55
|
-
Node_306,Zone_32
|
|
56
|
-
Node_307,Zone_32
|
|
57
|
-
Node_308,Zone_32
|
|
58
|
-
Node_309,Zone_33
|
|
59
|
-
Node_310,Zone_33
|
|
60
|
-
Node_311,Zone_33
|
|
61
|
-
Node_312,Zone_33
|
|
62
|
-
Node_313,Zone_34
|
|
63
|
-
Node_314,Zone_36
|
|
64
|
-
Node_315,Zone_36
|
|
65
|
-
Node_316,Zone_36
|
|
66
|
-
Node_317,Zone_37
|
|
67
|
-
Node_318,Zone_37
|
|
68
|
-
Node_319,Zone_35
|
|
69
|
-
Node_320,Zone_35
|
|
70
|
-
Node_321,Zone_37
|
|
71
|
-
Node_322,Zone_37
|
|
72
|
-
Node_323,Zone_35
|
|
73
|
-
Node_324,Zone_36
|
|
74
|
-
Node_325,Zone_35
|
|
1
|
+
Node,Zone
|
|
2
|
+
Node_101,Zone_11
|
|
3
|
+
Node_102,Zone_12
|
|
4
|
+
Node_103,Zone_11
|
|
5
|
+
Node_104,Zone_11
|
|
6
|
+
Node_105,Zone_11
|
|
7
|
+
Node_106,Zone_12
|
|
8
|
+
Node_107,Zone_12
|
|
9
|
+
Node_108,Zone_12
|
|
10
|
+
Node_109,Zone_13
|
|
11
|
+
Node_110,Zone_13
|
|
12
|
+
Node_111,Zone_13
|
|
13
|
+
Node_112,Zone_13
|
|
14
|
+
Node_113,Zone_14
|
|
15
|
+
Node_114,Zone_16
|
|
16
|
+
Node_115,Zone_16
|
|
17
|
+
Node_116,Zone_16
|
|
18
|
+
Node_117,Zone_17
|
|
19
|
+
Node_118,Zone_17
|
|
20
|
+
Node_119,Zone_15
|
|
21
|
+
Node_120,Zone_15
|
|
22
|
+
Node_121,Zone_17
|
|
23
|
+
Node_122,Zone_17
|
|
24
|
+
Node_123,Zone_15
|
|
25
|
+
Node_124,Zone_16
|
|
26
|
+
Node_201,Zone_21
|
|
27
|
+
Node_202,Zone_22
|
|
28
|
+
Node_203,Zone_21
|
|
29
|
+
Node_204,Zone_21
|
|
30
|
+
Node_205,Zone_21
|
|
31
|
+
Node_206,Zone_22
|
|
32
|
+
Node_207,Zone_22
|
|
33
|
+
Node_208,Zone_22
|
|
34
|
+
Node_209,Zone_23
|
|
35
|
+
Node_210,Zone_23
|
|
36
|
+
Node_211,Zone_23
|
|
37
|
+
Node_212,Zone_23
|
|
38
|
+
Node_213,Zone_24
|
|
39
|
+
Node_214,Zone_26
|
|
40
|
+
Node_215,Zone_26
|
|
41
|
+
Node_216,Zone_26
|
|
42
|
+
Node_217,Zone_27
|
|
43
|
+
Node_218,Zone_27
|
|
44
|
+
Node_219,Zone_25
|
|
45
|
+
Node_220,Zone_25
|
|
46
|
+
Node_221,Zone_27
|
|
47
|
+
Node_222,Zone_27
|
|
48
|
+
Node_223,Zone_25
|
|
49
|
+
Node_224,Zone_26
|
|
50
|
+
Node_301,Zone_31
|
|
51
|
+
Node_302,Zone_32
|
|
52
|
+
Node_303,Zone_31
|
|
53
|
+
Node_304,Zone_31
|
|
54
|
+
Node_305,Zone_31
|
|
55
|
+
Node_306,Zone_32
|
|
56
|
+
Node_307,Zone_32
|
|
57
|
+
Node_308,Zone_32
|
|
58
|
+
Node_309,Zone_33
|
|
59
|
+
Node_310,Zone_33
|
|
60
|
+
Node_311,Zone_33
|
|
61
|
+
Node_312,Zone_33
|
|
62
|
+
Node_313,Zone_34
|
|
63
|
+
Node_314,Zone_36
|
|
64
|
+
Node_315,Zone_36
|
|
65
|
+
Node_316,Zone_36
|
|
66
|
+
Node_317,Zone_37
|
|
67
|
+
Node_318,Zone_37
|
|
68
|
+
Node_319,Zone_35
|
|
69
|
+
Node_320,Zone_35
|
|
70
|
+
Node_321,Zone_37
|
|
71
|
+
Node_322,Zone_37
|
|
72
|
+
Node_323,Zone_35
|
|
73
|
+
Node_324,Zone_36
|
|
74
|
+
Node_325,Zone_35
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Region
|
|
2
|
-
Region_1
|
|
1
|
+
Region
|
|
2
|
+
Region_1
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Scenario
|
|
2
|
-
sc01
|
|
1
|
+
Scenario
|
|
2
|
+
sc01
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
StorageType
|
|
2
|
-
Daily
|
|
3
|
-
Weekly
|
|
1
|
+
StorageType
|
|
2
|
+
Daily
|
|
3
|
+
Weekly
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
Technology
|
|
2
|
-
Oil
|
|
3
|
-
Coal
|
|
4
|
-
NG
|
|
5
|
-
Sync_Cond
|
|
6
|
-
Nuclear
|
|
7
|
-
Hydro
|
|
8
|
-
Solar
|
|
9
|
-
Wind
|
|
10
|
-
Storage
|
|
1
|
+
Technology
|
|
2
|
+
Oil
|
|
3
|
+
Coal
|
|
4
|
+
NG
|
|
5
|
+
Sync_Cond
|
|
6
|
+
Nuclear
|
|
7
|
+
Hydro
|
|
8
|
+
Solar
|
|
9
|
+
Wind
|
|
10
|
+
Storage
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
Zone,Area
|
|
2
|
-
Zone_11,Area_1
|
|
3
|
-
Zone_12,Area_1
|
|
4
|
-
Zone_13,Area_1
|
|
5
|
-
Zone_14,Area_1
|
|
6
|
-
Zone_16,Area_1
|
|
7
|
-
Zone_17,Area_1
|
|
8
|
-
Zone_15,Area_1
|
|
9
|
-
Zone_21,Area_2
|
|
10
|
-
Zone_22,Area_2
|
|
11
|
-
Zone_23,Area_2
|
|
12
|
-
Zone_24,Area_2
|
|
13
|
-
Zone_26,Area_2
|
|
14
|
-
Zone_27,Area_2
|
|
15
|
-
Zone_25,Area_2
|
|
16
|
-
Zone_31,Area_3
|
|
17
|
-
Zone_32,Area_3
|
|
18
|
-
Zone_33,Area_3
|
|
19
|
-
Zone_34,Area_3
|
|
20
|
-
Zone_36,Area_3
|
|
21
|
-
Zone_37,Area_3
|
|
22
|
-
Zone_35,Area_3
|
|
1
|
+
Zone,Area
|
|
2
|
+
Zone_11,Area_1
|
|
3
|
+
Zone_12,Area_1
|
|
4
|
+
Zone_13,Area_1
|
|
5
|
+
Zone_14,Area_1
|
|
6
|
+
Zone_16,Area_1
|
|
7
|
+
Zone_17,Area_1
|
|
8
|
+
Zone_15,Area_1
|
|
9
|
+
Zone_21,Area_2
|
|
10
|
+
Zone_22,Area_2
|
|
11
|
+
Zone_23,Area_2
|
|
12
|
+
Zone_24,Area_2
|
|
13
|
+
Zone_26,Area_2
|
|
14
|
+
Zone_27,Area_2
|
|
15
|
+
Zone_25,Area_2
|
|
16
|
+
Zone_31,Area_3
|
|
17
|
+
Zone_32,Area_3
|
|
18
|
+
Zone_33,Area_3
|
|
19
|
+
Zone_34,Area_3
|
|
20
|
+
Zone_36,Area_3
|
|
21
|
+
Zone_37,Area_3
|
|
22
|
+
Zone_35,Area_3
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
Zone
|
|
2
|
-
Zone_11
|
|
3
|
-
Zone_12
|
|
4
|
-
Zone_13
|
|
5
|
-
Zone_14
|
|
6
|
-
Zone_16
|
|
7
|
-
Zone_17
|
|
8
|
-
Zone_15
|
|
9
|
-
Zone_21
|
|
10
|
-
Zone_22
|
|
11
|
-
Zone_23
|
|
12
|
-
Zone_24
|
|
13
|
-
Zone_26
|
|
14
|
-
Zone_27
|
|
15
|
-
Zone_25
|
|
16
|
-
Zone_31
|
|
17
|
-
Zone_32
|
|
18
|
-
Zone_33
|
|
19
|
-
Zone_34
|
|
20
|
-
Zone_36
|
|
21
|
-
Zone_37
|
|
22
|
-
Zone_35
|
|
1
|
+
Zone
|
|
2
|
+
Zone_11
|
|
3
|
+
Zone_12
|
|
4
|
+
Zone_13
|
|
5
|
+
Zone_14
|
|
6
|
+
Zone_16
|
|
7
|
+
Zone_17
|
|
8
|
+
Zone_15
|
|
9
|
+
Zone_21
|
|
10
|
+
Zone_22
|
|
11
|
+
Zone_23
|
|
12
|
+
Zone_24
|
|
13
|
+
Zone_26
|
|
14
|
+
Zone_27
|
|
15
|
+
Zone_25
|
|
16
|
+
Zone_31
|
|
17
|
+
Zone_32
|
|
18
|
+
Zone_33
|
|
19
|
+
Zone_34
|
|
20
|
+
Zone_36
|
|
21
|
+
Zone_37
|
|
22
|
+
Zone_35
|
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) -
|
|
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,29 +814,27 @@ 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
|
-
|
|
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])
|
|
822
822
|
|
|
823
|
-
mTEPES.z2g
|
|
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)
|
|
823
|
+
# mTEPES.z2g = Set(initialize = [(zn,g) for zn,g in mTEPES.zn*mTEPES.g if (zn,g) in pZone2Gen])
|
|
826
824
|
|
|
827
825
|
#%% inverse index generator to technology
|
|
828
826
|
pTechnologyToGen = pGenToTechnology.reset_index().set_index('Technology').set_axis(['Generator'], axis=1)[['Generator']]
|
|
829
827
|
pTechnologyToGen = pTechnologyToGen.loc[pTechnologyToGen['Generator'].isin(mTEPES.g)].reset_index().set_index(['Technology', 'Generator'])
|
|
830
828
|
|
|
831
|
-
mTEPES.t2g = Set(initialize=pTechnologyToGen.index,
|
|
829
|
+
mTEPES.t2g = Set(initialize=pTechnologyToGen.index, doc='technology to generator')
|
|
832
830
|
|
|
833
831
|
# ESS and RES technologies
|
|
834
832
|
def Create_ESS_RES_Sets(mTEPES) -> None:
|
|
835
|
-
mTEPES.ot = Set(
|
|
836
|
-
mTEPES.ht = Set(
|
|
837
|
-
mTEPES.et = Set(
|
|
838
|
-
mTEPES.rt = Set(
|
|
839
|
-
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)])
|
|
840
838
|
|
|
841
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)])
|
|
842
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)])
|
|
@@ -857,7 +855,7 @@ def InputData(DirName, CaseName, mTEPES, pIndLogConsole):
|
|
|
857
855
|
pExclusiveGenToGen = pGenToExclusiveGen.reset_index().set_index('MutuallyExclusive').set_axis(['Generator'], axis=1)[['Generator']]
|
|
858
856
|
pExclusiveGenToGen = pExclusiveGenToGen.loc[pExclusiveGenToGen['Generator'].isin(mTEPES.g)].reset_index().set_index(['MutuallyExclusive', 'Generator'])
|
|
859
857
|
|
|
860
|
-
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])
|
|
861
859
|
|
|
862
860
|
# minimum and maximum variable power, charge, and storage capacity
|
|
863
861
|
pMinPowerElec = pVariableMinPowerElec.replace(0.0, pRatedMinPowerElec)
|
|
@@ -1237,6 +1235,11 @@ def InputData(DirName, CaseName, mTEPES, pIndLogConsole):
|
|
|
1237
1235
|
pStartUpCost.update (pd.Series([0.0 for nr in mTEPES.nr if pStartUpCost [nr] < pEpsilon], index=[nr for nr in mTEPES.nr if pStartUpCost [nr] < pEpsilon]))
|
|
1238
1236
|
pShutDownCost.update (pd.Series([0.0 for nr in mTEPES.nr if pShutDownCost [nr] < pEpsilon], index=[nr for nr in mTEPES.nr if pShutDownCost [nr] < pEpsilon]))
|
|
1239
1237
|
|
|
1238
|
+
# this rated linear variable cost y going to be used to order the generating units
|
|
1239
|
+
# we include a small term to avoid stochastic behavior due to equal values
|
|
1240
|
+
for g in mTEPES.g:
|
|
1241
|
+
pRatedLinearVarCost[g] += 1e-3*pEpsilon*mTEPES.g.ord(g)
|
|
1242
|
+
|
|
1240
1243
|
# BigM maximum flow to be used in the Kirchhoff's 2nd law disjunctive constraint
|
|
1241
1244
|
pBigMFlowBck = pLineNTCBck*0.0
|
|
1242
1245
|
pBigMFlowFrw = pLineNTCFrw*0.0
|
|
@@ -1983,19 +1986,19 @@ def SettingUpVariables(OptModel, mTEPES):
|
|
|
1983
1986
|
nFixedVariables += nFixedGeneratorCommits
|
|
1984
1987
|
# thermal and RES units ordered by increasing variable operation cost, excluding reactive generating units
|
|
1985
1988
|
if len(mTEPES.tq):
|
|
1986
|
-
mTEPES.go = [
|
|
1989
|
+
mTEPES.go = Set(initialize=[g for g in sorted(mTEPES.pRatedLinearVarCost, key=mTEPES.pRatedLinearVarCost.__getitem__) if g not in mTEPES.sq])
|
|
1987
1990
|
else:
|
|
1988
|
-
mTEPES.go = [
|
|
1991
|
+
mTEPES.go = Set(initialize=[g for g in sorted(mTEPES.pRatedLinearVarCost, key=mTEPES.pRatedLinearVarCost.__getitem__) if g not in mTEPES.eh])
|
|
1989
1992
|
|
|
1990
1993
|
for p,sc,st in mTEPES.ps*mTEPES.stt:
|
|
1991
1994
|
# activate only period, scenario, and load levels to formulate
|
|
1992
1995
|
mTEPES.del_component(mTEPES.st)
|
|
1993
1996
|
mTEPES.del_component(mTEPES.n )
|
|
1994
|
-
mTEPES.st = Set(
|
|
1995
|
-
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 ])
|
|
1996
1999
|
|
|
1997
2000
|
if len(mTEPES.n):
|
|
1998
|
-
mTEPES.psn1 = Set(initialize=[(p,
|
|
2001
|
+
mTEPES.psn1 = Set(initialize=[(p,sc,n) for p,sc,n in mTEPES.ps*mTEPES.n])
|
|
1999
2002
|
# determine the first load level of each stage
|
|
2000
2003
|
n1 = next(iter(mTEPES.psn1))
|
|
2001
2004
|
# commit the units and their output at the first load level of each stage
|
|
@@ -2016,7 +2019,7 @@ def SettingUpVariables(OptModel, mTEPES):
|
|
|
2016
2019
|
else:
|
|
2017
2020
|
mTEPES.pInitialOutput[n1,go] = mTEPES.pMinPowerElec[n1,go]
|
|
2018
2021
|
mTEPES.pInitialUC[n1,go] = 1
|
|
2019
|
-
pSystemOutput
|
|
2022
|
+
pSystemOutput += mTEPES.pInitialOutput[n1,go]()
|
|
2020
2023
|
|
|
2021
2024
|
# determine the initial committed lines
|
|
2022
2025
|
for la in mTEPES.la:
|
|
@@ -2040,8 +2043,8 @@ def SettingUpVariables(OptModel, mTEPES):
|
|
|
2040
2043
|
# activate all the periods, scenarios, and load levels again
|
|
2041
2044
|
mTEPES.del_component(mTEPES.st)
|
|
2042
2045
|
mTEPES.del_component(mTEPES.n )
|
|
2043
|
-
mTEPES.st = Set(
|
|
2044
|
-
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)])
|
|
2045
2048
|
|
|
2046
2049
|
# fixing the ESS inventory at the end of the following pStorageTimeStep (daily, weekly, monthly) if between storage limits, i.e.,
|
|
2047
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
|
|
@@ -2118,21 +2121,21 @@ def SettingUpVariables(OptModel, mTEPES):
|
|
|
2118
2121
|
# fixing the ENS in nodes with no demand
|
|
2119
2122
|
for p,sc,n,nd in mTEPES.psnnd:
|
|
2120
2123
|
if mTEPES.pDemandElec[p,sc,n,nd] == 0.0:
|
|
2121
|
-
OptModel.vENS[p,sc,n,nd].fix(0.0)
|
|
2124
|
+
OptModel.vENS [p,sc,n,nd].fix(0.0)
|
|
2122
2125
|
nFixedVariables += 1
|
|
2123
2126
|
|
|
2124
2127
|
if mTEPES.pIndHydrogen == 1:
|
|
2125
2128
|
# fixing the H2 ENS in nodes with no hydrogen demand
|
|
2126
2129
|
for p,sc,n,nd in mTEPES.psnnd:
|
|
2127
|
-
if mTEPES.pDemandH2[p,sc,n,nd] ==
|
|
2128
|
-
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)
|
|
2129
2132
|
nFixedVariables += 1
|
|
2130
2133
|
|
|
2131
2134
|
if mTEPES.pIndHeat == 1:
|
|
2132
2135
|
# fixing the heat ENS in nodes with no heat demand
|
|
2133
2136
|
for p,sc,n,nd in mTEPES.psnnd:
|
|
2134
|
-
if mTEPES.pDemandHeat[p,sc,n,nd] ==
|
|
2135
|
-
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)
|
|
2136
2139
|
nFixedVariables += 1
|
|
2137
2140
|
def AvoidForbiddenInstallationsAndRetirements(mTEPES, OptModel) -> int:
|
|
2138
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
|
|
@@ -1056,7 +1056,7 @@ def GenerationOperationModelFormulationRampMinTime(OptModel, mTEPES, pIndLogCons
|
|
|
1056
1056
|
if pIndLogConsole == 1:
|
|
1057
1057
|
print('eRampDwChr ... ', len(getattr(OptModel, 'eRampDwChr_'+str(p)+'_'+str(sc)+'_'+str(st))), ' rows')
|
|
1058
1058
|
|
|
1059
|
-
# the small tolerance pEpsilon=
|
|
1059
|
+
# the small tolerance pEpsilon=5e-2 is added to detect if the generator is ramping up/down
|
|
1060
1060
|
pEpsilon = 5e-2
|
|
1061
1061
|
def eRampUpState(OptModel,n,nr):
|
|
1062
1062
|
if (p,nr) in mTEPES.pnr:
|
|
@@ -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,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 12, 2024
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
import time
|
|
@@ -1592,7 +1592,7 @@ def MarginalResults(DirName, CaseName, OptModel, mTEPES, pIndPlotOutput):
|
|
|
1592
1592
|
pEpsilon = 1e-6
|
|
1593
1593
|
|
|
1594
1594
|
#%% outputting the incremental variable cost of each generating unit (neither ESS nor boilers) with power surplus
|
|
1595
|
-
sPSNG = [(p,sc,n,g) for p,sc,n,g in mTEPES.psng if g not in mTEPES.
|
|
1595
|
+
sPSNG = [(p,sc,n,g) for p,sc,n,g in mTEPES.psng if g not in mTEPES.eh and g not in mTEPES.bo]
|
|
1596
1596
|
OutputToFile = pd.Series(data=[(mTEPES.pLinearVarCost[p,sc,n,g]+mTEPES.pEmissionVarCost[p,sc,n,g]) if OptModel.vTotalOutput[p,sc,n,g].ub - OptModel.vTotalOutput[p,sc,n,g]() > pEpsilon else math.inf for p,sc,n,g in sPSNG], index=pd.Index(sPSNG))
|
|
1597
1597
|
OutputToFile *= 1e3
|
|
1598
1598
|
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import subprocess
|
|
2
|
+
import shlex
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def cmd(cmd, cwd=ROOT_DIR) -> str:
|
|
9
|
+
"""
|
|
10
|
+
Executes a shell command in a subprocess and returns its output as a string.
|
|
11
|
+
|
|
12
|
+
Args:
|
|
13
|
+
cmd (str): The shell command to execute.
|
|
14
|
+
cwd (str): The directory where the command should be executed. Defaults to ROOT_DIR.
|
|
15
|
+
|
|
16
|
+
Returns:
|
|
17
|
+
str: The output of the command, decoded to a string and stripped of trailing whitespace.
|
|
18
|
+
If the command fails, an empty string is returned.
|
|
19
|
+
"""
|
|
20
|
+
output = ""
|
|
21
|
+
try:
|
|
22
|
+
output = (
|
|
23
|
+
subprocess.check_output(shlex.split(cmd), cwd=cwd, stderr=subprocess.STDOUT)
|
|
24
|
+
.decode()
|
|
25
|
+
.strip()
|
|
26
|
+
)
|
|
27
|
+
except Exception as _:
|
|
28
|
+
...
|
|
29
|
+
return output
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def last_commit_id(cwd=ROOT_DIR) -> str:
|
|
33
|
+
"""
|
|
34
|
+
Retrieves the last Git commit ID for the given folder.
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
cwd (str): The directory where the Git command should be executed. Defaults to ROOT_DIR.
|
|
38
|
+
|
|
39
|
+
Returns:
|
|
40
|
+
str: The Git commit ID, or a string indicating if the working tree is dirty.
|
|
41
|
+
"""
|
|
42
|
+
return cmd("git describe --always --dirty", cwd=cwd)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def branch(cwd=ROOT_DIR) -> str:
|
|
46
|
+
"""
|
|
47
|
+
Retrieves the current Git branch name for the given folder.
|
|
48
|
+
|
|
49
|
+
Args:
|
|
50
|
+
cwd (str): The directory where the Git command should be executed. Defaults to ROOT_DIR.
|
|
51
|
+
|
|
52
|
+
Returns:
|
|
53
|
+
str: The current Git branch name.
|
|
54
|
+
"""
|
|
55
|
+
return cmd("git rev-parse --abbrev-ref HEAD", cwd=cwd)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def get_git_version(cwd=ROOT_DIR) -> str:
|
|
59
|
+
"""
|
|
60
|
+
Constructs the Git version string by combining the last commit ID and the current branch name.
|
|
61
|
+
|
|
62
|
+
Args:
|
|
63
|
+
cwd (str): The directory where the Git commands should be executed. Defaults to ROOT_DIR.
|
|
64
|
+
|
|
65
|
+
Returns:
|
|
66
|
+
str: A string in the format "<commit_id>-<branch_name>".
|
|
67
|
+
"""
|
|
68
|
+
return f"{last_commit_id(cwd)}-{branch(cwd)}"
|
|
@@ -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
|
|
@@ -25,7 +25,7 @@ Requires-Dist: networkx>=3.3
|
|
|
25
25
|
Requires-Dist: dill>=0.3.8
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
.. image:: https://
|
|
28
|
+
.. image:: https://pascua.iit.comillas.edu/aramos/openTEPES.png
|
|
29
29
|
:target: https://pascua.iit.comillas.edu/aramos/openTEPES/index.html
|
|
30
30
|
:alt: logo
|
|
31
31
|
:align: center
|
|
@@ -1,11 +1,12 @@
|
|
|
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=
|
|
7
|
-
openTEPES/openTEPES_OutputResults.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
|
+
openTEPES/openTEPES_OutputResults.py,sha256=W_oEYQb0L2EYFhbVlMldzXP214mJe6lggzAahrJnYtA,203163
|
|
8
8
|
openTEPES/openTEPES_ProblemSolving.py,sha256=wsFwr3gyH9vdNHstV7RwB-NRZrtftTBfXzuFf7zEg90,14722
|
|
9
|
+
openTEPES/openTEPES_gitinfo.py,sha256=6fA1fa-JcyusSc_HcjPiCgnV9zn-fZwdG-kK0a5Fxc8,2004
|
|
9
10
|
openTEPES/.idea/.name,sha256=jiwfcnJ20wztcvpny4SHcqmAIWK-w5tCqN9TWf0GOkw,11
|
|
10
11
|
openTEPES/.idea/misc.xml,sha256=m4-3O284ZBS8WZSQD0QWwk8YjuQYz92w6kr7NRFNips,298
|
|
11
12
|
openTEPES/.idea/modules.xml,sha256=5XBWcjJ2MnJMJeZH6rMyzJfsThRQB2HhldeHDHucbJU,277
|
|
@@ -27,7 +28,7 @@ openTEPES/9n/oT_Data_OperatingReserveUp_9n.csv,sha256=Db0lWL63oSGsdsXYDSveQYMgij
|
|
|
27
28
|
openTEPES/9n/oT_Data_Option_9n.csv,sha256=ouGUVLRYbiqW38CbrNdfvmNiD34tLsyS0e0ft-xMVBo,239
|
|
28
29
|
openTEPES/9n/oT_Data_Parameter_9n.csv,sha256=x3vVs9nElSFcTvVKCmolzhyLlMWdJOEZbM6sJs18k8o,232
|
|
29
30
|
openTEPES/9n/oT_Data_Period_9n.csv,sha256=esleipBmJEKh_pPnwqfJXMy_BWFJBe88iofCBLQxnCE,20
|
|
30
|
-
openTEPES/9n/oT_Data_RESEnergy_9n.csv,sha256=
|
|
31
|
+
openTEPES/9n/oT_Data_RESEnergy_9n.csv,sha256=XubGaoy8_52hEl4MmB7_bPA4bC8cwqvrLq_cPIUyWGw,30
|
|
31
32
|
openTEPES/9n/oT_Data_ReserveMargin_9n.csv,sha256=5JYaMv-OSdi4WoWSSEkn6nBPUye9QxXOqOXSm2xrJN8,36
|
|
32
33
|
openTEPES/9n/oT_Data_Scenario_9n.csv,sha256=G-kidq9YmyCLTWKr9wnc4vTz-2EXvnDtoVQ7Xe_0fkU,31
|
|
33
34
|
openTEPES/9n/oT_Data_Stage_9n.csv,sha256=vHegWdEnTMu6EU__n3GoC7sY8dPlNJkD9maimbo1aGc,19
|
|
@@ -68,7 +69,7 @@ openTEPES/9n7y/oT_Data_Network_9n7y.csv,sha256=DeA_ywWHvwJ320cHWfypHqwCUjoH6HeF0
|
|
|
68
69
|
openTEPES/9n7y/oT_Data_NodeLocation_9n7y.csv,sha256=muevfA9X-kL3l45Fre5Y4Jv0iH3Gj6vq6qHh4uoqjbA,299
|
|
69
70
|
openTEPES/9n7y/oT_Data_OperatingReserveDown_9n7y.csv,sha256=Qn0_fW9Ly4mu4xw1XPfxcPJB4led4InaLYFXsUZ7cLs,2686680
|
|
70
71
|
openTEPES/9n7y/oT_Data_OperatingReserveUp_9n7y.csv,sha256=Qn0_fW9Ly4mu4xw1XPfxcPJB4led4InaLYFXsUZ7cLs,2686680
|
|
71
|
-
openTEPES/9n7y/oT_Data_Option_9n7y.csv,sha256=
|
|
72
|
+
openTEPES/9n7y/oT_Data_Option_9n7y.csv,sha256=Bwa2MiQJ7pk-GEsjaE1duZkZQEIlhW2BeSdZG1dk9sA,237
|
|
72
73
|
openTEPES/9n7y/oT_Data_Parameter_9n7y.csv,sha256=BSuKo6FXlJCiDRBtGbQIztLWIMfGXx9cwVFpSBQoXVk,232
|
|
73
74
|
openTEPES/9n7y/oT_Data_Period_9n7y.csv,sha256=CMeEXcbYvkerdb4L50rnrKA3DV5QmbGP6h1WmdJFacw,68
|
|
74
75
|
openTEPES/9n7y/oT_Data_RESEnergy_9n7y.csv,sha256=3sBOFBrRw6UiO8S2iQie5bR3aOC5xBgfYJhQucM--dI,187
|
|
@@ -217,22 +218,22 @@ openTEPES/RTS-GMLC_6y/oT_Data_VariableMinConsumption_RTS-GMLC_6y.csv,sha256=IOw8
|
|
|
217
218
|
openTEPES/RTS-GMLC_6y/oT_Data_VariableMinEnergy_RTS-GMLC_6y.csv,sha256=IOw8FCVppeD10zitucrAFYqpZmzJoF9jK2fvvJfPo0s,12582160
|
|
218
219
|
openTEPES/RTS-GMLC_6y/oT_Data_VariableMinGeneration_RTS-GMLC_6y.csv,sha256=IOw8FCVppeD10zitucrAFYqpZmzJoF9jK2fvvJfPo0s,12582160
|
|
219
220
|
openTEPES/RTS-GMLC_6y/oT_Data_VariableMinStorage_RTS-GMLC_6y.csv,sha256=IOw8FCVppeD10zitucrAFYqpZmzJoF9jK2fvvJfPo0s,12582160
|
|
220
|
-
openTEPES/RTS-GMLC_6y/oT_Dict_AreaToRegion_RTS-GMLC_6y.csv,sha256=
|
|
221
|
-
openTEPES/RTS-GMLC_6y/oT_Dict_Area_RTS-GMLC_6y.csv,sha256=
|
|
222
|
-
openTEPES/RTS-GMLC_6y/oT_Dict_Circuit_RTS-GMLC_6y.csv,sha256
|
|
221
|
+
openTEPES/RTS-GMLC_6y/oT_Dict_AreaToRegion_RTS-GMLC_6y.csv,sha256=eVY_4Mu1PTkNbvzIcqbYbpvT0rloVrphTB048YYDyvA,60
|
|
222
|
+
openTEPES/RTS-GMLC_6y/oT_Dict_Area_RTS-GMLC_6y.csv,sha256=6l13IVxPq4HJh6apld5lNtUPMerRRMgfK7odZxCpCb8,26
|
|
223
|
+
openTEPES/RTS-GMLC_6y/oT_Dict_Circuit_RTS-GMLC_6y.csv,sha256=YudHKDVQ2bpMRufOHYttfppzQEaqi2d3vRGmxTuMFdc,28
|
|
223
224
|
openTEPES/RTS-GMLC_6y/oT_Dict_Generation_RTS-GMLC_6y.csv,sha256=w6kE1V9QiFoihhMs43minFkyFWRzwQtWnSYsF96_7WA,2535
|
|
224
|
-
openTEPES/RTS-GMLC_6y/oT_Dict_Line_RTS-GMLC_6y.csv,sha256=
|
|
225
|
+
openTEPES/RTS-GMLC_6y/oT_Dict_Line_RTS-GMLC_6y.csv,sha256=rON9ZbWsiGauhkOIgBS3CDQosACOkKkJoORYT_fCGoc,15
|
|
225
226
|
openTEPES/RTS-GMLC_6y/oT_Dict_LoadLevel_RTS-GMLC_6y.csv,sha256=FNuj3oD4Npror74ru-HGnm3wD8rLhJFTu2u4jMUYJ4o,192203
|
|
226
|
-
openTEPES/RTS-GMLC_6y/oT_Dict_NodeToZone_RTS-GMLC_6y.csv,sha256=
|
|
227
|
+
openTEPES/RTS-GMLC_6y/oT_Dict_NodeToZone_RTS-GMLC_6y.csv,sha256=7bnlSu5HfA1ch_58touhcvhmrCLOEjjWhH7f5G8tONw,1251
|
|
227
228
|
openTEPES/RTS-GMLC_6y/oT_Dict_Node_RTS-GMLC_6y.csv,sha256=2YRl6OD1hV1lR8LiTN-PYjX8bW2v3BktmLVMRl8HW74,736
|
|
228
229
|
openTEPES/RTS-GMLC_6y/oT_Dict_Period_RTS-GMLC_6y.csv,sha256=Jp7qufLCOXwJ1kSCruPE64llGaTj4wVqe79u5H4LPKg,44
|
|
229
|
-
openTEPES/RTS-GMLC_6y/oT_Dict_Region_RTS-GMLC_6y.csv,sha256=
|
|
230
|
-
openTEPES/RTS-GMLC_6y/oT_Dict_Scenario_RTS-GMLC_6y.csv,sha256=
|
|
230
|
+
openTEPES/RTS-GMLC_6y/oT_Dict_Region_RTS-GMLC_6y.csv,sha256=9sUtX_OUST0EMWbhQG2bh7q4_CN0zrELH-ImI5OCAV4,16
|
|
231
|
+
openTEPES/RTS-GMLC_6y/oT_Dict_Scenario_RTS-GMLC_6y.csv,sha256=2ofsWknL6_xojAEk9w_ntKDc_iRFh1tY3MKWyKGlKBE,14
|
|
231
232
|
openTEPES/RTS-GMLC_6y/oT_Dict_Stage_RTS-GMLC_6y.csv,sha256=cZKl_y6qUHVS8cLY2EFYwGyb8Bzw8043XqkYZJhOOr0,76
|
|
232
|
-
openTEPES/RTS-GMLC_6y/oT_Dict_Storage_RTS-GMLC_6y.csv,sha256=
|
|
233
|
-
openTEPES/RTS-GMLC_6y/oT_Dict_Technology_RTS-GMLC_6y.csv,sha256=
|
|
234
|
-
openTEPES/RTS-GMLC_6y/oT_Dict_ZoneToArea_RTS-GMLC_6y.csv,sha256=
|
|
235
|
-
openTEPES/RTS-GMLC_6y/oT_Dict_Zone_RTS-GMLC_6y.csv,sha256=
|
|
233
|
+
openTEPES/RTS-GMLC_6y/oT_Dict_Storage_RTS-GMLC_6y.csv,sha256=1xK85kRhPuVmBJUjdT5jxma6pft_aX3AQ4RsJyU1kLs,25
|
|
234
|
+
openTEPES/RTS-GMLC_6y/oT_Dict_Technology_RTS-GMLC_6y.csv,sha256=OWIqvZzabgF1OxfFkk7tSRf8hRjdGUZBF7yMz7f8g9s,66
|
|
235
|
+
openTEPES/RTS-GMLC_6y/oT_Dict_ZoneToArea_RTS-GMLC_6y.csv,sha256=GAxPRWF3ZLQMYrZTLOxQpJq0EnLQBxG05HDL-P3GJUE,325
|
|
236
|
+
openTEPES/RTS-GMLC_6y/oT_Dict_Zone_RTS-GMLC_6y.csv,sha256=qdYPgz7RLrL4A2iiNEJ5pkXMPFpwIeLK5QOyAqJ11oQ,173
|
|
236
237
|
openTEPES/RTS24/oT_Data_Demand_RTS24.csv,sha256=HQ1US6fsd3iotXTlR6hpVxAy67forSUbxW8Fqzp8W0I,1824963
|
|
237
238
|
openTEPES/RTS24/oT_Data_Duration_RTS24.csv,sha256=uduXkV_fE7Vd9cNYdik14_b7NZgm5pqusoTAC6Z1Zo4,331987
|
|
238
239
|
openTEPES/RTS24/oT_Data_Emission_RTS24.csv,sha256=-CBlzyOIzCVs2LmAYLUwKfoRGxJMQXzmHVvcjMOOqEA,48
|
|
@@ -334,8 +335,8 @@ openTEPES/sSEP/oT_Dict_Storage_sSEP.csv,sha256=H2rJXZvoMuT-25sI2GpG8IuiNKD-dxuty
|
|
|
334
335
|
openTEPES/sSEP/oT_Dict_Technology_sSEP.csv,sha256=MCTpplzz7_eVPKQfOw35c86ib6CTtW6UK6JrbCJ8wls,170
|
|
335
336
|
openTEPES/sSEP/oT_Dict_ZoneToArea_sSEP.csv,sha256=AUDCs5Bg6sw9f2pVjGP1o4IJjXFF_VrokOGf_V3QsEI,24
|
|
336
337
|
openTEPES/sSEP/oT_Dict_Zone_sSEP.csv,sha256=TBud-fvbFbiAsuutxTYe8wWlv_x1P8oyWXILMpYiXJc,13
|
|
337
|
-
opentepes-4.17.
|
|
338
|
-
opentepes-4.17.
|
|
339
|
-
opentepes-4.17.
|
|
340
|
-
opentepes-4.17.
|
|
341
|
-
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
|