Skip to content

B szymanowski/initialize monitors#343

Draft
BSzymanowski wants to merge 9 commits intodevelopfrom
BSzymanowski/initializeMonitors
Draft

B szymanowski/initialize monitors#343
BSzymanowski wants to merge 9 commits intodevelopfrom
BSzymanowski/initializeMonitors

Conversation

@BSzymanowski
Copy link
Collaborator

Description

Added outputs for initializeMonitor(); returns the value of the monitored variable.

Proposed changes

Return statements added for each monitored variable. The final value for that variable is now returned.

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

Kindly provide comments so that I may change the code if necessary.

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.

Nice work! Please update README files with documentation on outputs.

Comment on lines +303 to +308
monitor_->set(Variable::im1, [this]
{ return std::sqrt(Ir1() * Ir1() + Ii1() * Ii1()); });
monitor_->set(Variable::p1, [this]
{ return Vr1() * Ir1() + Vi1() * Ii1(); });
monitor_->set(Variable::q1, [this]
{ return Vi1() * Ir1() - Vr1() * Ii1(); });
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add section "Model Outputs" to the branch model README file and describe all outputs there. Please explain how active and reactive power are computed and what is the sign convention.

Comment on lines +438 to +439
monitor_->set(Variable::ksat, [this]
{ return SB_ * (((y_[2] - SA_) * Math::sigmoid(y_[2] - SA_)) * ((y_[2] - SA_) * Math::sigmoid(y_[2] - SA_))); });
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add section "Model Outputs" to the exciter model README file and describe all outputs there. Please explain how saturation is computed.

Comment on lines +143 to +146
monitor_->set(Variable::p, [this]
{ return Vr() * Ir() + Vi() * Ii(); });
monitor_->set(Variable::q, [this]
{ return Vi() * Ir() - Vr() * Ii(); });
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add section "Model Outputs" to the generator model README file and describe all outputs there. Please explain how active and reactive power are computed and what is the sign convention.

Comment on lines +288 to +291
monitor_->set(Variable::p, [this]
{ return Vr() * Ir() + Vi() * Ii(); });
monitor_->set(Variable::q, [this]
{ return Vi() * Ir() - Vr() * Ii(); });
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add section "Model Outputs" to the generator model README file and describe all outputs there. Please explain how active and reactive power are computed and what is the sign convention.

@pelesh pelesh added documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers labels Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants