DPsim
|
Solver class which uses Differential Algebraic Equation(DAE) systems. More...
#include <DAESolver.h>
Public Member Functions | |
DAESolver (String name, const CPS::SystemTopology &system, Real dt, Real mT0) | |
Create solve object with given parameters. | |
~DAESolver () | |
Deallocate all memory. | |
void | initialize () final |
Initialize Components & Nodes with initial values. | |
Real | step (Real time) |
Solve system for the current time. | |
CPS::Task::List | getTasks () override |
Get tasks for scheduler. | |
![]() | |
Solver (String name, CPS::Logger::Level logLevel) | |
void | setTimeStep (Real timeStep) |
void | doFrequencyParallelization (Bool freqParallel) |
virtual void | setSystem (const CPS::SystemTopology &system) |
void | doSystemMatrixRecomputation (Bool value) |
void | setLogSolveTimes (Bool value) |
void | doSteadyStateInit (Bool f) |
activate steady state initialization | |
void | setSteadStIniTimeLimit (Real v) |
set steady state initialization time limit | |
void | setSteadStIniAccLimit (Real v) |
set steady state initialization accuracy limit | |
virtual void | setSolverAndComponentBehaviour (Solver::Behaviour behaviour) |
set solver and component to initialization or simulation behaviour | |
void | doInitFromNodesAndTerminals (Bool f) |
activate powerflow initialization | |
virtual void | setDirectLinearSolverConfiguration (DirectLinearSolverConfiguration &) |
set direct linear solver configuration (only available in MNA for now) | |
virtual void | logLUTimes () |
log LU decomposition times, if applicable | |
virtual void | log (Real time, Int timeStepCount) |
Log results. | |
void | setMaxNumberOfIterations (int maxIterations) |
Protected Member Functions | |
int | residualFunction (realtype ttime, N_Vector state, N_Vector dstate_dt, N_Vector resid) |
Static Protected Member Functions | |
static int | residualFunctionWrapper (realtype ttime, N_Vector state, N_Vector dstate_dt, N_Vector resid, void *user_data) |
Residual Function of entire System. | |
Protected Attributes | |
CPS::SystemTopology | mSystem |
std::vector< Int > | mOffsets |
Offsets vector for adding new equations to the residual vector. | |
Real | mTimestep |
Constant time step. | |
Int | mNEQ |
Number of equations in problem. | |
CPS::IdentifiedObject::List | mComponents |
Components of the Problem. | |
CPS::SimNode< Complex >::List | mNodes |
Nodes of the Problem. | |
Real | mT0 |
void * | mem = NULL |
Memory block allocated by IDA. | |
N_Vector | state = NULL |
Vector of problem variables. | |
N_Vector | dstate_dt = NULL |
Derivates of the state vector with respect to time. | |
realtype | tret |
Time IDA reached while solving. | |
realtype | abstol |
Scalar absolute tolerance. | |
realtype | rtol |
Relative tolerance. | |
SUNMatrix | A = NULL |
Template Jacobian Matrix. | |
SUNLinearSolver | LS = NULL |
Linear solver object. | |
long int | interalSteps = 0 |
long int | resEval = 0 |
std::vector< CPS::DAEInterface::ResFn > | mResidualFunctions |
![]() | |
String | mName |
Name for logging. | |
CPS::Logger::Level | mLogLevel |
Logging level. | |
Bool | mLogSolveTimes = true |
Collect step time for logging. | |
CPS::Logger::Log | mSLog |
Logger. | |
Real | mTimeStep |
Time step for fixed step solvers. | |
Bool | mFrequencyParallel = false |
Activates parallelized computation of frequencies. | |
Real | mSteadStIniTimeLimit = 10 |
steady state initialization time limit | |
Real | mSteadStIniAccLimit = 0.0001 |
steady state initialization accuracy limit | |
Bool | mSteadyStateInit = false |
Activates steady state initialization. | |
Bool | mIsInInitialization = false |
Determines if solver is in initialization phase, which requires different behavior. | |
Bool | mInitFromNodesAndTerminals = true |
Bool | mSystemMatrixRecomputation = false |
Enable recomputation of system matrix during simulation. | |
Behaviour | mBehaviour = Solver::Behaviour::Simulation |
Solver behaviour initialization or simulation. | |
Additional Inherited Members | |
![]() | |
enum | Behaviour { Initialization , Simulation } |
enum class | Type { MNA , DAE , NRP } |
typedef std::shared_ptr< Solver > | Ptr |
typedef std::vector< Ptr > | List |
![]() | |
int | mMaxIterations = 10 |
Solver class which uses Differential Algebraic Equation(DAE) systems.
Definition at line 30 of file DAESolver.h.
DAESolver::DAESolver | ( | String | name, |
const CPS::SystemTopology & | system, | ||
Real | dt, | ||
Real | mT0 ) |
Create solve object with given parameters.
Definition at line 18 of file DAESolver.cpp.
DAESolver::~DAESolver | ( | ) |
Deallocate all memory.
Definition at line 234 of file DAESolver.cpp.
|
overridevirtual |
|
finalvirtual |
Initialize Components & Nodes with initial values.
Reimplemented from DPsim::Solver.
Definition at line 73 of file DAESolver.cpp.
|
protected |
Definition at line 181 of file DAESolver.cpp.
|
staticprotected |
Residual Function of entire System.
Definition at line 173 of file DAESolver.cpp.
Real DAESolver::step | ( | Real | time | ) |
Solve system for the current time.
Definition at line 209 of file DAESolver.cpp.
|
protected |
Template Jacobian Matrix.
Definition at line 62 of file DAESolver.h.
|
protected |
Scalar absolute tolerance.
Definition at line 58 of file DAESolver.h.
|
protected |
Derivates of the state vector with respect to time.
Definition at line 54 of file DAESolver.h.
|
protected |
Definition at line 65 of file DAESolver.h.
|
protected |
Linear solver object.
Definition at line 64 of file DAESolver.h.
|
protected |
Components of the Problem.
Definition at line 41 of file DAESolver.h.
|
protected |
Memory block allocated by IDA.
Definition at line 50 of file DAESolver.h.
|
protected |
Number of equations in problem.
Definition at line 39 of file DAESolver.h.
|
protected |
Nodes of the Problem.
Definition at line 43 of file DAESolver.h.
|
protected |
Offsets vector for adding new equations to the residual vector.
Definition at line 35 of file DAESolver.h.
|
protected |
Definition at line 67 of file DAESolver.h.
|
protected |
Definition at line 33 of file DAESolver.h.
|
protected |
Definition at line 46 of file DAESolver.h.
|
protected |
Constant time step.
Definition at line 37 of file DAESolver.h.
|
protected |
Definition at line 66 of file DAESolver.h.
|
protected |
Relative tolerance.
Definition at line 60 of file DAESolver.h.
|
protected |
Vector of problem variables.
Definition at line 52 of file DAESolver.h.
|
protected |
Time IDA reached while solving.
Definition at line 56 of file DAESolver.h.