Skip to content

Comments

Add DCOPF#35

Merged
sshin23 merged 6 commits intoMadNLP:ss/klamkefrom
klamike:mk/dcopf
Jan 8, 2026
Merged

Add DCOPF#35
sshin23 merged 6 commits intoMadNLP:ss/klamkefrom
klamike:mk/dcopf

Conversation

@klamike
Copy link
Contributor

@klamike klamike commented Dec 17, 2025

Not totally sure it makes sense to have it here. But it can be useful to have around for testing.

Copilot AI review requested due to automatic review settings December 17, 2025 23:32
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.18%. Comparing base (1663aa0) to head (bc0abbd).
⚠️ Report is 1 commits behind head on ss/klamke.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sshin23 sshin23 changed the base branch from main to ss/klamke January 8, 2026 19:59
@sshin23 sshin23 merged commit 22ce1e9 into MadNLP:ss/klamke Jan 8, 2026
4 checks passed
@sshin23
Copy link
Member

sshin23 commented Jan 8, 2026

Thank you, @klamike

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants