Skip to content

Add Subsystem and Partition Interfaces for PowerElectronics - #560

Open
abdourahmanbarry wants to merge 9 commits into
abdou/clonefrom
abdou/subsystem_model
Open

Add Subsystem and Partition Interfaces for PowerElectronics#560
abdourahmanbarry wants to merge 9 commits into
abdou/clonefrom
abdou/subsystem_model

Conversation

@abdourahmanbarry

Copy link
Copy Markdown
Collaborator

Description

In this PR, we implement SubsystemModel for partitioned Power Electronics simulation. The implementation provides the infrastructure required to partition Power Electronics networks, and to evaluate subsystem residuals and Jacobians independently.

This is the third of four stacked pull requests that split PR #492 into simpler, more manageable chunks.

Proposed changes

We added a SubsystemModel class to represent an individual partition and a BusPartitionInterface component to mark partition boundaries. Together, these enable us to partition larger networks for co-simulation and parallel function evaluation.

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.
  • The CHANGELOG.md has been updated to reflect the changes. If this is a minor PR that is part of a larger fix already included in the file, state so.

@abdourahmanbarry abdourahmanbarry self-assigned this Aug 28, 2026
@nkoukpaizan nkoukpaizan added the enhancement New feature or request label Sep 3, 2026

@superwhiskers superwhiskers 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.

just an architectural question

Comment on lines +27 to +50
/**
* @brief Represents a subset of a PowerElectronicsModel that can be evaluated
* independently.
*
* A SubsystemModel contains a collection of existing GridKit components and
* nodes taken from a larger system. Variables owned by those components and
* nodes become internal variables of the subsystem. Variables needed by those
* components but owned outside the subsystem become external coupling
* variables.
*
* Components normally store connection indices in the global system indexing.
* During subsystem allocation, these indices are temporarily replaced with a
* contiguous local subsystem indexing so that the subsystem can be evaluated
* like an independent PowerElectronicsModel.
*
* External coupling values must be supplied before residual or Jacobian
* evaluation, either directly through the external-data vectors or through a
* forcing function.
*
* @todo Find a better name for this class and its base class.
*
* @tparam ScalarT Scalar type used by the model.
* @tparam IdxT Index type used for variable and connection indices.
*/

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.

so, my main question here is why do we need this notion of distinct "systems" and "subsystems" present in the codebase?

when first learning about system partitioning stuff in gridkit, it seemed more natural to me to instead allow the system itself to be a component that can be used in another system. the "non-owning" nature of SubsystemModel as implemented here seems like it could be more naturally captured by a SystemModelRef or some similar type that encapsulates the notion of "referencing" a system model or something like that (perhaps to match the bus partition interface thing for components---SystemModelInterface).

what was the motivation behind this design choice? it seems more natural to build up from smaller components than to break apart.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants