-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththermal-variable.jl
114 lines (102 loc) · 5.08 KB
/
thermal-variable.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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
using JuMP, PowerModels
tmax = 1000
# add in realistic bounds for top-oil steady-state temperature rise
function variable_delta_oil_ss(pm::GenericPowerModel; nw::Int=pm.cnw, cnd::Int=pm.ccnd, bounded = true)
if bounded
#hsl = PMs.ref(pm, nw, :branch, i, "hotspot_instant_limit")
#println("hotspot limit for $i: $hsl")
PMs.var(pm, nw, cnd)[:ross] = JuMP.@variable(pm.model,
[i in PowerModels.ids(pm, nw, :branch)], base_name="$(nw)_$(cnd)_delta_oil_ss",
lower_bound = 0,
upper_bound = PMs.ref(pm, nw, :branch, i, "hotspot_instant_limit"),
#upper_bound = tmax,
#upper_bound = 280,
start = PowerModels.comp_start_value(PMs.ref(pm, nw, :branch, i), "delta_oil_ss_start", cnd)
)
else
PMs.var(pm, nw, cnd)[:ross] = JuMP.@variable(pm.model,
[i in PowerModels.ids(pm, nw, :branch)], base_name="$(nw)_$(cnd)_delta_oil_ss",
start = PowerModels.comp_start_value(PMs.ref(pm, nw, :branch, i), "delta_oil_ss_start", cnd)
)
end
end
#function variable_absolute_oil_ss(pm::GenericPowerModel; nw::Int=pm.cnw, cnd::Int=pm.ccnd, bounded = true)
# if bounded
# PMs.var(pm, nw, cnd)[:rossa] = JuMP.@variable(pm.model,
# [i in PowerModels.ids(pm, nw, :branch)], base_name="$(nw)_$(cnd)_oil_ss",
# lower_bound = 0,
# upper_bound = PMs.ref(pm, nw, :branch, i, "hotspot_instant_limit"),
# start = PowerModels.comp_start_value(PMs.ref(pm, nw, :branch, i), "oil_ss_start", cnd)
# )
# else
# PMs.var(pm, nw, cnd)[:rossa] = JuMP.@variable(pm.model,
# [i in PowerModels.ids(pm, nw, :branch)], base_name="$(nw)_$(cnd)_oil_ss",
# start = PowerModels.comp_start_value(PMs.ref(pm, nw, :branch, i), "oil_ss_start", cnd)
# )
# end
#end
# add in realistic bounds for top-oil temperature rise
function variable_delta_oil(pm::GenericPowerModel; nw::Int=pm.cnw, cnd::Int=pm.ccnd, bounded = true)
if bounded
PMs.var(pm, nw, cnd)[:ro] = JuMP.@variable(pm.model,
[i in PowerModels.ids(pm, nw, :branch)], base_name="$(nw)_$(cnd)_delta_oil",
lower_bound = 0,
upper_bound = PMs.ref(pm, nw, :branch, i, "hotspot_instant_limit"),
#upper_bound = tmax,
start = PowerModels.comp_start_value(PMs.ref(pm, nw, :branch, i), "delta_oil_start", cnd)
)
else
PMs.var(pm, nw, cnd)[:ro] = JuMP.@variable(pm.model,
[i in PowerModels.ids(pm, nw, :branch)], base_name="$(nw)_$(cnd)_delta_oil",
start = PowerModels.comp_start_value(PMs.ref(pm, nw, :branch, i), "delta_oil_start", cnd)
)
end
end
function variable_delta_hotspot_ss(pm::GenericPowerModel; nw::Int=pm.cnw, cnd::Int=pm.ccnd, bounded = true)
if bounded
PMs.var(pm, nw, cnd)[:hsss] = JuMP.@variable(pm.model,
[i in PowerModels.ids(pm, nw, :branch)], base_name="$(nw)_$(cnd)_delta_hotspot_ss",
lower_bound = 0,
#upper_bound = PMs.ref(pm, nw, :branch, i, "hotspot_instant_limit"),
upper_bound = tmax,
start = PowerModels.comp_start_value(PMs.ref(pm, nw, :branch, i), "delta_hotspot_ss_start", cnd)
)
else
PMs.var(pm, nw, cnd)[:hsss] = JuMP.@variable(pm.model,
[i in PowerModels.ids(pm, nw, :branch)], base_name="$(nw)_$(cnd)_delta_hotspot_ss",
start = PowerModels.comp_start_value(PMs.ref(pm, nw, :branch, i), "delta_oil_hotspot_start", cnd)
)
end
end
function variable_delta_hotspot(pm::GenericPowerModel; nw::Int=pm.cnw, cnd::Int=pm.ccnd, bounded = true)
if bounded
PMs.var(pm, nw, cnd)[:hs] = JuMP.@variable(pm.model,
[i in PowerModels.ids(pm, nw, :branch)], base_name="$(nw)_$(cnd)_delta_hotspot",
lower_bound = 0,
#upper_bound = PMs.ref(pm, nw, :branch, i, "hotspot_instant_limit"),
upper_bound = tmax,
start = PowerModels.comp_start_value(PMs.ref(pm, nw, :branch, i), "delta_hotspot_start", cnd)
)
else
PMs.var(pm, nw, cnd)[:hs] = JuMP.@variable(pm.model,
[i in PowerModels.ids(pm, nw, :branch)], base_name="$(nw)_$(cnd)_delta_hotspot",
start = PowerModels.comp_start_value(PMs.ref(pm, nw, :branch, i), "delta_hotspot_start", cnd)
)
end
end
function variable_hotspot(pm::GenericPowerModel; nw::Int=pm.cnw, cnd::Int=pm.ccnd, bounded = true)
if bounded
PMs.var(pm, nw, cnd)[:hsa] = JuMP.@variable(pm.model,
[i in PowerModels.ids(pm, nw, :branch)], base_name="$(nw)_$(cnd)_hotspot",
lower_bound = 0,
upper_bound = PMs.ref(pm, nw, :branch, i, "hotspot_instant_limit"),
#upper_bound = tmax,
start = PowerModels.comp_start_value(PMs.ref(pm, nw, :branch, i), "hotspot_start", cnd)
)
else
PMs.var(pm, nw, cnd)[:hsa] = JuMP.@variable(pm.model,
[i in PowerModels.ids(pm, nw, :branch)], base_name="$(nw)_$(cnd)_hotspot",
start = PowerModels.comp_start_value(PMs.ref(pm, nw, :branch, i), "hotspot_start", cnd)
)
end
end