Skip to content

Initial Implementation of Subsystem Model for Partition Simulation - #492

Open
abdourahmanbarry wants to merge 53 commits into
developfrom
abdou/partitioning_microgrid
Open

Initial Implementation of Subsystem Model for Partition Simulation#492
abdourahmanbarry wants to merge 53 commits into
developfrom
abdou/partitioning_microgrid

Conversation

@abdourahmanbarry

@abdourahmanbarry abdourahmanbarry commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Description

In this PR, we introduce the initial implementation of the SubsystemModel for partitioned Power Electronics simulation. The implementation provides the infrastructure required to partition Power Electronic networks, and to evaluate subsystem residuals and Jacobians independently. This lays the foundation for implementing co-simulation methods in future pull requests.

Proposed changes

  • We added a SubsystemModel class to represent an individual partition and a BusPartitionInterface component to mark partition boundaries.
  • Implemented residual and Jacobian evaluation for subsystem models.
  • Added support for user-defined coupling functions required for solving subsystems with multi-stage co-simulation methods.

Checklist

  • All tests pass.
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • The new code follows GridKit™ style guidelines.
  • There are unit tests for the new code.
  • The new code is documented.
  • The feature branch is rebased with respect to the target branch.
  • I have updated CHANGELOG.md to reflect the changes in this PR. If this is a minor PR that is part of a larger fix already included in the file, state so.

@abdourahmanbarry
abdourahmanbarry force-pushed the abdou/partitioning_microgrid branch from 85a516d to 01a410b Compare July 19, 2026 08:27
@abdourahmanbarry abdourahmanbarry self-assigned this Jul 23, 2026
@abdourahmanbarry
abdourahmanbarry force-pushed the abdou/partitioning_microgrid branch from 66c58ad to b48a401 Compare July 24, 2026 02:46
@abdourahmanbarry
abdourahmanbarry force-pushed the abdou/partitioning_microgrid branch from a375b1f to f65baeb Compare August 3, 2026 05:16
@abdourahmanbarry
abdourahmanbarry marked this pull request as ready for review August 6, 2026 05:57
@abdourahmanbarry

Copy link
Copy Markdown
Collaborator Author

This pull request is ready for review.

@pelesh pelesh added enhancement New feature or request new solver labels Aug 7, 2026
@pelesh pelesh added this to the Release 0.3 milestone Aug 7, 2026
Comment thread examples/PowerElectronics/Partition/CMakeLists.txt Outdated
Comment thread examples/PowerElectronics/Partition/HiresBus.hpp Outdated
Comment thread examples/PowerElectronics/Partition/HiresBus.hpp Outdated
Comment thread examples/PowerElectronics/Partition/Partition.cpp Outdated
Comment thread examples/PowerElectronics/Partition/Partition.cpp Outdated
Comment thread GridKit/Model/PowerElectronics/SubsystemModel.hpp
Comment thread GridKit/Model/PowerElectronics/SubsystemModel.hpp Outdated
Comment thread GridKit/Model/PowerElectronics/SubsystemModel.hpp Outdated
Comment thread GridKit/Model/PowerElectronics/SubsystemModel.hpp Outdated
Comment thread GridKit/Model/PartitionEvaluator.hpp Outdated
@abdourahmanbarry
abdourahmanbarry force-pushed the abdou/partitioning_microgrid branch from e96184a to 98be2e0 Compare August 11, 2026 18:28
@abdourahmanbarry
abdourahmanbarry force-pushed the abdou/partitioning_microgrid branch from 98be2e0 to f082543 Compare August 11, 2026 18:52
Comment thread examples/PowerElectronics/Partition/PartitionHires.cpp Outdated

@nkoukpaizan nkoukpaizan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I few initial comments on the Hires example. I'll take a closer look at the partition interface after comments by @alexander-novo have been addressed.

Comment thread examples/PowerElectronics/Partition/HiresBus.hpp Outdated
Comment thread examples/PowerElectronics/Partition/HiresBus.hpp Outdated
Comment thread examples/PowerElectronics/Partition/jac_test_helper.hpp Outdated
Comment thread examples/PowerElectronics/Common/JacTestHelper.hpp
Comment thread examples/PowerElectronics/Partition/PartitionHires.cpp Outdated
Comment thread examples/PowerElectronics/Partition/PartitionHires.cpp Outdated
Comment thread examples/PowerElectronics/Partition/CMakeLists.txt Outdated
Comment thread examples/PowerElectronics/Partition/PartitionHires.cpp Outdated
Comment thread examples/PowerElectronics/Partition/PartitionHires.cpp Outdated
Comment thread GridKit/Model/PowerElectronics/PartitionInterface/CMakeLists.txt Outdated
- add documentation for hires problem and partitioning
- test subsystem jacobian and residuals
- Update CMake file
- Add comments to methods and lambda functions
- added check to ensure only allocated components can be added to model
- Change parameter type in addInterface method to PartitionInterface
- Partition interface can be applied to all bus types, not just MicrogridBus
- New clone functionality  allows users to pass components directly without explicitly copying it
- Update CMake file with dense vector dependency
- Add more documentation
- Move  suitable code from constructor to allocate
- move microgrid network builder section to separate file to facilitate code reuse as more examples dependent on it
- Add partition utility code to minimize code duplication in partition examples.
- Added all helper header files in one location
- Remove remaining Hires example files from Partition folder
- Refactored common code in the Microgrid, ScaleMicrogrid, and ScaleMicrogridArbitrary examples into reusable helper functions
- Improved documentation across the PowerElectronics examples
- Updated CMake files
- Minor format changes
- Updated tests and added documentation for partition interface and SubsystemModel
-  Used size_t for some loops in CircuitComponent
@pelesh
pelesh requested a review from hambrickjc August 17, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request new solver

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants