Skip to content

Add automatic CSR Jacobian construction with DependencyTracking in PhasorDyanmics - #574

Open
nkoukpaizan wants to merge 12 commits into
developfrom
nicholson/dependency-tracking-dev
Open

Add automatic CSR Jacobian construction with DependencyTracking in PhasorDyanmics#574
nkoukpaizan wants to merge 12 commits into
developfrom
nicholson/dependency-tracking-dev

Conversation

@nkoukpaizan

@nkoukpaizan nkoukpaizan commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Description

This adds the ability to automatically construct CSR Jacobian with DependencyTracking in PhasoDyanmics

Proposed changes

  • Added initializeDependencyTrackingVariableNumbers, with even number for y and odd numbers for yp. This allows tracking both in a single evaluateResidual(). This is called at the end of initialize().
  • Added constructCsrFromDependencies() that builds/updates CSR matrices for DependencyTracking::Variable. This is only supported by components and SystemModel (not buses).
  • Updated the component and SystemModel evaluateJacobian() method in the *DependencyTracking.cpp files accordingly.
  • Updated setpoints (*_set member variables) to discard the initialization dependencies with static_cast<RealT>
  • Updated the tests accordingly. Now, DependencyTrackingJacobian test methods call evaluateJacobian and getCsrJacobian instead of locally constructing.
  • I left a few ad-hoc tests in, with @todo notes to remove the explicit variable numbers.

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

@nkoukpaizan nkoukpaizan self-assigned this Sep 9, 2026
@nkoukpaizan
nkoukpaizan marked this pull request as ready for review September 9, 2026 21:08
@nkoukpaizan nkoukpaizan changed the title Add ability to automatically construct CSR Jacobian with DependencyTracking in PhasoDyanmics Add automatic CSR Jacobian construction with DependencyTracking in PhasorDyanmics Sep 9, 2026
@nkoukpaizan
nkoukpaizan force-pushed the nicholson/dependency-tracking-dev branch from b162c0d to d2f982e Compare September 12, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant