Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds DC Optimal Power Flow (DCOPF) functionality to ExaModelsPower, providing a linearized power flow formulation for testing purposes. The implementation follows the existing patterns in the codebase for polar and rectangular AC OPF formulations.
Key changes:
- Implements DCOPF model with voltage angle variables, active power generation, and active power flow
- Adds Ohm's law constraint for DC approximation using susceptance calculations
- Integrates comprehensive test suite comparing against PowerModels.jl DCPPowerModel results
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/dcopf.jl | New file implementing DCOPF formulation with build_dcopf and dcopf_model functions following the opf.jl pattern |
| src/constraint.jl | Adds c_ohms_law_dcopf constraint function implementing DC power flow equations |
| src/ExaModelsPower.jl | Reorders includes to ensure constraint.jl is loaded before dcopf.jl, enabling constraint function usage |
| test/opf_tests.jl | Adds test_dcopf_case function to validate DCOPF results against PowerModels reference solutions |
| test/runtests.jl | Adds DCOPF test suite covering multiple cases, backends, and precision levels |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## ss/klamke #35 +/- ##
=============================================
+ Coverage 88.92% 89.18% +0.26%
=============================================
Files 8 9 +1
Lines 1282 1313 +31
=============================================
+ Hits 1140 1171 +31
Misses 142 142 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thank you, @klamike |
Not totally sure it makes sense to have it here. But it can be useful to have around for testing.