@@ -89,10 +89,7 @@ function variable_reactive_line_flow{T}(pm::GenericPowerModel{T}; bounded = true
89
89
return q
90
90
end
91
91
92
- function compute_voltage_product_bounds {T} (pm:: GenericPowerModel{T} )
93
- buspairs = pm. set. buspairs
94
- buspair_indexes = pm. set. buspair_indexes
95
-
92
+ function compute_voltage_product_bounds (buspairs, buspair_indexes)
96
93
wr_min = Dict ([(bp, - Inf ) for bp in buspair_indexes])
97
94
wr_max = Dict ([(bp, Inf ) for bp in buspair_indexes])
98
95
wi_min = Dict ([(bp, - Inf ) for bp in buspair_indexes])
126
123
127
124
function variable_complex_voltage_product {T} (pm:: GenericPowerModel{T} ; bounded = true )
128
125
if bounded
129
- wr_min, wr_max, wi_min, wi_max = compute_voltage_product_bounds (pm)
126
+ wr_min, wr_max, wi_min, wi_max = compute_voltage_product_bounds (pm. set . buspairs, pm . set . buspair_indexes )
130
127
131
128
@variable (pm. model, wr_min[bp] <= wr[bp in pm. set. buspair_indexes] <= wr_max[bp], start = getstart (pm. set. buspairs, bp, " wr_start" , 1.0 ))
132
129
@variable (pm. model, wi_min[bp] <= wi[bp in pm. set. buspair_indexes] <= wi_max[bp], start = getstart (pm. set. buspairs, bp, " wi_start" ))
@@ -138,7 +135,7 @@ function variable_complex_voltage_product{T}(pm::GenericPowerModel{T}; bounded =
138
135
end
139
136
140
137
function variable_complex_voltage_product_on_off {T} (pm:: GenericPowerModel{T} )
141
- wr_min, wr_max, wi_min, wi_max = compute_voltage_product_bounds (pm)
138
+ wr_min, wr_max, wi_min, wi_max = compute_voltage_product_bounds (pm. set . buspairs, pm . set . buspair_indexes )
142
139
143
140
bi_bp = Dict ([(i, (b[" f_bus" ], b[" t_bus" ])) for (i,b) in pm. set. branches])
144
141
@@ -149,7 +146,7 @@ function variable_complex_voltage_product_on_off{T}(pm::GenericPowerModel{T})
149
146
end
150
147
151
148
function variable_complex_voltage_product_matrix {T} (pm:: GenericPowerModel{T} )
152
- wr_min, wr_max, wi_min, wi_max = compute_voltage_product_bounds (pm)
149
+ wr_min, wr_max, wi_min, wi_max = compute_voltage_product_bounds (pm. set . buspairs, pm . set . buspair_indexes )
153
150
154
151
w_index = 1 : length (pm. set. bus_indexes)
155
152
lookup_w_index = Dict ([(bi, i) for (i,bi) in enumerate (pm. set. bus_indexes)])
0 commit comments