-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DNMY] Support in the loop PowerFlow evaluation #1040
Draft
jd-lara
wants to merge
50
commits into
main
Choose a base branch
from
jd/pf_integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
1c30601
add PFS deps
jd-lara 0bcb68e
make time_steps consistent
jd-lara cac31f2
add PowerFlows
jd-lara 1b7d415
add new aux variables for power flow
jd-lara 02c52ed
make time steps consistent
jd-lara 1e71c06
fix failing test
jd-lara a94defb
add power flow evaluator to model and container
jd-lara d1336c0
add evaluation in initialization
jd-lara 7d1b0d2
add code for evaluation
jd-lara c4071f4
add missing kwarg
jd-lara 61ee4b5
fix incorrect var type
jd-lara 3b31d02
fix old bug
jd-lara 347b67c
update aux vars for power flow evaluation
jd-lara 5606f65
WIP: function for the power flow evaluation
jd-lara e8caaca
whitespace
jd-lara 198e7b4
Merge branch 'main' into jd/pf_integration
jd-lara bf872ca
bump deps
jd-lara 4e0f8ee
change to varnames
jd-lara 7a2555a
add auxiliary variables
jd-lara d95ef9e
add wrapper for power flow data
jd-lara d2b26ac
use wrapper
jd-lara ddb92e3
add powerflow wrapper
jd-lara 33bd977
power flow rename
jd-lara 2645ced
file rename
jd-lara c997e2f
add evaluation to the container
jd-lara 1ba76cb
WIP: add functions to map results to pf
jd-lara c11f4cf
Merge branch 'psy4' into jd/pf_integration
jd-lara 4fcfa16
Merge branch 'main' into jd/pf_integration
GabrielKS b26e2b0
Remove redundant code
GabrielKS 54e4859
Rewrite power flow evaluation to support more types of power flow
GabrielKS 1e714ac
Support evaluation of multiple power flows in the loop
GabrielKS 508db25
Better accommodate `PSSEExporter` in the loop, reduce duplication
GabrielKS b6fc453
Trait-based special behavior for power flow aux vars
GabrielKS eb51cfb
Scaffold subtype-based updating of power flow aux vars
GabrielKS dfd7405
Update power flow aux vars from `PowerFlowData`
GabrielKS c0ac0be
Complete prototype power flow in the loop -> export implementation
GabrielKS 9e1f30a
Power flow in the loop: handle load special cases
GabrielKS 1507b14
Power flow in the loop: support multi period export
GabrielKS 9ec1356
Misc code cleanup following self-review
GabrielKS ad25918
Add basic tests of power flow in the loop
GabrielKS 958e68d
Update `DISABLED_TEST_FILES`
GabrielKS 187f473
Merge branch 'main' into jd/pf_integration
GabrielKS e016521
PERF: don't use `get_bus(sys, number)`, it's O(n)
GabrielKS 30454e6
Add aux vars, infrastructure to receive results from AC power flow
GabrielKS a242ddf
Fix `bus_activepower_withdrawals` sign error
GabrielKS f5eb983
Merge branch 'main' into jd/pf_integration
jd-lara 670d4fc
Fix merge, update dependencies
GabrielKS 3e091c4
Power flow in the loop: support `exporter` kwarg interface
GabrielKS d5e6fab
Rewrite PSI -> PF mapping for more flexibility
GabrielKS b0ba0d6
Add `TimerOutputs.@timeit` for PF in the loop
GabrielKS File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
mutable struct PowerFlowEvaluationData{T <: PFS.PowerFlowContainer} | ||
power_flow_data::T | ||
""" | ||
Records which PSI keys are read as input to the power flow and how the data are mapped. | ||
The Symbol is a category of data: `:active_power`, `:reactive_power`, etc. The | ||
`OptimizationContainerKey` is a source of that data in the `OptimizationContainer`. For | ||
`PowerFlowData`, leaf values are `Dict{String, Int64}` mapping component name to matrix | ||
index of bus; for `SystemPowerFlowContainer`, leaf values are Dict{Union{String, Int64}, | ||
Union{String, Int64}} mapping component name/bus number to component name/bus number. | ||
""" | ||
input_key_map::Dict{Symbol, <:Dict{<:OptimizationContainerKey, <:Any}} | ||
is_solved::Bool | ||
end | ||
|
||
function PowerFlowEvaluationData(power_flow_data::T) where {T <: PFS.PowerFlowContainer} | ||
return PowerFlowEvaluationData{T}( | ||
power_flow_data, | ||
Dict{Symbol, Dict{OptimizationContainerKey, <:Any}}(), | ||
false, | ||
) | ||
end | ||
|
||
get_power_flow_data(ped::PowerFlowEvaluationData) = ped.power_flow_data | ||
get_input_key_map(ped::PowerFlowEvaluationData) = ped.input_key_map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separate dicts for active and reactive power, basically. There were other ways to do it but I think this is the most natural.