-
Notifications
You must be signed in to change notification settings - Fork 11
IEEEST Stabilizer Improvements/Corrections #460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
866a258
5ee050f
8e91ad7
392abed
65a4bf0
1c13225
022e22f
1d7b880
258187d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,11 @@ | |
|
|
||
| #pragma once | ||
|
|
||
| #include <cstddef> | ||
| #include <memory> | ||
| #include <vector> | ||
|
|
||
| #include <GridKit/Definitions.hpp> | ||
| #include <GridKit/Model/PhasorDynamics/Component.hpp> | ||
| #include <GridKit/Model/PhasorDynamics/SignalNode/SignalNodeSet.hpp> | ||
| #include <GridKit/Model/PhasorDynamics/SignalPorts.hpp> | ||
|
|
@@ -16,6 +21,9 @@ namespace GridKit | |
| { | ||
| namespace PhasorDynamics | ||
| { | ||
| template <typename scalar_type, typename index_type> | ||
| class SignalNode; | ||
|
|
||
|
Comment on lines
+24
to
+26
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why are we forward declaring this here? |
||
| namespace Stabilizer | ||
| { | ||
| /// Internal variables of `Ieeest` | ||
|
|
@@ -44,41 +52,42 @@ namespace GridKit | |
| template <typename scalar_type, typename index_type> | ||
| class Ieeest : public Component<scalar_type, index_type> | ||
| { | ||
| using Component<scalar_type, index_type>::gridkit_component_id_; | ||
| using Component<scalar_type, index_type>::abs_tol_; | ||
| using Component<scalar_type, index_type>::allocated_; | ||
| using Component<scalar_type, index_type>::alpha_; | ||
| using Component<scalar_type, index_type>::f_; | ||
| using Component<scalar_type, index_type>::gridkit_component_id_; | ||
| using Component<scalar_type, index_type>::J_cols_buffer_; | ||
| using Component<scalar_type, index_type>::J_rows_buffer_; | ||
| using Component<scalar_type, index_type>::J_vals_buffer_; | ||
| using Component<scalar_type, index_type>::nnz_; | ||
| using Component<scalar_type, index_type>::residual_indices_; | ||
| using Component<scalar_type, index_type>::size_; | ||
| using Component<scalar_type, index_type>::tag_; | ||
| using Component<scalar_type, index_type>::abs_tol_; | ||
| using Component<scalar_type, index_type>::time_; | ||
| using Component<scalar_type, index_type>::variable_indices_; | ||
| using Component<scalar_type, index_type>::wb_; | ||
| using Component<scalar_type, index_type>::y_; | ||
| using Component<scalar_type, index_type>::yp_; | ||
| using Component<scalar_type, index_type>::wb_; | ||
| using Component<scalar_type, index_type>::ws_; | ||
| using Component<scalar_type, index_type>::ws_indices_; | ||
| using Component<scalar_type, index_type>::h_; | ||
| using Component<scalar_type, index_type>::J_rows_buffer_; | ||
| using Component<scalar_type, index_type>::J_cols_buffer_; | ||
| using Component<scalar_type, index_type>::J_vals_buffer_; | ||
| using Component<scalar_type, index_type>::variable_indices_; | ||
| using Component<scalar_type, index_type>::residual_indices_; | ||
| using Component<scalar_type, index_type>::allocated_; | ||
|
|
||
| public: | ||
| using ScalarT = scalar_type; | ||
| using IdxT = index_type; | ||
| using RealT = typename Component<ScalarT, IdxT>::RealT; | ||
| using ModelDataT = IeeestData<RealT, IdxT>; | ||
| using SignalNodeSetT = SignalNodeSet<ScalarT, IdxT>; | ||
| using SignalPortsT = SignalPorts<ScalarT, ModelDataT>; | ||
| using MonitorT = Model::VariableMonitor<Ieeest, IeeestData>; | ||
| using ScalarT = scalar_type; | ||
| using IdxT = index_type; | ||
| using RealT = typename Component<ScalarT, IdxT>::RealT; | ||
| using SignalT = SignalNode<ScalarT, IdxT>; | ||
| using ModelDataT = IeeestData<RealT, IdxT>; | ||
| using SignalNodeSetT = SignalNodeSet<ScalarT, IdxT>; | ||
| using SignalPortsT = SignalPorts<ScalarT, ModelDataT>; | ||
| using MonitorT = Model::VariableMonitor<Ieeest, IeeestData>; | ||
| using InternalVariablesT = IeeestInternalVariables; | ||
| using ExternalVariablesT = IeeestExternalVariables; | ||
|
|
||
| Ieeest(); | ||
| Ieeest(const ModelDataT& data); | ||
| explicit Ieeest(const ModelDataT& data); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just curious what motivated this adjustment here |
||
| ~Ieeest(); | ||
|
|
||
| int setGridKitComponentID(IdxT) override final; | ||
| int setGridKitComponentID(IdxT component_id) override final; | ||
| int allocate() override final; | ||
| int verify() const override final; | ||
| int initialize() override final; | ||
|
|
@@ -102,6 +111,12 @@ namespace GridKit | |
| ScalarT*); | ||
|
|
||
| private: | ||
| void initializeParameters(const ModelDataT& data); | ||
| void initializeMonitor(); | ||
| void setDerivedParameters(); | ||
|
|
||
| static constexpr RealT TIME_CONSTANT_MINIMUM = static_cast<RealT>(1.0e-3); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
|
||
| RealT A1_{0}; | ||
| RealT A2_{0}; | ||
| RealT A3_{0}; | ||
|
|
@@ -121,34 +136,17 @@ namespace GridKit | |
| RealT Vcu_{0}; | ||
| RealT Tdelay_{0}; | ||
|
|
||
| RealT a0_{1}; | ||
| IdxT order_{0}; | ||
|
|
||
| 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}; | ||
|
|
||
| SignalPortsT ports_; | ||
| IdxT parameter_error_count_{0}; | ||
|
|
||
| SignalPortsT ports_; | ||
| std::unique_ptr<MonitorT> monitor_; | ||
|
|
||
| void initializeParameters(const ModelDataT& data); | ||
| void initializeMonitor(); | ||
| }; | ||
|
|
||
| } // namespace Stabilizer | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.