|
1 | | -install.packages('openxlsx') |
2 | | -library(rplexos) |
3 | | -plexos_open('//plexossql/data/moconnel/CA Flexibility Paper/Mark_runs') |
4 | | -s |
5 | | -files = plexos_open('//plexossql/data/moconnel/CA Flexibility Paper/Mark_runs') |
6 | | -View(files) |
7 | | -View(files) |
8 | | -db = files[1] |
9 | | -View(db) |
10 | | -db = files[,1] |
11 | | -View(db) |
12 | | -db = files[1,] |
13 | | -View(db) |
14 | | -database = db |
15 | | -gsub('.*Model ', '', database[1,3]) |
16 | | -plexos_open(c('//plexossql/data/moconnel/CA Flexibility Paper/Mark_runs/1','//plexossql/data/moconnel/CA Flexibility Paper/Mark_runs/2')) |
17 | | -files = plexos_open(c('//plexossql/data/moconnel/CA Flexibility Paper/Mark_runs/1','//plexossql/data/moconnel/CA Flexibility Paper/Mark_runs/2')) |
18 | | -View(files) |
19 | | -query_year(files, 'Generator', 'Generation') |
20 | | -sum_year(files, 'Generator', 'Generation') |
21 | | -results = query_year(files, 'Region', 'Load') |
22 | | -View(results) |
23 | | -library(dplyr) |
24 | | -library(data.table) |
25 | | -library(reshape2) |
26 | | -library(plyr) |
27 | | -# Load all files |
28 | | -mapping = fread('//plexossql/data/moconnel/Gen_CSV_Mapping_Files/GenNamesTEPPC_2024_RPV_dispatch.CSV') |
29 | | -max.cap.monthly.plexos = fread('//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/all_maxCap_monthly_fromWECCdb.csv') |
30 | | -max.cap.static.plexos = fread('//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/all_maxCap_static_fromWECCdb.csv') |
31 | | -min.stable.plexos = fread('//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/all_minStable_fromWECCdb.csv') |
32 | | -max.energy.monthly.plexos = fread('//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/hydro_MaxEnergyMonth_fromWECCdb.csv') |
33 | | -gen_jennie = fread('//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/all_maxCap_minStable_WECC_jennie.csv') |
34 | | -View(gen_jennie) |
35 | | -View(max.cap.monthly.plexos) |
36 | | -max.cap.monthly.plexos = merge(max.cap.monthly.plexos, mapping, by='name') |
37 | | -max.cap.static.plexos = merge(max.cap.static.plexos, mapping, by='name') |
38 | | -min.stable.plexos = merge(min.stable.plexos, mapping, by='name') |
39 | | -max.energy.monthly.plexos = merge(max.energy.monthly.plexos, mapping, by='name') |
40 | | -View(max.cap.monthly.plexos) |
41 | | -unique(max.cap.monthly.plexos$Type) |
42 | | -unique(max.cap.static.plexos$Type) |
43 | | -unique(max.energy.monthly.plexos$Type) |
44 | | -str(max.cap.monthly.plexos) |
45 | | -max.cap.monthly.plexos <- max.cap.monthly.plexos[Type=='Hydro',] |
46 | | -View(max.cap.monthly.plexos) |
47 | | -unique(max.cap.monthly.plexos$Type) |
48 | | -max.cap.monthly.plexos = fread('//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/all_maxCap_monthly_fromWECCdb.csv') |
49 | | -max.cap.monthly.plexos = merge(max.cap.monthly.plexos, mapping, by='name') |
50 | | -max.cap.monthly.plexos |
51 | | -unique(max.cap.monthly.plexos$Type) |
52 | | -View(max.cap.monthly.plexos) |
53 | | -max.cap.monthly.plexos <- max.cap.monthly.plexos[Type=='Hydro',] |
54 | | -max.cap.static.plexos <- max.cap.monthly.plexos[Type=='Hydro',] |
55 | | -min.stable.plexos <- min.stable.plexos[Type=='Hydro',] |
56 | | -max.energy.monthly.plexos <- max.energy.monthly.plexos[Type=='Hydro',] |
57 | | -gen_jennie <- gen_jennie[Type=='Hydro',] |
58 | | -View(max.cap.static.plexos) |
59 | | -View(max.cap.monthly.plexos) |
60 | | -View(max.cap.static.plexos) |
61 | | -max.cap.static.plexos = fread('//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/all_maxCap_static_fromWECCdb.csv') |
62 | | -max.cap.static.plexos = merge(max.cap.static.plexos, mapping, by='name') |
63 | | -max.cap.static.plexos <- max.cap.monthly.plexos[Type=='Hydro',] |
64 | | -View(max.cap.static.plexos) |
65 | | -max.cap.static.plexos = fread('//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/all_maxCap_static_fromWECCdb.csv') |
66 | | -View(max.cap.static.plexos) |
67 | | -max.cap.static.plexos = merge(max.cap.static.plexos, mapping, by='name') |
68 | | -View(max.cap.static.plexos) |
69 | | -max.cap.static.plexos <- max.cap.static.plexos[Type=='Hydro',] |
70 | | -View(max.cap.static.plexos) |
71 | | -length(unique(max.cap.static.plexos$name)) |
72 | | -length(unique(max.cap.monthly.plexos$name)) |
73 | | -test[1] = (unique(max.cap.static.plexos$name) |
74 | | -) |
75 | | -test = data.table(monthly = unique(max.cap.monthly.plexos$name), static = unique(max.cap.static.plexos)) |
76 | | -View(test) |
77 | | -rm(test) |
78 | | -test = data.table(monthly = unique(max.cap.monthly.plexos$name), static = unique(max.cap.static.plexos)) |
79 | | -View(test) |
80 | | -test <- data.table(monthly = unique(max.cap.monthly.plexos$name), static = unique(max.cap.static.plexos)) |
81 | | -test1 = unique(max.cap.monthly.plexos$name) |
82 | | -test2 = unique(max.cap.static.plexos$name) |
83 | | -test3 = data.table(test1, test2) |
84 | | -View(test3) |
85 | | -test3[,diff := test1==test2] |
86 | | -View(test3) |
87 | | -sum(test3$diff) |
88 | | -nrow(test43) |
89 | | -nrow(test3) |
90 | | -rm(test, test3, test1, test2) |
91 | | -View(max.cap.monthly.plexos) |
92 | | -View(max.cap.static.plexos) |
93 | | -unique(max.cap.static.plexos$Scenario) |
94 | | -View(max.cap.monthly.plexos) |
95 | | -max.cap.monthly.plexos = dcast(max.cap.monthly.plexos, name+TypeSpecific~Month, value.var='Max Capacity') |
96 | | -View(max.cap.monthly.plexos) |
97 | | -View(min.stable.plexos) |
98 | | -unique(min.stable.plexos$scenario) |
99 | | -min.stable.plexos <- min.stable.plexos[scenario=='Monthly Min Stable Level'] |
100 | | -min.stable.plexos = dcast(min.stable.plexos, name~timeslice, value.var='value') |
101 | | -View(max.energy.monthly.plexos) |
102 | | -unique(max.energy.monthly.plexos$scenario) |
103 | | -max.energy.monthly.plexos <- max.energy.monthly.plexos[scenario=='update from V1.1 to V1.2' | scenario==''] |
104 | | -View(max.energy.monthly.plexos) |
105 | | -max.energy.dates = max.energy.monthly.plexos[date.from!=""] |
106 | | -max.energy.dates = max.energy.dates[grepl(2024, max.energy.dates[,date.from])] |
107 | | -max.energy.base = max.energy.monthly.plexos[date.from==""] |
108 | | -max.energy <- rbind(max.energy.base, max.energy.dates) |
109 | | -max.energy <- data.table(dcast(max.energy, name+timeslice~scenario, value.var='value')) |
110 | | -View(max.energy) |
111 | | -max.energy[, value := `update from V1.1 to V1.2`] |
112 | | -max.energy[is.na(value), value := Var.3] |
113 | | -View(max.energy) |
114 | | -max.energy = dcast(max.energy, name~timeslice, value.var='value') |
115 | | -View(max.energy) |
116 | | -library(dplyr) |
117 | | -library(data.table) |
118 | | -library(reshape2) |
119 | | -library(plyr) |
120 | | -# Load all files |
121 | | -mapping = fread('//plexossql/data/moconnel/Gen_CSV_Mapping_Files/GenNamesTEPPC_2024_RPV_dispatch.CSV') |
122 | | -max.cap.monthly.plexos = fread('//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/all_maxCap_monthly_fromWECCdb.csv') |
123 | | -# max.cap.static.plexos = fread('//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/all_maxCap_static_fromWECCdb.csv') |
124 | | -min.stable.plexos = fread('//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/all_minStable_fromWECCdb.csv') |
125 | | -max.energy.monthly.plexos = fread('//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/hydro_MaxEnergyMonth_fromWECCdb.csv') |
126 | | -gen_jennie = fread('//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/all_maxCap_minStable_WECC_jennie.csv') |
127 | | -# Add gen type to files |
128 | | -max.cap.monthly.plexos = merge(max.cap.monthly.plexos, mapping, by='name') |
129 | | -# max.cap.static.plexos = merge(max.cap.static.plexos, mapping, by='name') |
130 | | -min.stable.plexos = merge(min.stable.plexos, mapping, by='name') |
131 | | -max.energy.monthly.plexos = merge(max.energy.monthly.plexos, mapping, by='name') |
132 | | -# Remove all non-hydro generators |
133 | | -max.cap.monthly.plexos <- max.cap.monthly.plexos[Type=='Hydro',] |
134 | | -# max.cap.static.plexos <- max.cap.static.plexos[Type=='Hydro',] |
135 | | -min.stable.plexos <- min.stable.plexos[Type=='Hydro',] |
136 | | -max.energy.monthly.plexos <- max.energy.monthly.plexos[Type=='Hydro',] |
137 | | -gen_jennie <- gen_jennie[Type=='Hydro',] |
138 | | -max.energy.monthly.plexos <- max.energy.monthly.plexos[scenario=='update from V1.1 to V1.2' | scenario==''] |
139 | | -max.energy.dates = max.energy.monthly.plexos[date.from!=""] |
140 | | -max.energy.dates = max.energy.dates[grepl(2024, max.energy.dates[,date.from])] |
141 | | -max.energy.base = max.energy.monthly.plexos[date.from==""] |
142 | | -max.energy <- rbind(max.energy.base, max.energy.dates) |
143 | | -max.energy <- data.table(dcast(max.energy, name+timeslice~scenario, value.var='value')) |
144 | | -max.energy[, value := `update from V1.1 to V1.2`] |
145 | | -max.energy[is.na(value), value := Var.3] |
146 | | -max.energy.monthly.plexos = fread('//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/hydro_MaxEnergyMonth_fromWECCdb.csv') |
147 | | -min.stable.plexos <- min.stable.plexos[scenario=='Monthly Min Stable Level'] |
148 | | -min.stable.plexos = dcast(min.stable.plexos, name~timeslice, value.var='value') |
149 | | -# write.csv(min.stable, '//nrelqnap01d/plexos/projects/im3/Thermal_Hydro_Gen_Params/monthlyMinStable_hydro.csv', row.names=FALSE) |
150 | | -# Extract monthly maximum energy for hydro units from database, and then write csv file |
151 | | -max.energy.monthly.plexos <- max.energy.monthly.plexos[scenario=='update from V1.1 to V1.2' | scenario==''] |
152 | | -max.energy.dates = max.energy.monthly.plexos[date.from!=""] |
153 | | -max.energy.dates = max.energy.dates[grepl(2024, max.energy.dates[,date.from])] |
154 | | -max.energy.base = max.energy.monthly.plexos[date.from==""] |
155 | | -max.energy <- rbind(max.energy.base, max.energy.dates) |
156 | | -max.energy <- data.table(dcast(max.energy, name+timeslice~scenario, value.var='value')) |
157 | | -max.energy[, value := `update from V1.1 to V1.2`] |
158 | | -max.energy[is.na(value), value := Var.3] |
159 | | -# max.energy[is.na(value), value := `MonthlyEnergy with K equal to zero`] |
160 | | -max.energy = dcast(max.energy, name~timeslice, value.var='value') |
161 | | -View(max.energy) |
162 | | -View(gen_jennie) |
163 | | -gen_maxCap = fread('//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/all_maxCap_static_WECC_plexos_output.csv') |
164 | | -View(gen_maxCap) |
165 | | -gen_maxCap = merge(gen_maxCap, mapping, by='name') |
166 | | -gen_maxCap = fread('//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/all_maxCap_static_WECC_plexos_output.csv') |
167 | | -gen_maxCap = merge(gen_maxCap, mapping, by='name') |
168 | | -View(gen_maxCap) |
169 | | -gen_maxCap[Type %in% c('CHP-QF', 'Gas CT', 'Biomass', 'Gas CC', 'Coal', 'Steam', 'Nuclear')] |
170 | | -gen_maxCap <- gen_maxCap[Type %in% c('CHP-QF', 'Gas CT', 'Biomass', 'Gas CC', 'Coal', 'Steam', 'Nuclear')] |
171 | | -gen_maxCap_db = fread('//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/all_maxCap_static_fromWECCdb.csv') |
172 | | -gen_maxCap_db = merge(gen_maxCap_db, mapping, by='name') |
173 | | -max.cap.thermal = gen_maxCap_db[Type %in% c('CHP-QF', 'Gas CT', 'Biomass', 'Gas CC', 'Coal', 'Steam', 'Nuclear')] |
174 | | -max.cap.thermal.noscen = max.cap.thermal[Scenario == ''] |
175 | | -max.cap.thermal.lcgs = max.cap.thermal[Scenario == 'CA_GasFleet_LCGS'] |
176 | | -for ( i in max.cap.thermal.lcgs[,name] ) { |
177 | | -max.cap.thermal.noscen[name==i, `Max Capacity` := max.cap.thermal.lcgs[name==i, `Max Capacity`]] |
178 | | -} |
179 | | -therm.db = max.cap.thermal.noscen |
180 | | -View(max.cap.thermal.noscen) |
181 | | -View(gen_maxCap) |
182 | | -mapping = fread('//plexossql/data/moconnel/Gen_CSV_Mapping_Files/GenNamesTEPPC_2024_RPV_dispatch.CSV') |
183 | | -gen_maxCap_db = fread('//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/all_maxCap_static_fromWECCdb.csv') |
184 | | -gen_maxCap_db = merge(gen_maxCap_db, mapping, by='name') |
185 | | -max.cap.thermal = gen_maxCap_db[Type %in% c('CHP-QF', 'Gas CT', 'Biomass', 'Gas CC', 'Coal', 'Steam', 'Nuclear')] |
186 | | -max.cap.thermal.noscen = max.cap.thermal[Scenario == ''] |
187 | | -max.cap.thermal.lcgs = max.cap.thermal[Scenario == 'CA_GasFleet_LCGS'] |
188 | | -for ( i in max.cap.thermal.lcgs[,name] ) { |
189 | | -max.cap.thermal.noscen[name==i, `Max Capacity` := max.cap.thermal.lcgs[name==i, `Max Capacity`]] |
190 | | -} |
191 | | -therm.db = max.cap.thermal.noscen |
192 | | -gen_maxCap = fread('//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/all_maxCap_static_WECC_plexos_output.csv') |
193 | | -gen_maxCap = merge(gen_maxCap, mapping, by='name') |
194 | | -gen_maxCap <- gen_maxCap[Type %in% c('CHP-QF', 'Gas CT', 'Biomass', 'Gas CC', 'Coal', 'Steam', 'Nuclear')] |
195 | | -write.csv(gen_maxCap, '//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/plexos_mapCap.csv', row.names=FALSE) |
196 | | -write.csv(therm.db, '//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/prevoius_mapCap.csv', row.names=FALSE) |
197 | | -gen_maxCap_db = fread('//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/all_maxCap_static_fromWECCdb.csv') |
198 | | -gen_maxCap_db = merge(gen_maxCap_db, mapping, by='name') |
199 | | -max.cap.thermal = gen_maxCap_db[Type %in% c('CHP-QF', 'Gas CT', 'Biomass', 'Gas CC', 'Coal', 'Steam', 'Nuclear')] |
200 | | -max.cap.thermal.noscen = max.cap.thermal[Scenario == ''] |
201 | | -max.cap.thermal.lcgs = max.cap.thermal[Scenario == 'CA_GasFleet_LCGS'] |
202 | | -for ( i in max.cap.thermal.lcgs[,name] ) { |
203 | | -max.cap.thermal.noscen[name==i, `Max Capacity` := max.cap.thermal.lcgs[name==i, `Max Capacity`]] |
204 | | -} |
205 | | -View(max.cap.thermal.noscen) |
206 | | -gen_maxCap = fread('//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/all_maxCap_static_WECC_plexos_output.csv') |
207 | | -gen_maxCap = merge(gen_maxCap, mapping, by='name') |
208 | | -gen_maxCap <- gen_maxCap[Type %in% c('CHP-QF', 'Gas CT', 'Biomass', 'Gas CC', 'Coal', 'Steam', 'Nuclear')] |
209 | | -write.csv(gen_maxCap, '//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/plexos_maxCap.csv', row.names=FALSE) |
210 | | -write.csv(therm.db, '//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/prevoius_maxCap.csv', row.names=FALSE) |
211 | | -gen_maxCap = fread('//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/all_maxCap_static_WECC_plexos_output.csv') |
212 | | -gen_maxCap = merge(gen_maxCap, mapping, by='name') |
213 | | -gen_maxCap <- gen_maxCap[Type == 'Hydro'] |
214 | | -View(gen_maxCap) |
215 | | -write.csv(gen_maxCap, '//nrelqnap01d/plexos/projects/im3/WECC_db_gen_data/plexos_maxCap_hydro.csv', row.names=FALSE) |
216 | | -library(rplexos) |
217 | | -process_folder('//nrelqnap01d/plexos/projects/im3/PLEXOS database/Model DA_Nodal_Baseline_IM3_1day_regionLoad Solution/') |
218 | | -process_folder('//nrelqnap01d/plexos/projects/im3/PLEXOS database/Model DA_Nodal_Baseline_IM3_1day_regionLoad Solution') |
219 | | -db = plexos_open('//nrelqnap01d/plexos/projects/im3/PLEXOS database/Model DA_Nodal_Baseline_IM3_1day_regionLoad Solution') |
220 | | -prop = query_property(db) |
221 | | -View(prop) |
222 | | -?query_log_steps |
223 | | -library(rplexos) |
224 | | -?query_log_steps |
225 | | -source('C:/Users/moconnel/Documents/RTS-GMLC/Create_PLEXOS_database/1-parse-matpower/parse_matpower.R', echo=TRUE) |
226 | | -source('C:/Users/moconnel/Documents/RTS-GMLC/Create_PLEXOS_database/2-create-excel/run_PSSE2PLEXOS.R', echo=TRUE) |
227 | | -source('C:/Users/moconnel/Documents/RTS-GMLC/Create_PLEXOS_database/1-parse-matpower/parse_matpower.R', echo=TRUE) |
228 | | -source('C:/Users/moconnel/Documents/RTS-GMLC/Create_PLEXOS_database/2-create-excel/run_PSSE2PLEXOS.R', echo=TRUE) |
229 | | -source('X:/MAGMA/run_html_output_rts.R', echo=TRUE) |
230 | | -source('X:/MAGMA/run_html_output_rts.R', echo=TRUE) |
231 | | -source('X:/MAGMA/run_html_output_rts.R', echo=TRUE) |
232 | | -source('X:/MAGMA/run_html_output_rts.R', echo=TRUE) |
233 | | -source('X:/MAGMA/run_html_output_rts.R', echo=TRUE) |
234 | | -source('C:/Users/moconnel/Documents/RTS-GMLC/Create_PLEXOS_database/1-parse-matpower/parse_matpower.R', echo=TRUE) |
235 | | -source('C:/Users/moconnel/Documents/RTS-GMLC/Create_PLEXOS_database/1-parse-matpower/parse_matpower.R', echo=TRUE) |
236 | | -traceback() |
237 | | -storage.csp.da <- fread("../../RTS_Data/storage.csp.da.csv") |
238 | | -storage.csp.rt <- fread("../../RTS_Data/storage.csp.rt.csv") |
239 | | -source('C:/Users/moconnel/Documents/RTS-GMLC/Create_PLEXOS_database/1-parse-matpower/parse_matpower.R', echo=TRUE) |
240 | | -source('C:/Users/moconnel/Documents/RTS-GMLC/Create_PLEXOS_database/2-create-excel/run_PSSE2PLEXOS.R', echo=TRUE) |
241 | | -source('C:/Users/moconnel/Documents/RTS-GMLC/Create_PLEXOS_database/1-parse-matpower/parse_matpower.R', echo=TRUE) |
242 | | -source('C:/Users/moconnel/Documents/RTS-GMLC/Create_PLEXOS_database/2-create-excel/run_PSSE2PLEXOS.R', echo=TRUE) |
| 1 | +sessionInfo() |
| 2 | +as.posixct("2024-01-01 00:01:00") |
| 3 | +as.POSIXct("2024-01-01 00:01:00") |
| 4 | +seq(as.POSIXct("2024-01-01 00:01:00"),as.POSIXct("2025-01-01 00:00:00"),by = '5 minute') |
| 5 | +seq(as.POSIXct("2024-01-01 00:01:00"),as.POSIXct("2025-01-01 00:00:00"),by = 'hour') |
| 6 | +seq(as.POSIXct("2024-01-01 01:00:00"),as.POSIXct("2025-01-01 00:00:00"),by = 'hour') |
| 7 | +seq(as.POSIXct("2024-01-01 01:00:00"),as.POSIXct("2025-01-01 00:00:00"),by = 5) |
| 8 | +seq(as.POSIXct("2024-01-01 01:00:00"),as.POSIXct("2025-01-01 00:00:00"),by = 5*60) |
| 9 | +x - seq(as.POSIXct("2024-01-01 01:00:00"),as.POSIXct("2025-01-01 00:00:00"),by = 5*60) |
| 10 | +x = seq(as.POSIXct("2024-01-01 01:00:00"),as.POSIXct("2025-01-01 00:00:00"),by = 5*60) |
| 11 | +x |
| 12 | +hour(x) |
| 13 | +as.hour(x) |
| 14 | +pacman::p_load(lubridate) |
| 15 | +hour(x) |
| 16 | +ts = data.table(Year = year(x),Hour = hour(x),Minute=minute(x),value=0) |
| 17 | +pacman::p_load(lubridate,data.table) |
| 18 | +ts = data.table(Year = year(x),Hour = hour(x),Minute=minute(x),value=0) |
| 19 | +ts |
| 20 | +x = seq(as.POSIXct("2024-01-01 01:00:00"),as.POSIXct("2024-12-31 23:55:00"),by = 5*60) |
| 21 | +ts = data.table(Year = year(x),Hour = hour(x),Minute=minute(x),value=0) |
| 22 | +ts |
| 23 | +write.csv(ts,file='Documents/repos/RTS-GMLC/RTS_Data/timeseries_data_files/hydro/region1_Hydro_RT.csv') |
| 24 | +write.csv(ts,file='Documents/repos/RTS-GMLC/RTS_Data/timeseries_data_files/hydro/region2_Hydro_RT.csv') |
| 25 | +write.csv(ts,file='Documents/repos/RTS-GMLC/RTS_Data/timeseries_data_files/hydro/region3_Hydro_RT.csv') |
| 26 | +write.csv(ts,file='Documents/repos/RTS-GMLC/RTS_Data/timeseries_data_files/hydro/region3_Hydro_RT.csv',row.names = F) |
| 27 | +write.csv(ts,file='Documents/repos/RTS-GMLC/RTS_Data/timeseries_data_files/hydro/region3_Hydro_RT.csv',row.names = F,quote = F) |
| 28 | +ts = data.table(Year = year(x),Hour = hour(x),Minute=minute(x),value=0) |
| 29 | +ts = data.table(Year = year(x),Month = month(x),Day=day(x),Period = (hour(x)-1)*12 + minute(x),value=0) |
| 30 | +ts |
| 31 | +ts = data.table(Year = year(x),Month = month(x),Day=day(x),Period = (hour(x)-1)*12 + minute(x)/5,value=0) |
| 32 | +ts |
| 33 | +5*12*12 |
| 34 | +5*12*24 |
| 35 | +max(ts$Period) |
| 36 | +ts = data.table(Year = year(x),Month = month(x),Day=day(x),Period = (hour(x))*12 + minute(x)/5,value=0) |
| 37 | +ts |
| 38 | +ts = data.table(Year = year(x),Month = month(x),Day=day(x),Period = ((hour(x)-1)*12 + minute(x))/5,value=0) |
| 39 | +ts |
| 40 | +mintue(x)-1 |
| 41 | +minute(x)-1 |
| 42 | +minute(x) |
| 43 | +minute(x)/5 |
| 44 | +minute(x)/5+1 |
| 45 | +(minute(x)/5+1)*(hour(x)) |
| 46 | +(minute(x)/5+1) |
| 47 | +(minute(x)/5+1)+(12*hour(x)) |
| 48 | +12*24 |
| 49 | +ts = data.table(Year = year(x),Month = month(x),Day=day(x),Period = (minute(x)/5+1)+(12*hour(x)),value=0) |
| 50 | +ts |
| 51 | +ts = data.table(Year = year(x),Month = month(x),Day=day(x),Period = (minute(x)/5+1)+(12*(hour(x)-1)),value=0) |
| 52 | +ts |
| 53 | +24*12 |
| 54 | +View(ts) |
| 55 | +x = seq(as.POSIXct("2024-01-01 00:00:00"),as.POSIXct("2024-12-31 23:55:00"),by = 5*60) |
| 56 | +ts = data.table(Year = year(x),Month = month(x),Day=day(x),Period = (minute(x)/5+1)+(12*(hour(x))),value=0) |
| 57 | +View(ts) |
| 58 | +write.csv(ts,file='Documents/repos/RTS-GMLC/RTS_Data/timeseries_data_files/hydro/region3_Hydro_RT.csv',row.names = F,quote = F) |
| 59 | +write.csv(ts,file='Documents/repos/RTS-GMLC/RTS_Data/timeseries_data_files/hydro/region2_Hydro_RT.csv',row.names = F,quote = F) |
| 60 | +write.csv(ts,file='Documents/repos/RTS-GMLC/RTS_Data/timeseries_data_files/hydro/region1_Hydro_RT.csv',row.names = F,quote = F) |
| 61 | +setwd('Documents/repos/RTS-GMLC/') |
| 62 | +setwd('Create_PLEXOS_database/') |
| 63 | +source('create_RTS_spreadsheet.R') |
| 64 | +source('1-parse-matpower/parse_matpower.R') |
| 65 | +setwd('../2-create-excel') |
| 66 | +source('run_PSSE2PLEXOS.R') |
| 67 | +prop.table() |
| 68 | +Properties.sheet |
| 69 | +Properties.sheet[property=='Heat Rate'] |
| 70 | +Properties.sheet[property=='Heat Rate'] |
0 commit comments