-
Notifications
You must be signed in to change notification settings - Fork 0
/
inputs.jl
43 lines (34 loc) · 1.16 KB
/
inputs.jl
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
##run
# cd("G:\\My Drive\\Solar & storage paper\\Code & analysis\\reliability\\grid_defection")
# include("inputs.jl")
## set up inputs
using Distributed
addprocs(3)
@everywhere using DataFrames, Clp, FileIO, TextParse, CSVFiles, JuMP
# Set-working directory
@everywhere DIR = "G:\\My Drive\\Solar & storage paper\\Code & analysis\\reliability\\"
@everywhere OUT = "out\\defection\\"
@everywhere INPUT = "in\\sol_load\\tmy\\csv\\"
##### CREATE MODEL RUN ######
#Set Case
@everywhere BAT_COST = 400 # $/kWh
@everywhere PV_COST = 1200 # $/kW
@everywhere LOAD_SHED = 0.05
# Set constants
@everywhere BAT_EFF = 0.92
#annual rates
@everywhere int_rate = 0.04 # percentage interest rate
@everywhere bat_life = 10 # years
@everywhere sol_life = 25 # years
@everywhere BAT_RATE = int_rate / (1 - (1+int_rate)^(-bat_life))
@everywhere PV_RATE = int_rate / (1 - (1+int_rate)^(-sol_life));
# identify geography IDs to loop through
@everywhere ID_G = load(DIR * INPUT * "\\optimization_list.csv") |> DataFrame
#include model
@everywhere include("optimization_model.jl")
# Create parallelization
time = @time pmap(1:(nrow(ID_G)*3)) do i
solar_opt(ID_G, i)
print(i)
GC.gc()
end