DPsim
Loading...
Searching...
No Matches
CPS::Math Class Reference

Public Types

typedef Real(* DeriveFnPtr) (Matrix inputs)
 

Static Public Member Functions

static Real radtoDeg (Real rad)
 
static Real degToRad (Real deg)
 
static Real phase (Complex value)
 
static Real phaseDeg (Complex value)
 
static Real abs (Complex value)
 
static Matrix abs (const MatrixComp &mat)
 
static Matrix phase (const MatrixComp &mat)
 
static Complex polar (Real abs, Real phase)
 
static Complex polarDeg (Real abs, Real phase)
 
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 complexFromVectorElement (const Matrix &mat, Matrix::Index row, Int maxFreq=1, Int freqIdx=0)
 
static void addToVectorElement (Matrix &mat, Matrix::Index row, Real value)
 
static void setVectorElement (Matrix &mat, Matrix::Index row, Real value)
 
static Real realFromVectorElement (const Matrix &mat, Matrix::Index row)
 
static void setMatrixElement (SparseMatrixRow &mat, Matrix::Index row, Matrix::Index column, Complex value, Int maxFreq=1, Int freqIdx=0)
 
static void addToMatrixElement (SparseMatrixRow &mat, Matrix::Index row, Matrix::Index column, Complex value, Int maxFreq=1, Int freqIdx=0)
 
static void addToMatrixElement (SparseMatrixRow &mat, Matrix::Index row, Matrix::Index column, Matrix value, Int maxFreq=1, Int freqIdx=0)
 
static void setMatrixElement (SparseMatrixRow &mat, Matrix::Index row, Matrix::Index column, Real value)
 
static void addToMatrixElement (SparseMatrixRow &mat, std::vector< UInt > rows, std::vector< UInt > columns, Complex value)
 
static void addToMatrixElement (SparseMatrixRow &mat, Matrix::Index row, Matrix::Index column, Real value)
 
static void addToMatrixElement (SparseMatrixRow &mat, std::vector< UInt > rows, std::vector< UInt > columns, Real value)
 
static void invertMatrix (const Matrix &mat, Matrix &matInv)
 
static Matrix StateSpaceTrapezoidal (Matrix states, Matrix A, Matrix B, Real dt, Matrix u_new, Matrix u_old)
 
static Matrix StateSpaceTrapezoidal (Matrix states, Matrix A, Matrix B, Matrix C, Real dt, Matrix u_new, Matrix u_old)
 
static Matrix StateSpaceTrapezoidal (Matrix states, Matrix A, Matrix B, Real dt, Matrix u)
 
static Matrix StateSpaceTrapezoidal (Matrix states, Matrix A, Matrix B, Matrix C, Real dt, Matrix u)
 
static Matrix StateSpaceTrapezoidal (Matrix states, Matrix A, Matrix input, Real dt)
 
static Real StateSpaceTrapezoidal (Real states, Real A, Real B, Real C, Real dt, Real u)
 
static Real StateSpaceTrapezoidal (Real states, Real A, Real B, Real dt, Real u)
 
static Matrix StateSpaceEuler (Matrix states, Matrix A, Matrix B, Real dt, Matrix u)
 
static Matrix StateSpaceEuler (Matrix states, Matrix A, Matrix B, Matrix C, Real dt, Matrix u)
 
static Matrix StateSpaceEuler (Matrix states, Matrix A, Matrix input, Real dt)
 
static Real StateSpaceEuler (Real states, Real A, Real B, Real dt, Real u)
 
static Real StateSpaceEuler (Real states, Real A, Real B, Real C, Real dt, Real u)
 
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 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 step.
 
static void FFT (std::vector< Complex > &samples)
 
static Complex rotatingFrame2to1 (Complex f2, Real theta1, Real theta2)
 
static MatrixComp singlePhaseVariableToThreePhase (Complex var_1ph)
 To convert single phase complex variables (voltages, currents) to symmetrical three phase ones.
 
static Matrix singlePhaseParameterToThreePhase (Real parameter)
 To convert single phase parameters to symmetrical three phase ones.
 
static Matrix singlePhasePowerToThreePhase (Real power)
 To convert single phase power to symmetrical three phase.
 

Detailed Description

Definition at line 15 of file MathUtils.h.

Member Typedef Documentation

◆ DeriveFnPtr

typedef Real(* CPS::Math::DeriveFnPtr) (Matrix inputs)

Definition at line 17 of file MathUtils.h.

Member Function Documentation

◆ abs() [1/2]

Real Math::abs ( Complex value)
static

Definition at line 22 of file MathUtils.cpp.

◆ abs() [2/2]

Matrix Math::abs ( const MatrixComp & mat)
static

Definition at line 24 of file MathUtils.cpp.

◆ addToMatrixElement() [1/5]

void Math::addToMatrixElement ( SparseMatrixRow & mat,
Matrix::Index row,
Matrix::Index column,
Complex value,
Int maxFreq = 1,
Int freqIdx = 0 )
static

Definition at line 115 of file MathUtils.cpp.

◆ addToMatrixElement() [2/5]

void Math::addToMatrixElement ( SparseMatrixRow & mat,
Matrix::Index row,
Matrix::Index column,
Matrix value,
Int maxFreq = 1,
Int freqIdx = 0 )
static

Definition at line 131 of file MathUtils.cpp.

◆ addToMatrixElement() [3/5]

void Math::addToMatrixElement ( SparseMatrixRow & mat,
Matrix::Index row,
Matrix::Index column,
Real value )
static

Definition at line 157 of file MathUtils.cpp.

◆ addToMatrixElement() [4/5]

void Math::addToMatrixElement ( SparseMatrixRow & mat,
std::vector< UInt > rows,
std::vector< UInt > columns,
Complex value )
static

Definition at line 151 of file MathUtils.cpp.

◆ addToMatrixElement() [5/5]

void Math::addToMatrixElement ( SparseMatrixRow & mat,
std::vector< UInt > rows,
std::vector< UInt > columns,
Real value )
static

Definition at line 162 of file MathUtils.cpp.

◆ addToVectorElement() [1/2]

void Math::addToVectorElement ( Matrix & mat,
Matrix::Index row,
Complex value,
Int maxFreq = 1,
Int freqIdx = 0 )
static

Definition at line 68 of file MathUtils.cpp.

◆ addToVectorElement() [2/2]

void Math::addToVectorElement ( Matrix & mat,
Matrix::Index row,
Real value )
static

Definition at line 88 of file MathUtils.cpp.

◆ applyStateSpaceTrapezoidalMatrices()

Matrix Math::applyStateSpaceTrapezoidalMatrices ( const Matrix & Ad,
const Matrix & Bd,
const Matrix & Cd,
const Matrix & statesPrevStep,
const Matrix & inputCurrStep,
const Matrix & inputPrevStep )
static

Apply the trapezoidal based state space matrices Ad, Bd, Cd to get the states at the current time step.

Definition at line 341 of file MathUtils.cpp.

◆ calculateStateSpaceTrapezoidalMatrices()

void Math::calculateStateSpaceTrapezoidalMatrices ( const Matrix & A,
const Matrix & B,
const Matrix & C,
const Real & dt,
Matrix & Ad,
Matrix & Bd,
Matrix & Cd )
static

Calculate the discretized state space matrices Ad, Bd, Cd using trapezoidal rule.

Definition at line 324 of file MathUtils.cpp.

◆ complexFromVectorElement()

Complex Math::complexFromVectorElement ( const Matrix & mat,
Matrix::Index row,
Int maxFreq = 1,
Int freqIdx = 0 )
static

Definition at line 79 of file MathUtils.cpp.

◆ degToRad()

Real Math::degToRad ( Real deg)
static

Definition at line 16 of file MathUtils.cpp.

◆ FFT()

void Math::FFT ( std::vector< Complex > & samples)
static

Definition at line 350 of file MathUtils.cpp.

◆ invertMatrix()

void Math::invertMatrix ( const Matrix & mat,
Matrix & matInv )
static

Definition at line 168 of file MathUtils.cpp.

◆ phase() [1/2]

Real Math::phase ( Complex value)
static

Definition at line 18 of file MathUtils.cpp.

◆ phase() [2/2]

Matrix Math::phase ( const MatrixComp & mat)
static

Definition at line 37 of file MathUtils.cpp.

◆ phaseDeg()

Real Math::phaseDeg ( Complex value)
static

Definition at line 20 of file MathUtils.cpp.

◆ polar()

Complex Math::polar ( Real abs,
Real phase )
static

Definition at line 50 of file MathUtils.cpp.

◆ polarDeg()

Complex Math::polarDeg ( Real abs,
Real phase )
static

Definition at line 54 of file MathUtils.cpp.

◆ radtoDeg()

Real Math::radtoDeg ( Real rad)
static

Definition at line 14 of file MathUtils.cpp.

◆ realFromVectorElement()

Real Math::realFromVectorElement ( const Matrix & mat,
Matrix::Index row )
static

Definition at line 96 of file MathUtils.cpp.

◆ rotatingFrame2to1()

Complex Math::rotatingFrame2to1 ( Complex f2,
Real theta1,
Real theta2 )
static

Definition at line 390 of file MathUtils.cpp.

◆ setMatrixElement() [1/2]

