You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creates the following functions to separate out the functionality for ENGINEERING vs MATHEMATICAL data models
- discover_math_voltage_zones
- discover_eng_voltage_zones
- calc_math_voltage_bases
- calc_eng_voltage_bases
Fixes#388
Copy file name to clipboardExpand all lines: src/data_model/transformations.jl
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -166,7 +166,7 @@ end
166
166
add voltage bounds to all buses based on per-unit upper (`vm_ub`) and lower (`vm_lb`), scaled by the bus's voltage based
167
167
"""
168
168
function_apply_voltage_bounds!(data_eng::Dict{String,<:Any}; vm_lb::Union{Real,Missing}=0.9, vm_ub::Union{Real,Missing}=1.1, exclude::Vector{String}=!isempty(get(data_eng, "voltage_source", Dict())) ? String[x.second["bus"] for x in data_eng["voltage_source"]] : String[])
unused_components =Set("$comp_type.$id"for comp_type in edge_elements[edge_elements .!="transformer"] for id inkeys(get(data_model, comp_type, Dict())))
117
142
bus_connectors =Dict([(id,Set()) for id inkeys(get(data_model, "bus", Dict()))])
118
143
for comp_type in edge_elements[edge_elements .!="transformer"]
@@ -147,15 +172,40 @@ function discover_voltage_zones(data_model::Dict{String,<:Any})::Dict{Int,Set{An
bus_vbase =Dict([(bus,zone_vbase[zone]) for (bus,zone) in bus_to_zone])
220
268
edge_vbase =Dict([("$edge_type.$id", bus_vbase["$(obj["f_bus"])"]) for edge_type in edge_elements[edge_elements .!="transformer"] ifhaskey(data_model, edge_type) for (id,obj) in data_model[edge_type]])
0 commit comments