Skip to content

Add hierarchical PhasorDynamics system model with a unit test - #620

Draft
nkoukpaizan wants to merge 5 commits into
developfrom
nicholson/hierarchical-system
Draft

nkoukpaizan wants to merge 5 commits into
developfrom
nicholson/hierarchical-system

Conversation

@nkoukpaizan

@nkoukpaizan nkoukpaizan commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Description

This is an initial implementation for a PhasorDynamics hierarchical system model.
Relates to #604
Relates to #619
The approach taken here is a nested JSON format, and the PR focuses on the system model implementation. For (more) optimal partitioning (e.g., for solvers), this requires a pre-processing step to create this structure (future work).

Proposed changes

  • The key methods enabling the recursion are SystemModel(const SystemModelData<RealT, IdxT>& data, const std::vector<BusT*>& external_buses) and void addSubsystem(SystemModel* subsystem).
  • Only buses are currently supported for interactions between subsystems. Signals will be addressed later.
  • Several methods in the system model (e.g., evaluateResidual()) gain a for (const auto& subsystem : subsystems_) to go down the hierarchy.
  • A unit test exercises the proposed hierarchical system model.
  • Fixed a couple of bugs (e.g., destructor calling and ordering of adding/connectiion components).

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.

Further comments

Draft to initiate a discussion. I have a functional TwoArea case using this approach.
I'll update the CHANGELOG and rebase as this gets closer to ready-to-merge.

cc @Steven-Roberts @alexander-novo @abdourahmanbarry

@nkoukpaizan nkoukpaizan self-assigned this Oct 14, 2026
@nkoukpaizan nkoukpaizan added the enhancement New feature or request label Oct 14, 2026
@nkoukpaizan nkoukpaizan changed the title Nicholson/hierarchical system Add hierarchical PhasorDynamics system model with a unit test Oct 14, 2026
@nkoukpaizan
nkoukpaizan force-pushed the nicholson/hierarchical-system branch from ccd5f58 to f967e96 Compare October 14, 2026 22:30
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.

1 participant