-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExponential_projection_analysis.py
More file actions
98 lines (66 loc) · 3.21 KB
/
Copy pathExponential_projection_analysis.py
File metadata and controls
98 lines (66 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
from CapExpModel import capacity_expansion
import os, json
import numpy as np
import os
# Script that optimizes regional infrastructure for all six cases assuming an exponential projection for the flow and load projections
basepath = "CapExpParams.json" # use for running the script in jupyter notebook
fp = os.path.join(os.getcwd(),basepath)
params = json.load(open(fp))
# Initialize parameters
params["projected_flow_assumption"]= "exponential"
params["seasonal_regulation"] = True
params["sensitivity_analysis"] = False
params["update_figures"] = False
# Set parameters
params["trading_market_year"] = 0
params["unfix_infrastructure_year"] = 0
params["marginal_cost_analysis"] = False
for staged_scenario in ["Non_Staged", "Staged"]:
if staged_scenario == "Non_Staged":
params["staged_infrastructure"]= False
params["version_num"] = 'Exponential_projection_NS'
elif staged_scenario == "Staged":
params["staged_infrastructure"]= True
params["version_num"] = 'Exponential_projection_S'
# Case 1/2: Not coordinated
params["Constraint_tag"] = 'No_coordination'
## Assume no joint_infrastructure
params["joint_infrastructure"]= False
## Assume that there is no trading market
params["trading_market"] = False
params['figpath'] = 'Results/' + params['version_num'] + "/" + params["Constraint_tag"] + "/"
params['figpath_base'] = 'Results/' + params['version_num'] + "/" + params["Constraint_tag"] + "_"
if not os.path.exists(params['figpath']):
os.makedirs(params['figpath'])
m = capacity_expansion(params)
m.main()
print("completed staged and not coordinated optimization for run")
# Case 3/4: partially coordinated
params['Constraint_tag'] = 'Partial_coordination'
## Allow for only trading markets
params["joint_infrastructure"]= False
params["trading_market"] = True
## save the capex file path to read the capex results
params['figpath_capex'] = params['figpath']
params['figpath'] = 'Results/' + params['version_num'] + "/" + params["Constraint_tag"] + "/"
params['figpath_base'] = 'Results/' + params['version_num'] + "/" + params["Constraint_tag"] + "_"
params['figpath_opex_partial'] = params['figpath']
if not os.path.exists(params['figpath']):
os.makedirs(params['figpath'])
m = capacity_expansion(params)
m.main()
print("completed staged and partially coordinated optimization for run")
# Case 5/6: Fully coordinated
params['Constraint_tag'] = 'Full_coordination'
## Allow for only trading markets
params["joint_infrastructure"]= True
params["trading_market"] = True
## save the capex file path to read the capex results
params['figpath_capex'] = params['figpath']
params['figpath'] = 'Results/' + params['version_num'] + "/" + params["Constraint_tag"] + "/"
params['figpath_base'] = 'Results/' + params['version_num'] + "/" + params["Constraint_tag"] + "_"
if not os.path.exists(params['figpath']):
os.makedirs(params['figpath'])
m = capacity_expansion(params)
m.main()
print("completed staged and fully coordinated optimization for run")