Skip to content

Added functions to print jacobian matrix in COO to matrix market #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

shakedregev
Copy link
Collaborator

@shakedregev shakedregev commented Apr 29, 2025

Description

This is a new feature that enables exporting ScaleMicrogrid examples of arbitrary size for testing.

Proposed changes

The functions work as intended and the rest of the code is intact. This is a broad fix that can work for other Jacobians or COO matrices.
After running make, in your build directory, run

./examples/ScaleMicrogrid/scalemicrogridarbitrary <N>

For example

./examples/ScaleMicrogrid/scalemicrogridarbitrary 1000

This will generate a linear system with $36N-2$ variables and constraints.

Checklist

Put an x in the boxes that apply. You can also fill these out after creating
the PR. If you're unsure about any of them, don't hesitate to ask. We're here
to help! This is simply a reminder of what we are going to look for before
merging your code.

  • 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.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining
why you chose the solution you did and what alternatives you considered, etc...

@shakedregev shakedregev requested review from pelesh and reid-g April 29, 2025 13:51
@pelesh pelesh added the enhancement New feature or request label Apr 29, 2025
@shakedregev shakedregev force-pushed the shaked/print_jacobian branch from 0811dd3 to 50b60fd Compare May 1, 2025 20:22
@shakedregev shakedregev force-pushed the shaked/print_jacobian branch from 50b60fd to a159e3e Compare May 1, 2025 20:29
pelesh
pelesh previously requested changes May 2, 2025
Copy link
Collaborator

@pelesh pelesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. A few minor changes are recommended for consistency.

@shakedregev shakedregev force-pushed the shaked/print_jacobian branch from 19f2075 to 97bc6ea Compare May 2, 2025 13:25
@shakedregev shakedregev requested a review from pelesh May 2, 2025 13:27
@shakedregev shakedregev force-pushed the shaked/print_jacobian branch from 999f661 to 9c13907 Compare May 2, 2025 14:13
@shakedregev
Copy link
Collaborator Author

shakedregev commented May 2, 2025

After running make, in your build directory, run

./examples/ScaleMicrogrid/scalemicrogridarbitrary <N>

For example

./examples/ScaleMicrogrid/scalemicrogridarbitrary 1000

This will generate a matrix of size $36N-2$

Copy link
Collaborator

@pelesh pelesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be rebased to develop, otherwise good to merge.

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.

2 participants