Skip to content

Conversation

@nkoukpaizan
Copy link
Collaborator

@nkoukpaizan nkoukpaizan commented Nov 24, 2025

Description

This adds the ability to run PhasorDynamics examples with sparse Jacobian. The component Jacobians are obtained with Enzyme and assembled into the system Jacobian.

cc @lukelowry @abirchfield

Proposed changes

  • Added missing Jacobian block terms such as $\partial f/\partial y'$, $\partial h/\partial y$ and $\partial f/\partial w_b$
  • Added verification in the unit tests for the $\partial f/\partial y'$ terms
  • Multiple bug fixes

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.

Further comments

This is still using COO_Matrix. I suggest we merge #307 and re-use Jacobian assembly.

Comparison plots between current (sparse Jacobians) and reference (dense Jacobians computed by IDA with finite differences)

ThreeBus_Basic
Example_ThreeBus_Basic_results

ThreeBus_Classical
Example_ThreeBus_Classical_results

TenGenGenrou
TenGenGenrou_Results

TenGenGenClassical
TenGenClassical_results

@nkoukpaizan nkoukpaizan self-assigned this Nov 24, 2025
@nkoukpaizan nkoukpaizan force-pushed the nicholson/sim-with-sparse-jac branch 2 times, most recently from f80e836 to 8a6ddd0 Compare December 18, 2025 21:48
@nkoukpaizan nkoukpaizan force-pushed the nicholson/sim-with-sparse-jac branch 2 times, most recently from 757cbdd to 3bbf8d2 Compare December 22, 2025 16:22
@nkoukpaizan nkoukpaizan force-pushed the nicholson/sim-with-sparse-jac branch from 3bbf8d2 to 3b14dd3 Compare December 22, 2025 16:41
@nkoukpaizan nkoukpaizan force-pushed the nicholson/sim-with-sparse-jac branch from 05e2ddb to 3285026 Compare December 22, 2025 16:46
@nkoukpaizan nkoukpaizan marked this pull request as ready for review December 22, 2025 18:47
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.

Bug: IDA::initializeSimulation errors if t0 is too close to 0.1 and findConsistent is set to true

2 participants