DPsim
Public Member Functions | Public Attributes | Protected Attributes | List of all members
DPsim::ODEintSolver Class Reference

Solver class which uses ODE systems. More...

#include <ODEintSolver.h>

Inheritance diagram for DPsim::ODEintSolver:
[legend]
Collaboration diagram for DPsim::ODEintSolver:
[legend]

Public Member Functions

 ODEintSolver (String name, CPS::ODEintInterface::Ptr comp, Real dt, Real t0)
 Create solve object with given parameters.
 
Real step (Real time)
 Solve system for the current time. More...
 
 ~ODEintSolver ()
 Deallocate all memory.
 
- Public Member Functions inherited from DPsim::Solver
 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)
 
virtual void initialize ()
 
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 CPS::Task::List getTasks ()=0
 Get tasks for scheduler.
 
virtual void log (Real time, Int timeStepCount)
 Log results.
 
void setMaxNumberOfIterations (int maxIterations)
 

Public Attributes

std::vector< Real > curSolution
 Current solution vector.
 
- Public Attributes inherited from DPsim::Solver
int mMaxIterations = 10
 

Protected Attributes

CPS::ODEintInterface::Ptr mComponent
 Pointer to current Component.
 
Real mTimestep
 Constant time step.
 
int ProbDim
 Problem Size.
 
boost::numeric::odeint::runge_kutta4< std::vector< Real > > stepper
 Stepper needed by ODEint.
 
std::vector< std::vector< Real > > solution
 Vector containing the solution at every timestep.
 
std::vector< Real > times
 Vector containing all timesteps.
 
std::vector< CPS::ODEintInterface::stateFnc > system
 ODE of Component.
 
- Protected Attributes inherited from DPsim::Solver
String mName
 Name for logging.
 
CPS::Logger::Level mLogLevel
 Logging level.
 
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

- Public Types inherited from DPsim::Solver
enum  Behaviour { Initialization , Simulation }
 
enum class  Type { MNA , DAE , NRP }
 
typedef std::shared_ptr< SolverPtr
 
typedef std::vector< Ptr > List
 

Detailed Description

Solver class which uses ODE systems.

Definition at line 24 of file ODEintSolver.h.

Member Function Documentation

◆ step()

Real ODEintSolver::step ( Real  time)

Solve system for the current time.

write inital values into the mState Vector

solve ODE for time + mTimestep TODO: implement sysfunc

Writes the current solution back into the component

Logs current solution

Logs current time

Definition at line 28 of file ODEintSolver.cpp.


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