-
Notifications
You must be signed in to change notification settings - Fork 44
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
trans rewrite #187
trans rewrite #187
Conversation
Codecov Report
@@ Coverage Diff @@
## master #187 +/- ##
==========================================
- Coverage 89.93% 88.41% -1.53%
==========================================
Files 39 39
Lines 4013 4056 +43
==========================================
- Hits 3609 3586 -23
- Misses 404 470 +66
Continue to review full report at Codecov.
|
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.
Overall this is a really good cleanup. I have some relatively minor items that I think should be addressed, and a line should be added to the changelog, but otherwise I think this is in good shape
@sanderclaeys to address the point you bring up for discussion about whether oltc should be specified when instantiating a problem definition or by the data model, I personally am inclined towards your preference of specifying this in the data. As long as this feature is well documented I don't think there should be any problem. That being said, I think that this issue should be left to a separate PR after this and #150 are resolved, when we revisit the problem definitions in the very near future |
Sounds good, I will create an issue for this as a reminder. Also, the transformer code now implicitly assumes that each conductor is also a phase; this code will break for 4-wire systems, where the neutral is part of |
I rewrote the transformer methods as preparation for the convex relaxations of transformers and OLTC. Like this the ACP formulation is more readable, and it will fit the relaxations better as well.
The dispatch to OLTC or fixed transformer might need some discussion.
For me, the default problem should include OLTCs. If the user does not want OLTCs, she should fix the taps in the data model. The formulations should then resort automatically to the simplified equations instead for fixed taps. Last time, I remember there was some preference for ignoring the
fixed
setting and instead considering it as fixed in most problem definitions. I considered both by implementing the following logic.constraint_mc_oltc
in the constraint template callsconstraint_mc_trans_yy
orconstraint_mc_trans_dy
depending on the winding types, and passes thefixed
parameter of the data model. These methods are OLTC ready, and can simplify the equations when all/some of the taps are fixed.constraint_mc_trans
is identical toconstraint_mc_oltc
, but ignores the data model and passes a vector of ones, indicating all taps are fixed toconstraint_mc_trans_yy
andconstraint_mc_trans_dy
.This achieves a good balance between code duplication, readability and exploiting fixed variables to reduce the complexity where possible.