15 #include <dpsim/Solver.h>
17 #include <dpsim-models/Logger.h>
18 #include <dpsim-models/Solver/DAEInterface.h>
19 #include <dpsim-models/SystemTopology.h>
22 #include <ida/ida_direct.h>
23 #include <nvector/nvector_serial.h>
24 #include <sundials/sundials_types.h>
25 #include <sunlinsol/sunlinsol_dense.h>
64 SUNLinearSolver
LS = NULL;
65 long int interalSteps = 0;
67 std::vector<CPS::DAEInterface::ResFn> mResidualFunctions;
73 int residualFunction(realtype ttime, N_Vector
state, N_Vector
dstate_dt,
Solver class which uses Differential Algebraic Equation(DAE) systems.
void * mem
Memory block allocated by IDA.
N_Vector state
Vector of problem variables.
N_Vector dstate_dt
Derivates of the state vector with respect to time.
SUNLinearSolver LS
Linear solver object.
Real step(Real time)
Solve system for the current time.
Int mNEQ
Number of equations in problem.
CPS::Task::List getTasks() override
Get tasks for scheduler.
std::vector< Int > mOffsets
Offsets vector for adding new equations to the residual vector.
Real mTimestep
Constant time step.
~DAESolver()
Deallocate all memory.
CPS::SimNode< Complex >::List mNodes
Nodes of the Problem.
DAESolver(String name, const CPS::SystemTopology &system, Real dt, Real mT0)
Create solve object with given parameters.
realtype rtol
Relative tolerance.
realtype abstol
Scalar absolute tolerance.
void initialize() final
Initialize Components & Nodes with initial values.
CPS::IdentifiedObject::List mComponents
Components of the Problem.
static int residualFunctionWrapper(realtype ttime, N_Vector state, N_Vector dstate_dt, N_Vector resid, void *user_data)
Residual Function of entire System.
realtype tret
Time IDA reached while solving.
SUNMatrix A
Template Jacobian Matrix.
Base class for more specific solvers such as MNA, ODE or IDA.