Skip to content

Commit cea0684

Browse files
committed
Add tap_control to bus control_data
1 parent 39e00a7 commit cea0684

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/pwf2pm/bus.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ function _pwf2pm_bus!(pm_data::Dict, pwf_data::Dict, bus::Dict, dict_dgbt, dict_
9999
sub_data["control_data"]["voltage_controlled_bus"] = bus["CONTROLLED BUS"]
100100
sub_data["control_data"]["vmmin"] = sub_data["vmin"]
101101
sub_data["control_data"]["vmmax"] = sub_data["vmax"]
102+
sub_data["control_data"]["tap_control"] = nothing
103+
sub_data["control_data"]["constraint_type"] = nothing
102104
end
103105

104106
idx = string(sub_data["index"])

src/pwf2pm/transformer.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,24 @@ function _pwf2pm_transformer!(pm_data::Dict, pwf_data::Dict, branch::Dict; add_c
103103
sub_data["control_data"]["shift_control_variable"] = nothing
104104
sub_data["control_data"]["shiftmin"] = nothing
105105
sub_data["control_data"]["shiftmax"] = nothing
106+
106107
if constraint_type == "VOLTAGE CONTROL"
108+
107109
sub_data["control_data"]["constraint_type"] = "bounds"
108110
sub_data["control_data"]["valsp"] = branch_dctr[circuit]["SPECIFIED VALUE"]
109111
sub_data["control_data"]["controlled_bus"] = branch_dctr[circuit]["MEASUREMENT EXTREMITY"]
112+
113+
pm_data["bus"]["$(sub_data["control_data"]["controlled_bus"])"]["control_data"]["control_type"] = "tap_control"
114+
if isnothing(pm_data["bus"]["$(sub_data["control_data"]["controlled_bus"])"]["control_data"]["constraint_type"]) # setpoint is more restrict than bounds
115+
pm_data["bus"]["$(sub_data["control_data"]["controlled_bus"])"]["control_data"]["constraint_type"] = "bounds"
116+
end
110117

111118
else
119+
pm_data["bus"]["$(sub_data["control_data"]["controlled_bus"])"]["control_data"]["control_type"] = "tap_control"
120+
112121
sub_data["control_data"]["constraint_type"] = "setpoint"
113122
sub_data["control_data"]["valsp"] = nothing
123+
pm_data["bus"]["$(sub_data["control_data"]["controlled_bus"])"]["control_data"]["constraint_type"] = "setpoint"
114124
end
115125

116126
elseif constraint_type == "PHASE CONTROL" # phase control

0 commit comments

Comments
 (0)