17 typedef Real (*DeriveFnPtr)(Matrix inputs);
20 static Real radtoDeg(Real rad);
22 static Real degToRad(Real deg);
24 static Real phase(Complex value);
26 static Real phaseDeg(Complex value);
28 static Real abs(Complex value);
30 static Matrix abs(
const MatrixComp &mat);
32 static Matrix phase(
const MatrixComp &mat);
34 static Complex polar(Real abs, Real phase);
35 static Complex polarDeg(Real abs, Real phase);
39 static bool isFinite(Real value);
40 static bool isFinite(Complex value);
49 static void setVectorElement(Matrix &mat, Matrix::Index row, Complex value,
50 Int maxFreq = 1, Int freqIdx = 0,
51 Matrix::Index colOffset = 0);
53 static void addToVectorElement(Matrix &mat, Matrix::Index row, Complex value,
54 Int maxFreq = 1, Int freqIdx = 0);
56 static Complex complexFromVectorElement(
const Matrix &mat, Matrix::Index row,
57 Int maxFreq = 1, Int freqIdx = 0);
59 static void addToVectorElement(Matrix &mat, Matrix::Index row, Real value);
60 static void setVectorElement(Matrix &mat, Matrix::Index row, Real value);
62 static Real realFromVectorElement(
const Matrix &mat, Matrix::Index row);
70 static void setMatrixElement(SparseMatrixRow &mat, Matrix::Index row,
71 Matrix::Index column, Complex value,
72 Int maxFreq = 1, Int freqIdx = 0);
74 static void addToMatrixElement(SparseMatrixRow &mat, Matrix::Index row,
75 Matrix::Index column, Complex value,
76 Int maxFreq = 1, Int freqIdx = 0);
78 static void addToMatrixElement(SparseMatrixRow &mat, Matrix::Index row,
79 Matrix::Index column, Matrix value,
80 Int maxFreq = 1, Int freqIdx = 0);
82 static void setMatrixElement(SparseMatrixRow &mat, Matrix::Index row,
83 Matrix::Index column, Real value);
85 static void addToMatrixElement(SparseMatrixRow &mat, std::vector<UInt> rows,
86 std::vector<UInt> columns, Complex value);
88 static void addToMatrixElement(SparseMatrixRow &mat, Matrix::Index row,
89 Matrix::Index column, Real value);
90 static void addToMatrixElement(SparseMatrixRow &mat, std::vector<UInt> rows,
91 std::vector<UInt> columns, Real value);
93 static void invertMatrix(
const Matrix &mat, Matrix &matInv);
96 static Matrix StateSpaceTrapezoidal(Matrix states, Matrix A, Matrix B,
97 Real dt, Matrix u_new, Matrix u_old);
98 static Matrix StateSpaceTrapezoidal(Matrix states, Matrix A, Matrix B,
99 Matrix C, Real dt, Matrix u_new,
101 static Matrix StateSpaceTrapezoidal(Matrix states, Matrix A, Matrix B,
103 static Matrix StateSpaceTrapezoidal(Matrix states, Matrix A, Matrix B,
104 Matrix C, Real dt, Matrix u);
105 static Matrix StateSpaceTrapezoidal(Matrix states, Matrix A, Matrix input,
107 static Real StateSpaceTrapezoidal(Real states, Real A, Real B, Real C,
109 static Real StateSpaceTrapezoidal(Real states, Real A, Real B, Real dt,
112 static Matrix StateSpaceEuler(Matrix states, Matrix A, Matrix B, Real dt,
114 static Matrix StateSpaceEuler(Matrix states, Matrix A, Matrix B, Matrix C,
116 static Matrix StateSpaceEuler(Matrix states, Matrix A, Matrix input, Real dt);
117 static Real StateSpaceEuler(Real states, Real A, Real B, Real dt, Real u);
118 static Real StateSpaceEuler(Real states, Real A, Real B, Real C, Real dt,
125 const Real &dt, Matrix &Ad,
126 Matrix &Bd, Matrix &Cd);
129 const Real &dt, Matrix &Ad,
135 const Matrix &statesPrevStep,
136 const Matrix &inputCurrStep,
137 const Matrix &inputPrevStep);
139 static void FFT(std::vector<Complex> &samples);
141 static Complex rotatingFrame2to1(Complex f2, Real theta1, Real theta2);
154 static Matrix parkTransformPowerInvariant(Real theta,
const Matrix &fabc);
156 static Matrix parkTransformMatrixPowerInvariant(Real theta);
158 static Matrix inverseParkTransformPowerInvariant(Real theta,
161 static Matrix inverseParkTransformMatrixPowerInvariant(Real theta);