DPsim
Loading...
Searching...
No Matches
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.
 
 ~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)
 
void setLogSolveTimes (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.
 
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

- 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.

Constructor & Destructor Documentation

◆ ODEintSolver()

ODEintSolver::ODEintSolver ( String name,
CPS::ODEintInterface::Ptr comp,
Real dt,
Real t0 )

Create solve object with given parameters.

Definition at line 13 of file ODEintSolver.cpp.

◆ ~ODEintSolver()

ODEintSolver::~ODEintSolver ( )

Deallocate all memory.

Definition at line 60 of file ODEintSolver.cpp.

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.

Member Data Documentation

◆ curSolution

std::vector<Real> DPsim::ODEintSolver::curSolution

Current solution vector.

Definition at line 51 of file ODEintSolver.h.

◆ mComponent

CPS::ODEintInterface::Ptr DPsim::ODEintSolver::mComponent
protected

Pointer to current Component.

Definition at line 28 of file ODEintSolver.h.

◆ mTimestep

Real DPsim::ODEintSolver::mTimestep
protected

Constant time step.

Definition at line 30 of file ODEintSolver.h.

◆ ProbDim

int DPsim::ODEintSolver::ProbDim
protected

Problem Size.

Definition at line 32 of file ODEintSolver.h.

◆ solution

std::vector<std::vector<Real> > DPsim::ODEintSolver::solution
protected

Vector containing the solution at every timestep.

Definition at line 36 of file ODEintSolver.h.

◆ stepper

boost::numeric::odeint::runge_kutta4<std::vector<Real> > DPsim::ODEintSolver::stepper
protected

Stepper needed by ODEint.

Definition at line 34 of file ODEintSolver.h.

◆ system

std::vector<CPS::ODEintInterface::stateFnc> DPsim::ODEintSolver::system
protected

ODE of Component.

Definition at line 40 of file ODEintSolver.h.

◆ times

std::vector<Real> DPsim::ODEintSolver::times
protected

Vector containing all timesteps.

Definition at line 38 of file ODEintSolver.h.


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