Skip to content

Initial mu configurability - #569

Closed
lukelowry wants to merge 2 commits into
developfrom
lukel/mu-control-dev
Closed

Initial mu configurability#569
lukelowry wants to merge 2 commits into
developfrom
lukel/mu-control-dev

Conversation

@lukelowry

Copy link
Copy Markdown
Collaborator

Description

This is an initial, intentionally small change to make the CommonMath smoothing scale runtime-configurable. PhasorDynamics studies can now set mu ($\mu$) in a .solver.json file, allowing parameter studies without rebuilding GridKit for every value.

Proposed changes

  • Add an optional mu with the existing 240.0 default
  • Require mu to be positive and finite
  • Apply it before model construction and contingency workers
  • Document the setting and add runtime behavior coverage

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.
  • N/A The CHANGELOG.md has been updated to reflect the changes.

Further comments

This is not the best long-term API for configuring $\mu$ at runtime, but without this, the results of our paper are very hard to reproduce without a development environment. For that reason, I would like to have this in before we do the first release.

Comment thread GridKit/CommonMath.hpp
Comment on lines +22 to +28
* @warning Process-wide setting; configure before constructing models or
* launching workers.
*
* @tparam RealT - real data type
*/
template <typename RealT>
inline constexpr RealT MU = 240.0;
inline RealT MU = DEFAULT_MU<RealT>;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think we can merge this, even as a temporary solution. The provenance of the value used will be very hard to establish.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I cannot think of an alternative that would be a small change. I would love to have this for the purpose of the paper, but I see the issue.

Unless you have any ideas on how to do this safely, I will close this

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The ideas I have require widespread changes. We can close for now and keep tracking in #504.

@nkoukpaizan nkoukpaizan added the enhancement New feature or request label Sep 4, 2026
@lukelowry
lukelowry force-pushed the lukel/mu-control-dev branch 2 times, most recently from 79ae81e to dd96f51 Compare September 8, 2026 00:24
@lukelowry lukelowry closed this Sep 8, 2026
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