40 template <
typename DerivedA,
typename DerivedB>
42 const Eigen::MatrixBase<DerivedB> &b) {
43 return (a.array() * b.array()).matrix();
59 Int maxFreq = 1,
Int freqIdx = 0,
60 Matrix::Index colOffset = 0);
63 Int maxFreq = 1,
Int freqIdx = 0);
66 Int maxFreq = 1,
Int freqIdx = 0);
80 Matrix::Index column,
Complex value,
81 Int maxFreq = 1,
Int freqIdx = 0);
84 Matrix::Index column,
Complex value,
85 Int maxFreq = 1,
Int freqIdx = 0);
88 Matrix::Index column,
Matrix value,
89 Int maxFreq = 1,
Int freqIdx = 0);
92 Matrix::Index column,
Real value);
95 std::vector<UInt> columns,
Complex value);
98 Matrix::Index column,
Real value);
100 std::vector<UInt> columns,
Real value);
144 const Matrix &statesPrevStep,
145 const Matrix &inputCurrStep,
146 const Matrix &inputPrevStep);
148 static void FFT(std::vector<Complex> &samples);
163 static std::pair<Real, Real>
static Complex polar(Real abs, Real phase)
static std::pair< Real, Real > pccPowerFromFilterPowerReference(Real pFilterRef, Real qFilterRef, Real rc, Real vGridRmsLL)
static Matrix singlePhasePowerToThreePhase(Real power)
To convert single phase power to symmetrical three phase.
static Complex polarDeg(Real abs, Real phase)
static Matrix StateSpaceEuler(Matrix states, Matrix A, Matrix B, Real dt, Matrix u)
static Complex complexFromVectorElement(const Matrix &mat, Matrix::Index row, Int maxFreq=1, Int freqIdx=0)
static Real degToRad(Real deg)
static Real realFromVectorElement(const Matrix &mat, Matrix::Index row)
static void calculateStateSpaceTrapezoidalMatrices(const Matrix &A, const Matrix &B, const Matrix &C, const Real &dt, Matrix &Ad, Matrix &Bd, Matrix &Cd)
Calculate the discretized state space matrices Ad, Bd, Cd using trapezoidal rule.
static void setVectorElement(Matrix &mat, Matrix::Index row, Complex value, Int maxFreq=1, Int freqIdx=0, Matrix::Index colOffset=0)
static void addToVectorElement(Matrix &mat, Matrix::Index row, Complex value, Int maxFreq=1, Int freqIdx=0)
static Complex rotatingFrame2to1(Complex f2, Real theta1, Real theta2)
static auto elementwiseProduct(const Eigen::MatrixBase< DerivedA > &a, const Eigen::MatrixBase< DerivedB > &b)
Elementwise product of two same-shaped Eigen expressions.
static Matrix inverseParkTransformMatrixPowerInvariant(Real theta)
static Real phaseDeg(Complex value)
Real(* DeriveFnPtr)(Matrix inputs)
static Real phase(Complex value)
static void setMatrixElement(SparseMatrixRow &mat, Matrix::Index row, Matrix::Index column, Complex value, Int maxFreq=1, Int freqIdx=0)
static Matrix parkTransformPowerInvariant(Real theta, const Matrix &fabc)
static Matrix applyStateSpaceTrapezoidalMatrices(const Matrix &Ad, const Matrix &Bd, const Matrix &Cd, const Matrix &statesPrevStep, const Matrix &inputCurrStep, const Matrix &inputPrevStep)
Apply the trapezoidal based state space matrices Ad, Bd, Cd to get the states at the current time ste...
static Matrix singlePhaseParameterToThreePhase(Real parameter)
To convert single phase parameters to symmetrical three phase ones.
static bool isFinite(Real value)
static Real abs(Complex value)
static void addToMatrixElement(SparseMatrixRow &mat, Matrix::Index row, Matrix::Index column, Complex value, Int maxFreq=1, Int freqIdx=0)
static void invertMatrix(const Matrix &mat, Matrix &matInv)
static Matrix inverseParkTransformPowerInvariant(Real theta, const Matrix &fdq)
static Matrix parkTransformMatrixPowerInvariant(Real theta)
static void FFT(std::vector< Complex > &samples)
static Real radtoDeg(Real rad)
static MatrixComp singlePhaseVariableToThreePhase(Complex var_1ph)
To convert single phase complex variables (voltages, currents) to symmetrical three phase ones.
static Matrix StateSpaceTrapezoidal(Matrix states, Matrix A, Matrix B, Real dt, Matrix u_new, Matrix u_old)
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > Matrix
Dense matrix for real numbers.
std::complex< Real > Complex
Eigen::Matrix< Complex, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > MatrixComp
Dense matrix for complex numbers.
Eigen::SparseMatrix< Real, Eigen::RowMajor > SparseMatrixRow
Sparse matrix for real numbers (row major).