3 #include <dpsim-models/Logger.h>
4 #include <dpsim-models/MathUtils.h>
9 static void stampConductance(Real conductance, SparseMatrixRow &mat,
10 UInt node1Index, UInt node2Index,
11 Bool isTerminal1NotGrounded,
12 Bool isTerminal2NotGrounded,
13 const Logger::Log &mSLog);
15 static void stampAdmittance(Complex admittance, SparseMatrixRow &mat,
16 UInt node1Index, UInt node2Index,
17 Bool isTerminal1NotGrounded,
18 Bool isTerminal2NotGrounded,
19 const Logger::Log &mSLog, Int maxFreq = 1,
22 static void stampConductanceMatrix(
const Matrix &conductanceMat,
23 SparseMatrixRow &mat, UInt node1Index,
25 Bool isTerminal1NotGrounded,
26 Bool isTerminal2NotGrounded,
27 const Logger::Log &mSLog);
29 static void stamp3x3ConductanceMatrixBetween2Nodes(
30 const Matrix &conductanceMat, SparseMatrixRow &mat, UInt node1Index,
31 UInt node2Index,
const Logger::Log &mSLog);
33 static void stamp3x3ConductanceMatrixNodeToGround(
const Matrix &conductanceMat,
36 const Logger::Log &mSLog);
38 static void stampAdmittanceMatrix(
39 const MatrixComp &admittanceMat, SparseMatrixRow &mat, UInt node1Index,
40 UInt node2Index, Bool isTerminal1NotGrounded, Bool isTerminal2NotGrounded,
41 const Logger::Log &mSLog, Int maxFreq = 1, Int freqIdx = 0);
45 Real conductance, SparseMatrixRow &mat, UInt node1Index, UInt node2Index,
46 Bool isTerminal1NotGrounded, Bool isTerminal2NotGrounded,
47 const Logger::Log &mSLog);
51 Complex admittance, SparseMatrixRow &mat, UInt node1Index,
52 UInt node2Index, Bool isTerminal1NotGrounded, Bool isTerminal2NotGrounded,
53 const Logger::Log &mSLog, Int maxFreq = 1, Int freqIdx = 0);
57 static void stampValue(T value, SparseMatrixRow &mat, UInt node1Index,
58 UInt node2Index, Bool isTerminal1NotGrounded,
59 Bool isTerminal2NotGrounded, Int maxFreq, Int freqIdx,
60 const Logger::Log &mSLog);
63 static void stampMatrix(
const MatrixVar<T> &matrix, SparseMatrixRow &mat,
64 UInt node1Index, UInt node2Index,
65 Bool isTerminal1NotGrounded,
66 Bool isTerminal2NotGrounded, Int maxFreq, Int freqIdx,
67 const Logger::Log &mSLog);
70 static void stampMatrixBetween2Nodes(
const MatrixVar<T> &matrix,
71 UInt sizeOfMatrix, SparseMatrixRow &mat,
72 UInt node1Index, UInt node2Index,
73 Int maxFreq, Int freqIdx,
74 const Logger::Log &mSLog);
77 static void stampMatrixNodeToGround(
const MatrixVar<T> &matrix,
78 UInt sizeOfMatrix, SparseMatrixRow &mat,
79 UInt nodeIndex, Int maxFreq, Int freqIdx,
80 const Logger::Log &mSLog);
83 static void stampValueAsScalarMatrix(T value, UInt sizeOfScalarMatrix,
84 SparseMatrixRow &mat, UInt node1Index,
86 Bool isTerminal1NotGrounded,
87 Bool isTerminal2NotGrounded, Int maxFreq,
88 Int freqIdx,
const Logger::Log &mSLog);
91 static void stampToMatrix(T value, SparseMatrixRow &mat, UInt row1,
92 UInt column1, UInt row2, UInt column2, Int maxFreq,
93 Int freqIdx,
const Logger::Log &mSLog);
95 static void addToMatrixElement(SparseMatrixRow &mat, Matrix::Index row,
96 Matrix::Index column, Real value, Int maxFreq,
97 Int freqIdx,
const Logger::Log &mSLog);
99 static void addToMatrixElement(SparseMatrixRow &mat, Matrix::Index row,
100 Matrix::Index column, Complex value,
101 Int maxFreq, Int freqIdx,
102 const Logger::Log &mSLog);
static void stampConductanceAs3x3ScalarMatrix(Real conductance, SparseMatrixRow &mat, UInt node1Index, UInt node2Index, Bool isTerminal1NotGrounded, Bool isTerminal2NotGrounded, const Logger::Log &mSLog)
Stamps conductance as a 3x3 scalar matrix (a diagonal matrix, where all diagonal elements are equal t...
static void stampAdmittanceAs3x3ScalarMatrix(Complex admittance, SparseMatrixRow &mat, UInt node1Index, UInt node2Index, Bool isTerminal1NotGrounded, Bool isTerminal2NotGrounded, const Logger::Log &mSLog, Int maxFreq=1, Int freqIdx=0)
Stamps admittance as a 3x3 scalar matrix (a diagonal matrix, where all diagonal elements are equal to...