Skip to content

Commit

Permalink
add reciprocal for DC PowerFlow branches
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigomha committed Aug 6, 2024
1 parent 518b14d commit 23d0162
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/post_processing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -496,14 +496,10 @@ function _allocate_results_data(
Q_from_to_vect = zeros(length(branches))
P_to_from_vect = zeros(length(branches))
Q_to_from_vect = zeros(length(branches))
# branch_flow_values is always from_to direction
for i in 1:length(branches)
if branch_flow_values[i] >= 0
P_from_to_vect[i] = branch_flow_values[i]
P_to_from_vect[i] = 0
else
P_from_to_vect[i] = 0
P_to_from_vect[i] = branch_flow_values[i]
end
P_from_to_vect[i] = branch_flow_values[i]
P_to_from_vect[i] = -branch_flow_values[i]
end

bus_df = DataFrames.DataFrame(;
Expand Down

0 comments on commit 23d0162

Please sign in to comment.