-
Notifications
You must be signed in to change notification settings - Fork 141
Update DC-OPF with correct PU and additional flow limit constraints #714
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
base: develop
Are you sure you want to change the base?
Conversation
This PR attempts to correct enhance flexibility of per-unit system of units in the DC-OPF and also impose line-flow MW limit constraint to represent thermally constrained lines.
Added base quantity definitions explicitly
Added pu reactance instead of P DC Coefficient
Minor typo fix
Adding transformer details; work in progress
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Added transformer data for HT and LT sides
Added completed transformer details
…on of transformer reactance to line reactance remaining
90f2cdc to
c039a0d
Compare
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.
Hey @sambuddhac, thanks for this PR! I’ve added a few comments to the changes, let me know your thoughts.
I've also rebased the branch onto the current develop.
As a note for the next release: this PR breaks backward compatibility by changing some column names in the Network.csv file used when DC-OPF: 1 (see the tests, for example).
| inputs_nw["pTrans_Max"] = to_floats(:Line_Max_Flow_MW) / scale_factor # convert to GW | ||
| if setup["DC_OPF"] == 1 | ||
| # DC-OPF requires the transmission capacity to be in pu | ||
| inputs_nw["pTrans_Max"] = to_floats(:Line_Max_Flow_MW) / to_floats(:MVA_Base)[1] # convert to GW |
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.
Is using only the first entry of MVA_Base intended?
Also, is the comment # convert to GW still valid?
| inputs_nw["kV_LT"] = to_floats(:Line_Voltage_kV_LT) | ||
| inputs_nw["kV_HT"] = to_floats(:Line_Voltage_kV_HT) | ||
| # Transmission line resistance (in Ohms) - Used when modeling quadratic transmission losses | ||
| inputs_nw["Ohms"] = to_floats(:Line_Resistance_Ohms) | ||
| inputs_nw["Ohms_LT"] = to_floats(:Line_Resistance_Ohms_LT) | ||
| inputs_nw["Ohms_HT"] = to_floats(:Line_Resistance_Ohms_HT) |
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.
Do we need to save these values in the inputs Dict? They don't seem to be used elsewhere in the code.
| println("Total HT reactance in Ohms", total_ht_reactance_txr_line_Ohms) | ||
| println("Total LT reactance in Ohms", total_lt_reactance_txr_line_Ohms) | ||
| #DC-OPF coefficient for each line (in MW when not scaled, in p.u. when scaled) | ||
| inputs_nw["pDC_OPF_coeff_ht"] = 1 ./ (total_ht_reactance_txr_line_system_pu) |
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.
I couldn’t find any usage of pDC_OPF_coeff_ht elsewhere in the code. Was it intended to be used somewhere? Should we remove it?
| total_ht_reactance_ohms = line_transformer_ht_reactance + lt_reactance_referred_to_ht | ||
| #Total HT Reactance in pu | ||
| total_ht_reactance_pu = total_ht_reactance_ohms ./ ht_reactance_Base | ||
| println("P.U. values of Total LT Reactance") |
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.
It would probably be helpful to add some documentation for these equations to make the code easier to follow.
This PR attempts to correct enhance flexibility of per-unit system of units in the DC-OPF and also impose line-flow MW limit constraint to represent thermally constrained lines.
Description
This PR attempts to correct enhance flexibility of per-unit system of units in the DC-OPF and also impose line-flow MW limit constraint to represent thermally constrained lines.
What type of PR is this? (check all applicable)
Related Tickets & Documents
Checklist
How this can be tested
Post-approval checklist for GenX core developers
After the PR is approved