Skip to content

Commit 6aa6183

Browse files
authored
add line output script (#270)
1 parent 143a9a7 commit 6aa6183

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/benchmarks/psse/python_scripts/PSSEInterface35.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,19 @@ def setup_output_channels(output, run_name, signals, slack_bus, channel_file='ch
126126
if ierr != 0:
127127
raise(Exception("Channels not set for bus quantities"))
128128

129+
ierr, branch_array = abrnint(-1, _i, _i, 1, 1, ['FROMNUMBER', 'TONUMBER'])
130+
ierr, branch_ids = abrnchar(-1, _i, _i, 1, 1, "ID")
131+
132+
for (ix, id) in enumerate(branch_ids[0]):
133+
bus_from = branch_array[0][ix]
134+
bus_to = branch_array[1][ix]
135+
ierr = branch_p_and_q_channel([-1, -1, -1, bus_from, bus_to], id, )
136+
if ierr != 0:
137+
raise(Exception("Line channel can't be created {}".format(ierr)))
138+
ierr = branch_p_and_q_channel([-1, -1, -1, bus_to, bus_from], id, )
139+
if ierr != 0:
140+
raise(Exception("Line channel can't be created {}".format(ierr)))
141+
129142
print('Initialize Simulation\n')
130143
ierr = strt_2([0, 0], channel_file)
131144
if ierr != 0:

0 commit comments

Comments
 (0)