void Math::setMatrixElement ( SparseMatrixRow & mat,
Matrix::Index row,
Matrix::Index column,
Complex value,
Int maxFreq = 1,
Int freqIdx = 0 )
static

Definition at line 100 of file MathUtils.cpp.

◆ setMatrixElement() [2/2]

void Math::setMatrixElement ( SparseMatrixRow & mat,
Matrix::Index row,
Matrix::Index column,
Real value )
static

Definition at line 146 of file MathUtils.cpp.

◆ setVectorElement() [1/2]

void Math::setVectorElement ( Matrix & mat,
Matrix::Index row,
Complex value,
Int maxFreq = 1,
Int freqIdx = 0,
Matrix::Index colOffset = 0 )
static

Definition at line 58 of file MathUtils.cpp.

◆ setVectorElement() [2/2]

void Math::setVectorElement ( Matrix & mat,
Matrix::Index row,
Real value )
static

Definition at line 92 of file MathUtils.cpp.

◆ singlePhaseParameterToThreePhase()

Matrix Math::singlePhaseParameterToThreePhase ( Real parameter)
static

To convert single phase parameters to symmetrical three phase ones.

Definition at line 211 of file MathUtils.cpp.

◆ singlePhasePowerToThreePhase()

Matrix Math::singlePhasePowerToThreePhase ( Real power)
static

To convert single phase power to symmetrical three phase.

Definition at line 217 of file MathUtils.cpp.

◆ singlePhaseVariableToThreePhase()

MatrixComp Math::singlePhaseVariableToThreePhase ( Complex var_1ph)
static

To convert single phase complex variables (voltages, currents) to symmetrical three phase ones.

Definition at line 205 of file MathUtils.cpp.

◆ StateSpaceEuler() [1/5]

Matrix Math::StateSpaceEuler ( Matrix states,
Matrix A,
Matrix B,
Matrix C,
Real dt,
Matrix u )
static

Definition at line 310 of file MathUtils.cpp.

◆ StateSpaceEuler() [2/5]

Matrix Math::StateSpaceEuler ( Matrix states,
Matrix A,
Matrix B,
Real dt,
Matrix u )
static

Definition at line 301 of file MathUtils.cpp.

◆ StateSpaceEuler() [3/5]

Matrix Math::StateSpaceEuler ( Matrix states,
Matrix A,
Matrix input,
Real dt )
static

Definition at line 320 of file MathUtils.cpp.

◆ StateSpaceEuler() [4/5]

Real Math::StateSpaceEuler ( Real states,
Real A,
Real B,
Real C,
Real dt,
Real u )
static

Definition at line 315 of file MathUtils.cpp.

◆ StateSpaceEuler() [5/5]

Real Math::StateSpaceEuler ( Real states,
Real A,
Real B,
Real dt,
Real u )
static

Definition at line 306 of file MathUtils.cpp.

◆ StateSpaceTrapezoidal() [1/7]

Matrix Math::StateSpaceTrapezoidal ( Matrix states,
Matrix A,
Matrix B,
Matrix C,
Real dt,
Matrix u )
static

Definition at line 248 of file MathUtils.cpp.

◆ StateSpaceTrapezoidal() [2/7]

Matrix Math::StateSpaceTrapezoidal ( Matrix states,
Matrix A,
Matrix B,
Matrix C,
Real dt,
Matrix u_new,
Matrix u_old )
static

Definition at line 235 of file MathUtils.cpp.

◆ StateSpaceTrapezoidal() [3/7]

Matrix Math::StateSpaceTrapezoidal ( Matrix states,
Matrix A,
Matrix B,
Real dt,
Matrix u )
static

Definition at line 269 of file MathUtils.cpp.

◆ StateSpaceTrapezoidal() [4/7]

Matrix Math::StateSpaceTrapezoidal ( Matrix states,
Matrix A,
Matrix B,
Real dt,
Matrix u_new,
Matrix u_old )
static

Definition at line 223 of file MathUtils.cpp.

◆ StateSpaceTrapezoidal() [5/7]

Matrix Math::StateSpaceTrapezoidal ( Matrix states,
Matrix A,
Matrix input,
Real dt )
static

Definition at line 281 of file MathUtils.cpp.

◆ StateSpaceTrapezoidal() [6/7]

Real Math::StateSpaceTrapezoidal ( Real states,
Real A,
Real B,
Real C,
Real dt,
Real u )
static

Definition at line 260 of file MathUtils.cpp.

◆ StateSpaceTrapezoidal() [7/7]

Real Math::StateSpaceTrapezoidal ( Real states,
Real A,
Real B,
Real dt,
Real u )
static

Definition at line 293 of file MathUtils.cpp.


The documentation for this class was generated from the following files: