feat: enable differential pmin/pmax for DC lines #91
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.
Purpose
Interpret the Pmin and Pmax of DC lines, don't assume symmetry using just the Pmax.
Closes #87.
What is the code doing
Walking through in order of execution:
Case
struct, which will get created based on what we got in read.jl._make_sets
, we change how we build thenoninf_branch_idx
set, since we now havecase.dcline_pmax
andcase.dcline_pmin
instead ofcase.dcline_rating
. We also make sure that we do the replacement of0
capacity ->Inf
for AC lines only, not DC lines (since we may have a DCline with e.g. -100 Pmin and 0 Pmax).-build_model
, we use the newcase.dcline_pmin
andcase.dcline_pmax
to create separate branch limits for + and -:branch_pmin
andbranch_pmax
instead of the previous symmetricbranch_rating
. Then, we use these in building the constraints.Testing
This is provisional code. I've done some limited local testing (thanks to the command-line extract_data.py options from @ahurli, see #75), and this appears to work properly on symmetrical DC lines for existing scenarios. I still need to do testing for asymmetrical lines, but I'm reasonably confident in this code, since the changes are fairly straightforward.
Time to review
15 minutes. The code changes are minor but meaningful.