Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 22 additions & 16 deletions GridKit/Model/PhasorDynamics/Stabilizer/IEEEST/Ieeest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

#pragma once

#include <cstddef>
#include <memory>
#include <vector>
Comment on lines +9 to +11

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.

Pretty sure vector should already be included. Could you comment on the need for cstddef and memory?


#include <GridKit/Model/PhasorDynamics/Component.hpp>
#include <GridKit/Model/PhasorDynamics/ComponentSignals.hpp>
#include <GridKit/Model/VariableMonitor.hpp>
Expand Down Expand Up @@ -119,6 +123,8 @@ namespace GridKit
ScalarT*);

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

RealT A1_{0};
RealT A2_{0};
RealT A3_{0};
Expand All @@ -131,41 +137,41 @@ namespace GridKit
RealT T4_{1};
RealT T5_{0};
RealT T6_{1};
RealT T2_inv_{1};
RealT T4_inv_{1};
RealT T6_inv_{1};
RealT Ks_{1};
RealT Lsmin_{-0.1};
RealT Lsmax_{0.1};
RealT Vcl_{0};
RealT Vcu_{0};
RealT Tdelay_{0};

RealT a0_{1};
RealT a1_{0};
RealT a2_{0};
RealT a3_{0};
RealT a4_{0};

// Precomputed masks and safe inverse coefficients for branch-free degenerate paths.
RealT use_notch_{0};
RealT bypass_notch_{1};
RealT use_4th_order_{0};
RealT use_3rd_order_{0};
RealT use_2nd_order_{0};
RealT safe_inv_a4_{0};
RealT safe_inv_a3_{0};
RealT safe_inv_a2_{0};
RealT use_T2_block_{1};
RealT bypass_T2_block_{0};
RealT use_T4_block_{1};
RealT bypass_T4_block_{0};
RealT use_T6_block_{1};
RealT bypass_T6_block_{0};
IdxT order_{0};
RealT s0_{1};
RealT s1_{0};
RealT s2_{0};
RealT s3_{0};
RealT s4_{0};
RealT a1_inv_{0};
RealT a2_inv_{0};
RealT a3_inv_{0};
RealT a4_inv_{0};

IdxT parameter_error_count_{0};

ComponentSignals<ScalarT, IdxT, IeeestInternalVariables, IeeestExternalVariables> signals_;

std::unique_ptr<MonitorT> monitor_;

void initializeParameters(const ModelDataT& data);
void initializeMonitor();
void setDerivedParameters();

std::vector<ScalarT> ws_;
std::vector<IdxT> ws_indices_;
Expand Down
Loading
Loading