Skip to content

IEEEST Stabilizer Improvements/Corrections - #460

Closed
lukelowry wants to merge 9 commits into
developfrom
lukel/ieeest-dev
Closed

lukelowry wants to merge 9 commits into
developfrom
lukel/ieeest-dev

Conversation

@lukelowry

@lukelowry lukelowry commented Jun 22, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Fixes and cleans up the IEEEST stabilizer implementation and documentation.

This updates the older initial implementation style so that reduced-order notch filters and zero denominator time constants are handled consistently

Proposed changes

  • Replace the branchy/safe-inverse notch logic with a fixed DAE form using differential tags.
  • Initialize IEEEST from the attached input signal instead of forcing all states to zero.
  • Document the implemented equations, initialization, derived parameters, and unsupported compatibility parameters.
  • Tests for initialization, residuals, invalid wiring, invalid notch parameters, zero time constants, and Jacobian consistency.

Checklist

  • All tests pass for the focused PhasorDynamics coverage.
  • 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.

Changelog changes N/A

Further comments

This is cleanup/correction work for the existing IEEEST model, not a new model

@lukelowry
lukelowry marked this pull request as ready for review June 22, 2026 18:43
@lukelowry

Copy link
Copy Markdown
Collaborator Author

@pelesh this fix is also ready to be merged I forgot to make a PR for this one.

@pelesh pelesh left a comment

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 logic governing changing differential into algebraic equations and vice versa does not seem to be sustainable. This requires more offline discussion.

Comment thread GridKit/Model/PhasorDynamics/Stabilizer/IEEEST/IeeestImpl.hpp Outdated
Comment thread GridKit/Model/PhasorDynamics/Stabilizer/IEEEST/IeeestImpl.hpp Outdated
Comment thread GridKit/Model/PhasorDynamics/Stabilizer/IEEEST/IeeestImpl.hpp Outdated
@lukelowry
lukelowry force-pushed the lukel/ieeest-dev branch 2 times, most recently from 8bbbad6 to 090289b Compare June 26, 2026 11:02
@lukelowry

Copy link
Copy Markdown
Collaborator Author

I have rebased and adjusted the formulation to align with #463 .

@nkoukpaizan nkoukpaizan left a comment

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 have a few comments here. Perhaps worth discussing at our next meeting.

Comment thread GridKit/Model/PhasorDynamics/Stabilizer/IEEEST/IeeestImpl.hpp Outdated
Comment thread GridKit/Model/PhasorDynamics/Stabilizer/IEEEST/IeeestImpl.hpp Outdated
Comment thread tests/UnitTests/PhasorDynamics/StabilizerIeeestTests.hpp Outdated
Comment thread GridKit/Model/PhasorDynamics/Stabilizer/IEEEST/IeeestImpl.hpp Outdated
Comment thread GridKit/Model/PhasorDynamics/Stabilizer/IEEEST/IeeestImpl.hpp
using Variable = typename ModelDataT::MonitorableVariables;
monitor_->set(Variable::vss, [this]
{ return y_[11]; });
auto index = [](IeeestInternalVariables variable)

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've seen this pattern a few times. Consider defining once if it is really needed. I would argue it's less readable.

Comment thread tests/UnitTests/PhasorDynamics/runStabilizerIeeestTests.cpp
Comment thread GridKit/Model/PhasorDynamics/Stabilizer/IEEEST/Ieeest.hpp
Comment thread GridKit/Model/PhasorDynamics/Stabilizer/IEEEST/IeeestImpl.hpp Outdated
Comment thread tests/UnitTests/PhasorDynamics/StabilizerIeeestTests.hpp Outdated
@lukelowry

Copy link
Copy Markdown
Collaborator Author

Testing Ground for template parameters <Order N>

@lukelowry lukelowry added this to the WECC Completion milestone Jul 2, 2026
@lukelowry

Copy link
Copy Markdown
Collaborator Author

general implementation of the template parameter done

@nkoukpaizan nkoukpaizan added enhancement New feature or request cleanup labels Jul 10, 2026
@lukelowry
lukelowry force-pushed the lukel/ieeest-dev branch 4 times, most recently from d0dc95a to d2be200 Compare July 17, 2026 21:58
@lukelowry

Copy link
Copy Markdown
Collaborator Author

@nkoukpaizan what are your thoughts on my template implementation?

@nkoukpaizan

Copy link
Copy Markdown
Collaborator

@nkoukpaizan what are your thoughts on my template implementation?

The model implementation is cleaner with the order as a template parameter. However, the order remains a runtime selection based on floating point comparisons, which is what I wanted to avoid.

@lukelowry

Copy link
Copy Markdown
Collaborator Author

@nkoukpaizan we could possibly require the order to be passed as a parameter of IEEEST model, would that resolve your concern?

"Order" is not usually directly exposed as a model parameter and so would require some knowledge of how IEEEST works to pass valid parameters.

Can you give an example where the runtime comparison is bad/fails? I might be able to resolve both our concerns if I understand better.

@nkoukpaizan

Copy link
Copy Markdown
Collaborator

@nkoukpaizan we could possibly require the order to be passed as a parameter of IEEEST model, would that resolve your concern?

"Order" is not usually directly exposed as a model parameter and so would require some knowledge of how IEEEST works to pass valid parameters.

Can you give an example where the runtime comparison is bad/fails? I might be able to resolve both our concerns if I understand better.

Yes, exposing the order as a parameter to the model is what I had in mind. Understood that that's not the domain practice. That's why as was asking whether this is possible as a question.

Floating point values are stored with limited precision. We'd have to guarantee that the value returned by the parser is bit-for-bit equal to zero. That may be the case for nlohmann-json, but considering #227 and the possibility of using a different parser, that's not guaranteed.

@lukelowry

Copy link
Copy Markdown
Collaborator Author

@nkoukpaizan i see the issue now thank you, that was very clarifying. After reflecting on my past experience and discussing with others at TAMU, I think deriving the order from the parameters alone is not intuitive or safe, either.

As discussed, we should add an integer parameter to the IEEEST model, "order" and use that for the StabilizerFactory (rename to IeeestFactory). Then, our parameter validation can gate for zero division relevant to each static order (e.g. $A_2 + A_3&gt;0$). Additionally the model json may then contain some coefficients that are only used at a certain "order", which would be a feature IMO since you can retain information needed for higher order but choose to operate at smaller order.

I will make this change then we can reasess.

@lukelowry
lukelowry marked this pull request as draft September 1, 2026 16:03
@lukelowry
lukelowry force-pushed the lukel/ieeest-dev branch 4 times, most recently from bf71cd5 to 07d0236 Compare September 6, 2026 07:08
void initializeMonitor();
void setDerivedParameters();

static constexpr RealT TIME_CONSTANT_MINIMUM = static_cast<RealT>(1.0e-3);

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.

it looks like this same constant is duplicated across many header files. is there any reason it cannot be placed in a more "global" place so we aren't copy-pasting it all over?

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.

Consolidating is desirable and possible. But at this point, it's still not clear that we want to maintain this minimum time constant.

@lukelowry
lukelowry force-pushed the lukel/ieeest-dev branch 2 times, most recently from 1d70ce7 to 87c2bd1 Compare September 13, 2026 01:36
@pelesh pelesh removed this from the WECC Completion milestone Sep 17, 2026
@lukelowry
lukelowry force-pushed the lukel/ieeest-dev branch 3 times, most recently from a7c98fd to 258187d Compare September 22, 2026 03:02

@superwhiskers superwhiskers left a comment

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.

nothing significant, just some additional comments & suggestions

Comment on lines +24 to +26
template <typename scalar_type, typename index_type>
class SignalNode;

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.

why are we forward declaring this here?


Ieeest();
Ieeest(const ModelDataT& data);
explicit Ieeest(const ModelDataT& data);

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.

just curious what motivated this adjustment here

Comment on lines +96 to +103
auto check = [&](bool condition, const char* message)
{
if (!condition)
{
Log::error() << "Ieeest: " << message << '\n';
ret += 1;
}
};

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.

may be worthwhile building on top of your #566 pull request. could rebase this upon that branch

Comment thread GridKit/Model/PhasorDynamics/Stabilizer/IEEEST/IeeestImpl.hpp Outdated
@lukelowry
lukelowry force-pushed the lukel/ieeest-dev branch 3 times, most recently from 1a1c488 to 0c6efb2 Compare October 7, 2026 20:26
@lukelowry

Copy link
Copy Markdown
Collaborator Author

Closing and continuing in fresh PR #617 for sanity and clarity per @pelesh

@lukelowry lukelowry closed this Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants