22
22
23
23
24
24
" "
25
- function constraint_generation_damage (pm:: _PM.AbstractPowerModel , i:: Int ; nw:: Int = pm. cnw)
25
+ function constraint_gen_damage (pm:: _PM.AbstractPowerModel , i:: Int ; nw:: Int = pm. cnw)
26
26
gen = _PM. ref (pm, nw, :gen , i)
27
27
28
- gen_damaged = haskey (_PM. ref (pm, nw, :damaged_gen ), i)
29
- bus_damaged = haskey (_PM. ref (pm, nw, :damaged_bus ), gen[" gen_bus" ])
28
+ gen_damaged = haskey (_PM. ref (pm, nw, :gen_damage ), i)
29
+ bus_damaged = haskey (_PM. ref (pm, nw, :bus_damage ), gen[" gen_bus" ])
30
30
31
31
if gen_damaged
32
- _PM. constraint_generation_on_off (pm, nw, i, gen[" pmin" ], gen[" pmax" ], gen[" qmin" ], gen[" qmax" ])
32
+ _PM. constraint_gen_power_on_off (pm, nw, i, gen[" pmin" ], gen[" pmax" ], gen[" qmin" ], gen[" qmax" ])
33
33
if bus_damaged
34
34
constraint_gen_bus_connection (pm, nw, i, gen[" gen_bus" ])
35
35
end
@@ -45,7 +45,7 @@ function constraint_load_damage(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.c
45
45
if haskey (_PM. ref (pm, nw, :load ), i)
46
46
load = _PM. ref (pm, nw, :load , i)
47
47
48
- bus_damaged = haskey (_PM. ref (pm, nw, :damaged_bus ), load[" load_bus" ])
48
+ bus_damaged = haskey (_PM. ref (pm, nw, :bus_damage ), load[" load_bus" ])
49
49
50
50
if bus_damaged
51
51
constraint_load_bus_connection (pm, nw, i, load[" load_bus" ])
58
58
function constraint_shunt_damage (pm:: _PM.AbstractPowerModel , i:: Int ; nw:: Int = pm. cnw)
59
59
if haskey (_PM. ref (pm, nw, :shunt ), i)
60
60
shunt = _PM. ref (pm, nw, :shunt , i)
61
- bus_damaged = haskey (_PM. ref (pm, nw, :damaged_bus ), shunt[" shunt_bus" ])
61
+ bus_damaged = haskey (_PM. ref (pm, nw, :bus_damage ), shunt[" shunt_bus" ])
62
62
63
63
if bus_damaged
64
64
constraint_shunt_bus_connection (pm, nw, i, shunt[" shunt_bus" ])
71
71
function constraint_branch_damage (pm:: _PM.AbstractPowerModel , i:: Int ; nw:: Int = pm. cnw)
72
72
branch = _PM. ref (pm, nw, :branch , i)
73
73
74
- branch_damaged = haskey (_PM. ref (pm, nw, :damaged_branch ), i)
75
- bus_fr_damaged = haskey (_PM. ref (pm, nw, :damaged_bus ), branch[" f_bus" ])
76
- bus_to_damaged = haskey (_PM. ref (pm, nw, :damaged_bus ), branch[" t_bus" ])
74
+ branch_damaged = haskey (_PM. ref (pm, nw, :branch_damage ), i)
75
+ bus_fr_damaged = haskey (_PM. ref (pm, nw, :bus_damage ), branch[" f_bus" ])
76
+ bus_to_damaged = haskey (_PM. ref (pm, nw, :bus_damage ), branch[" t_bus" ])
77
77
78
78
if branch_damaged
79
79
if bus_fr_damaged
@@ -109,7 +109,7 @@ function constraint_ohms_yt_from_damage(pm::_PM.AbstractPowerModel, i::Int; nw::
109
109
# TODO make indexing of :wi,:wr standardized
110
110
# # Because :wi, :wr are indexed by bus_id or bus_pairs depending on if the value is on_off or
111
111
# standard, there are indexing issues. Temporary solution: always call *_on_off variant
112
- if haskey (_PM. ref (pm, nw, :damaged_branch ), i)
112
+ if haskey (_PM. ref (pm, nw, :branch_damage ), i)
113
113
vad_min = _PM. ref (pm, nw, :off_angmin )
114
114
vad_max = _PM. ref (pm, nw, :off_angmax )
115
115
_PM. constraint_ohms_yt_from_on_off (pm, nw, i, f_bus, t_bus, f_idx, t_idx, g, b, g_fr, b_fr, tr, ti, tm, vad_min, vad_max)
@@ -139,7 +139,7 @@ function constraint_ohms_yt_to_damage(pm::_PM.AbstractPowerModel, i::Int; nw::In
139
139
# TODO make indexing of :wi,:wr standardized
140
140
# # Because :wi, :wr are indexed by bus_id or bus_pairs depending on if the value is on_off or
141
141
# standard, there are indexing issues. Temporary solution: always call *_on_off variant
142
- if haskey (_PM. ref (pm, nw, :damaged_branch ), i)
142
+ if haskey (_PM. ref (pm, nw, :branch_damage ), i)
143
143
vad_min = _PM. ref (pm, nw, :off_angmin )
144
144
vad_max = _PM. ref (pm, nw, :off_angmax )
145
145
@@ -161,7 +161,7 @@ function constraint_voltage_angle_difference_damage(pm::_PM.AbstractPowerModel,
161
161
# TODO make indexing of :wi,:wr standardized
162
162
# Because :wi, :wr are indexed by bus_id or bus_pairs depending on if the value is on_off or
163
163
# standard, there are indexing issues. Temporary solution: always call *_on_off variant
164
- if haskey (_PM. ref (pm, nw, :damaged_branch ), i)
164
+ if haskey (_PM. ref (pm, nw, :branch_damage ), i)
165
165
166
166
vad_min = _PM. ref (pm, nw, :off_angmin )
167
167
vad_max = _PM. ref (pm, nw, :off_angmax )
@@ -190,7 +190,7 @@ function constraint_thermal_limit_from_damage(pm::_PM.AbstractPowerModel, i::Int
190
190
t_bus = branch[" t_bus" ]
191
191
f_idx = (i, f_bus, t_bus)
192
192
193
- if haskey (_PM. ref (pm, nw, :damaged_branch ), i)
193
+ if haskey (_PM. ref (pm, nw, :branch_damage ), i)
194
194
_PM. constraint_thermal_limit_from_on_off (pm, nw, i, f_idx, branch[" rate_a" ])
195
195
else
196
196
if ! haskey (_PM. con (pm, nw), :sm_fr )
@@ -208,7 +208,7 @@ function constraint_thermal_limit_to_damage(pm::_PM.AbstractPowerModel, i::Int;
208
208
t_bus = branch[" t_bus" ]
209
209
t_idx = (i, t_bus, f_bus)
210
210
211
- if haskey (_PM. ref (pm, nw, :damaged_branch ), i)
211
+ if haskey (_PM. ref (pm, nw, :branch_damage ), i)
212
212
_PM. constraint_thermal_limit_to_on_off (pm, nw, i, t_idx, branch[" rate_a" ])
213
213
else
214
214
if ! haskey (_PM. con (pm, nw), :sm_to )
223
223
function constraint_storage_damage (pm:: _PM.AbstractPowerModel , i:: Int ; nw:: Int = pm. cnw)
224
224
storage = _PM. ref (pm, nw, :storage , i)
225
225
226
- storage_damaged = haskey (_PM. ref (pm, nw, :damaged_storage ), i)
227
- bus_damaged = haskey (_PM. ref (pm, nw, :damaged_bus ), storage[" storage_bus" ])
226
+ storage_damaged = haskey (_PM. ref (pm, nw, :storage_damage ), i)
227
+ bus_damaged = haskey (_PM. ref (pm, nw, :bus_damage ), storage[" storage_bus" ])
228
228
229
229
230
230
if storage_damaged
@@ -248,18 +248,18 @@ function constraint_storage_damage(pm::_PM.AbstractPowerModel, i::Int; nw::Int=p
248
248
end
249
249
250
250
" "
251
- function constraint_bus_voltage_violation_damage (pm:: _PM.AbstractPowerModel , i:: Int ; nw:: Int = pm. cnw)
251
+ function constraint_bus_damage_soft (pm:: _PM.AbstractPowerModel , i:: Int ; nw:: Int = pm. cnw)
252
252
bus = _PM. ref (pm, nw, :bus , i)
253
253
254
- constraint_bus_voltage_violation_damage (pm, nw, i, bus[" vmin" ], bus[" vmax" ])
254
+ constraint_bus_damage_soft (pm, nw, i, bus[" vmin" ], bus[" vmax" ])
255
255
end
256
256
257
257
258
258
" "
259
- function constraint_bus_voltage_violation (pm:: _PM.AbstractPowerModel , i:: Int ; nw:: Int = pm. cnw)
259
+ function constraint_voltage_magnitude_bounds_soft (pm:: _PM.AbstractPowerModel , i:: Int ; nw:: Int = pm. cnw)
260
260
bus = _PM. ref (pm, nw, :bus , i)
261
261
262
- constraint_bus_voltage_violation (pm, nw, i, bus[" vmin" ], bus[" vmax" ])
262
+ constraint_voltage_magnitude_bounds_soft (pm, nw, i, bus[" vmin" ], bus[" vmax" ])
263
263
end
264
264
265
265
0 commit comments