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 bool isFinite (Real value)
 
static bool isFinite (Complex value)
 
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 void calculateStateSpaceTrapezoidalMatrices (const Matrix &A, const Matrix &B, const Real &dt, Matrix &Ad, Matrix &Bd)
 
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.
 
static Matrix parkTransformPowerInvariant (Real theta, const Matrix &fabc)
 
static Matrix parkTransformMatrixPowerInvariant (Real theta)
 
static Matrix inverseParkTransformPowerInvariant (Real theta, const Matrix &fdq)
 
static Matrix inverseParkTransformMatrixPowerInvariant (Real theta)
 

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 25 of file MathUtils.cpp.

◆ abs() [2/2]

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

Definition at line 27 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 128 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 144 of file MathUtils.cpp.

◆ addToMatrixElement() [3/5]

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

Definition at line 170 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 164 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 175 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 81 of file MathUtils.cpp.

◆ addToVectorElement() [2/2]

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

Definition at line 101 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 369 of file MathUtils.cpp.

◆ calculateStateSpaceTrapezoidalMatrices() [1/2]

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 337 of file MathUtils.cpp.

◆ calculateStateSpaceTrapezoidalMatrices() [2/2]

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

Definition at line 354 of file MathUtils.cpp.

◆ complexFromVectorElement()

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

Definition at line 92 of file MathUtils.cpp.

◆ degToRad()

Real Math::degToRad ( Real deg)
static

Definition at line 19 of file MathUtils.cpp.

◆ FFT()

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

Definition at line 378 of file MathUtils.cpp.

◆ inverseParkTransformMatrixPowerInvariant()

Matrix Math::inverseParkTransformMatrixPowerInvariant ( Real theta)
static

Definition at line 446 of file MathUtils.cpp.

◆ inverseParkTransformPowerInvariant()

Matrix Math::inverseParkTransformPowerInvariant ( Real theta,
const Matrix & fdq )
static

Definition at line 442 of file MathUtils.cpp.

◆ invertMatrix()

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

Definition at line 181 of file MathUtils.cpp.

◆ isFinite() [1/2]

bool Math::isFinite ( Complex value)
static

Definition at line 67 of file MathUtils.cpp.

◆ isFinite() [2/2]

bool Math::isFinite ( Real value)
static

Definition at line 61 of file MathUtils.cpp.

◆ parkTransformMatrixPowerInvariant()

Matrix Math::parkTransformMatrixPowerInvariant ( Real theta)
static

Definition at line 429 of file MathUtils.cpp.

◆ parkTransformPowerInvariant()

Matrix Math::parkTransformPowerInvariant ( Real theta,
const Matrix & fabc )
static

Definition at line 425 of file MathUtils.cpp.

◆ phase() [1/2]

Real Math::phase ( Complex value)
static

Definition at line 21 of file MathUtils.cpp.

◆ phase() [2/2]

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

Definition at line 40 of file MathUtils.cpp.

◆ phaseDeg()

Real Math::phaseDeg ( Complex value)
static

Definition at line 23 of file MathUtils.cpp.

◆ polar()

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

Definition at line 53 of file MathUtils.cpp.

◆ polarDeg()

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

Definition at line 57 of file MathUtils.cpp.

◆ radtoDeg()

Real Math::radtoDeg ( Real rad)
static

Definition at line 17 of file MathUtils.cpp.

◆ realFromVectorElement()

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

Definition at line 109 of file MathUtils.cpp.

◆ rotatingFrame2to1()

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

Definition at line 418 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 113 of file MathUtils.cpp.

◆ setMatrixElement() [2/2]

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

Definition at line 159 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 71 of file MathUtils.cpp.

◆ setVectorElement() [2/2]

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

Definition at line 105 of file MathUtils.cpp.

◆ singlePhaseParameterToThreePhase()

Matrix Math::singlePhaseParameterToThreePhase ( Real parameter)
static

To convert single phase parameters to symmetrical three phase ones.

Definition at line 224 of file MathUtils.cpp.

◆ singlePhasePowerToThreePhase()

Matrix Math::singlePhasePowerToThreePhase ( Real power)
static

To convert single phase power to symmetrical three phase.

Definition at line 230 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 218 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 323 of file MathUtils.cpp.

◆ StateSpaceEuler() [2/5]

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

Definition at line 314 of file MathUtils.cpp.

◆ StateSpaceEuler() [3/5]

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

Definition at line 333 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 328 of file MathUtils.cpp.

◆ StateSpaceEuler() [5/5]

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

Definition at line 319 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 261 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 248 of file MathUtils.cpp.

◆ StateSpaceTrapezoidal() [3/7]

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

Definition at line 282 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 236 of file MathUtils.cpp.

◆ StateSpaceTrapezoidal() [5/7]

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

Definition at line 294 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 273 of file MathUtils.cpp.

◆ StateSpaceTrapezoidal() [7/7]

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

Definition at line 306 of file MathUtils.cpp.


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