Handling of zero input parameters

Open
#530 4 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@lukelowry is already working on this.

Since Aug 10, 2026.

Assessment

This issue has not been assessed yet.

Description

cleanup question

Several phasor dynamics models currently use != 0, == 0, != ZERO<RealT> or == ZERO<RealT> for some input parameters to enable/disable some features. This is ill advised for floating point values.

The models currently affected are:

  • ESDC1A
  • HYGOV
  • IEEEST
  • IEEET1
  • REECB
  • REPCA

isEqual with a tolerance or splitting == into isfinite(), <= and >= are inadequate here. The desired behavior really is to check if the value is zero, and the underlying purpose is to enable/disable some options.

One proposed solution is to expose the enabled/disabled options directly as integers (e.g., order for a stabilizer or booleans (e.g. saturation_disabled for an exciter). While this duplicates some information in the input file, this should make the model implementation cleaner. As long as the enabled/disabled features don't change during the simulation, it can be argued that we are mathematically dealing with different models.

cc @pelesh @superwhiskers

Dominant language
C++
Stars
27
Forks
11
Avg merge
2d 21h
Merged PRs (30d)
15

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ORNL/GridKit

All issues in ORNL/GridKit

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.