Skip to content

Refactor Jacobian assembly#339

Open
KakeruUeda wants to merge 6 commits intodevelopfrom
kakeru/csr-jac
Open

Refactor Jacobian assembly#339
KakeruUeda wants to merge 6 commits intodevelopfrom
kakeru/csr-jac

Conversation

@KakeruUeda
Copy link
Collaborator

@KakeruUeda KakeruUeda commented Feb 13, 2026

Description

Jacobian assembly currently uses a COO matrix, and we sort and rebuild CSR row pointers each step for IDA. The overhead from this process can become a bottleneck as nnz grows. This change keeps the system Jacobian in CSR and preserves a COO→CSR mapping for direct CSR updates.

Closes #301

cc @nkoukpaizan

Proposed changes

  • Store the system Jacobian in CSR format in PowerElectronicsModel.
  • Update allocate() to populate CSR entries and preserve the mapping.
  • Add CsrJac for the solver configuration (PhasorDynamics still uses the Jac function).

Currently PowerElectronics only.

Checklist

  • All tests pass.
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • The new code follows GridKit™ style guidelines.
  • [N/A] There are unit tests for the new code.
  • The new code is documented.
  • [N/A] 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.

@KakeruUeda KakeruUeda self-assigned this Feb 14, 2026
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.

Implement analysis in SystemModelPowerElectronics class to compute system Jacobian sparsity pattern

1 participant