DPsim
Loading...
Searching...
No Matches
StateSpaceModalAnalysis.h
1// SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, EONERC, RWTH Aachen University
2// SPDX-License-Identifier: MPL-2.0
3#pragma once
4
5#include <dpsim/Definitions.h>
6#include <dpsim/MNAStateSpaceExtractor.h>
7
8namespace DPsim {
9
10enum class StateSpaceAnalysisFrame {
11 Native,
12 GlobalDQ0,
13};
14
22class StateSpaceModalAnalysis {
23public:
24 explicit StateSpaceModalAnalysis(const MNAStateSpaceExtractor &extractor);
25
30 void setAnalysisFrame(StateSpaceAnalysisFrame frame) {
31 mAnalysisFrame = frame;
32 }
33
38 void setGlobalDq0Frame(Real omega, Real theta0 = 0.0) {
39 mGlobalOmega = omega;
40 mGlobalTheta0 = theta0;
41 }
42
44 void update();
45
47 const CPS::VectorComp &getDiscreteEigenvalues() const {
48 return mDiscreteEigenvalues;
49 }
50
52 const CPS::VectorComp &getContinuousEigenvalues() const {
53 return mContinuousEigenvalues;
54 }
55
56private:
57 Matrix buildDiscreteStateMatrixInAnalysisFrame() const;
58
59 Matrix buildGlobalDq0Transformation(Real theta) const;
60
61 Complex mapDiscreteToContinuous(const Complex &z) const;
62
63 const MNAStateSpaceExtractor &mExtractor;
64
65 StateSpaceAnalysisFrame mAnalysisFrame = StateSpaceAnalysisFrame::Native;
66
67 Real mGlobalOmega = 0.0;
68
69 Real mGlobalTheta0 = 0.0;
70
71 CPS::VectorComp mDiscreteEigenvalues;
72
73 CPS::VectorComp mContinuousEigenvalues;
74};
75
76} // namespace DPsim
void setAnalysisFrame(StateSpaceAnalysisFrame frame)
const CPS::VectorComp & getContinuousEigenvalues() const
Continuous-time EMT eigenvalues reconstructed from discrete eigenvalues.
const CPS::VectorComp & getDiscreteEigenvalues() const
Eigenvalues of the extracted discrete-time state matrix in the selected analysis frame.
void update()
Update modal quantities from the current extracted state matrix.
void setGlobalDq0Frame(Real omega, Real theta0=0.0)