DPsim
Loading...
Searching...
No Matches
DPsim::Simulation Class Reference

The Simulation holds a SystemTopology and a Solver. More...

#include <Simulation.h>

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

Classes

struct  LoggerMapping
 

Public Types

typedef std::shared_ptr< Simulation > Ptr
 
- Public Types inherited from CPS::AttributeList
using Ptr = std::shared_ptr<AttributeList>
 

Public Member Functions

 Simulation (String name, CommandLineArgs &args)
 Creates simulation with name and CommandLineArgs.
 
 Simulation (String name, CPS::Logger::Level logLevel=CPS::Logger::Level::info)
 Creates simulation with name and log level.
 
virtual ~Simulation ()
 Desctructor.
 
void setSystem (const CPS::SystemTopology &system)
 
void setTimeStep (Real timeStep)
 
void setFinalTime (Real finalTime)
 
void setDomain (CPS::Domain domain=CPS::Domain::DP)
 
void setSolverType (Solver::Type solverType=Solver::Type::MNA)
 
void setSolverAndComponentBehaviour (Solver::Behaviour behaviour)
 set solver and component to initialization or simulation behaviour
 
void setDirectLinearSolverImplementation (DirectLinearSolverImpl directImpl)
 
void setDirectLinearSolverConfiguration (const DirectLinearSolverConfiguration &configuration)
 
void setMaxNumberOfIterations (int maxIterations)
 
void doInitFromNodesAndTerminals (Bool f=true)
 
void doSplitSubnets (Bool splitSubnets=true)
 
void setTearingComponents (CPS::IdentifiedObject::List tearComponents=CPS::IdentifiedObject::List())
 
void setScheduler (const std::shared_ptr< Scheduler > &scheduler)
 Set the scheduling method.
 
void doFrequencyParallelization (Bool value)
 Compute phasors of different frequencies in parallel.
 
void setSystemMatrixRecomputationMode (Solver::SystemMatrixRecomputationMode mode)
 Set the system-matrix recomputation mode.
 
void doSystemMatrixRecomputation (Bool value)
 
void doStateSpaceExtraction (Bool value=true)
 Enable extraction of the MNA-coupled discrete-time state matrix.
 
void setLogStepTimes (Bool f)
 
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
 
void setPFKeepLastSolution (Bool value)
 
Bool getPFKeepLastSolution () const
 
void setPFBaseApparentPowerFallback (Real value)
 
Real getPFBaseApparentPowerFallback () const
 
void setPFMaxIterations (CPS::UInt value)
 
CPS::UInt getPFMaxIterations () const
 
void setPFSolverUseSparse (Bool value)
 
Bool getPFSolverUseSparse () const
 
void setZeroSkipping (Bool enabled)
 Enable or disable exact-zero skipping in matrix assembly and power flow.
 
Bool getZeroSkipping () const
 
void setPFSolverEnforceReactiveLimits (Bool value)
 
Bool getPFSolverEnforceReactiveLimits () const
 
void setPFSolverBaseVoltageLooseTolerance (Real tolerance)
 
Real getPFSolverBaseVoltageLooseTolerance () const
 
void setPFSolverBaseVoltageStrictTolerance (Real tolerance)
 
Real getPFSolverBaseVoltageStrictTolerance () const
 
void initialize ()
 Create solver instances etc.
 
void start ()
 Start simulation without advancing in time.
 
void stop ()
 Stop simulation including scheduler and interfaces.
 
Real next ()
 Run until next time step.
 
void run ()
 Run simulation until total time is elapsed.
 
virtual Real step ()
 Solve system A * x = z for x and current time.
 
void sync () const
 Synchronize simulation with remotes by exchanging intial state over interfaces.
 
void schedule ()
 Create the schedule for the independent tasks.
 
void addEvent (Event::Ptr e)
 Schedule an event in the simulation.
 
void addLogger (DataLoggerInterface::Ptr logger)
 Add a new data logger.
 
void logStepTimes (String logName)
 Write step time measurements to log file.
 
void checkForOverruns (String logName)
 Check for overruns.
 
void logLUTimes ()
 Write LU decomposition times measurements to log file.
 
void addInterface (Interface::Ptr eint)
 
String name () const
 
Real time () const
 
Real finalTime () const
 
Int timeStepCount () const
 
Real timeStep () const
 
DataLogger::List & loggers ()
 
std::shared_ptr< Scheduler > scheduler ()
 
std::vector< Real > & stepTimes ()
 
const MNAStateSpaceExtractor & getStateSpaceExtractor (UInt solverIndex=0) const
 
CPS::AttributeBase::Ptr getIdObjAttribute (const String &comp, const String &attr)
 CHECK: Can these be deleted? getIdObjAttribute + "**attr =" should suffice.
 
void logIdObjAttribute (const String &comp, const String &attr)
 
void logAttribute (String name, CPS::AttributeBase::Ptr attr)
 CHECK: Can we store the attribute name / UID intrinsically inside the attribute?
 
- Public Member Functions inherited from CPS::AttributeList
 AttributeList ()
 
const AttributeBase::Map & attributes () const
 
template<typename T>
Attribute< T >::Ptr create (const String &name, T intitialValue=T())
 
template<typename T>
Attribute< T >::Ptr createDynamic (const String &name)
 
AttributeBase::Ptr attribute (const String &name) const
 Return pointer to an attribute.
 
template<typename T>
Attribute< T >::Ptr attributeTyped (const String &name) const
 Return pointer to an attribute.
 

Public Attributes

const CPS::Attribute< String >::Ptr mName
 Simulation name.
 
String mSolverPluginName
 If there we use a solver plugin, this specifies its name (excluding .so)
 
const CPS::Attribute< Real >::Ptr mFinalTime
 Final time of the simulation.
 
const CPS::Attribute< Real >::Ptr mTimeStep
 Simulation timestep.
 
const CPS::Attribute< Bool >::Ptr mPFKeepLastSolution
 
const CPS::Attribute< Real >::Ptr mPFBaseApparentPowerFallback
 
const CPS::Attribute< CPS::UInt >::Ptr mPFMaxIterations
 Maximum number of Newton-Raphson iterations for the PF solver.
 
const CPS::Attribute< Bool >::Ptr mPFSolverUseSparse
 
const CPS::Attribute< Bool >::Ptr mPFEnforceReactiveLimits
 
const CPS::Attribute< Real >::Ptr mPFBaseVoltageLooseTolerance
 Loose tolerance for a zone's Load base-voltage vs. its rating; default 0.1.
 
const CPS::Attribute< Real >::Ptr mPFBaseVoltageStrictTolerance
 Strict tolerance between authoritative base-voltage sources in a zone; default 0.01.
 
const CPS::Attribute< Bool >::Ptr mSplitSubnets
 
const CPS::Attribute< Bool >::Ptr mSteadyStateInit
 
CPS::Logger::Log mLog
 Simulation logger.
 

Protected Member Functions

void create ()
 Helper function for constructors.
 
template<typename VarType>
void createSolvers ()
 Create solvers depending on simulation settings.
 
template<typename VarType>
void createMNASolver ()
 Subroutine for MNA only because there are many MNA options.
 
void prepSchedule ()
 Prepare schedule for simulation.
 

Protected Attributes

Real mTime = 0
 Time variable that is incremented at every step.
 
Int mTimeStepCount = 0
 Number of step which have been executed for this simulation.
 
EventQueue mEvents
 The simulation event queue.
 
CPS::SystemTopology mSystem
 System list.
 
std::chrono::time_point< std::chrono::steady_clock > mSimulationStartTimePoint
 Start time point to measure calculation time.
 
std::chrono::time_point< std::chrono::steady_clock > mSimulationEndTimePoint
 End time point to measure calculation time.
 
std::chrono::duration< double > mSimulationCalculationTime
 Measured calculation time for simulation.
 
CPS::Logger::Level mLogLevel
 Simulation log level.
 
std::vector< Real > mStepTimes
 (Real) time needed for the timesteps
 
Bool mLogStepTimes = false
 activate collection of step times
 
CPS::Domain mDomain = CPS::Domain::DP
 
Solver::Type mSolverType = Solver::Type::MNA
 
Solver::Behaviour mSolverBehaviour = Solver::Behaviour::Simulation
 
Solver::List mSolvers
 
DirectLinearSolverImpl mDirectImpl = DirectLinearSolverImpl::Undef
 
DirectLinearSolverConfiguration mDirectLinearSolverConfiguration
 
Bool mInitFromNodesAndTerminals = true
 
Solver::SystemMatrixRecomputationMode mSystemMatrixRecomputationMode
 Requested system-matrix recomputation mode.
 
Bool mStateSpaceExtraction = false
 Enable extraction of the MNA-coupled discrete-time state matrix.
 
Bool mZeroSkipping = true
 Skip exact zero matrix contributions. Enabled by default for all solvers.
 
CPS::IdentifiedObject::List mTearComponents = CPS::IdentifiedObject::List()
 
Bool mFreqParallel = false
 
Bool mInitialized = false
 
Real mSteadStIniTimeLimit = Solver::DEFAULT_STEAD_ST_INI_TIME_LIMIT
 steady state initialization time limit
 
Real mSteadStIniAccLimit = Solver::DEFAULT_STEAD_ST_INI_ACC_LIMIT
 steady state initialization accuracy limit
 
std::shared_ptr< Scheduler > mScheduler
 Scheduler used for task scheduling.
 
CPS::Task::List mTasks
 List of all tasks to be scheduled.
 
Scheduler::Edges mTaskInEdges
 Task dependencies as incoming / outgoing edges.
 
Scheduler::Edges mTaskOutEdges
 
std::vector< Interface::Ptr > mInterfaces
 Vector of Interfaces.
 
DataLoggerInterface::List mLoggers
 The data loggers.
 
int mMaxIterations = 10
 

Additional Inherited Members

- Static Public Member Functions inherited from SharedFactory< AttributeList >
static std::shared_ptr< AttributeList > make (Args &&...args)
 

Detailed Description

The Simulation holds a SystemTopology and a Solver.

Every time step, the Simulation calls the step function of the Solver.

Definition at line 31 of file Simulation.h.

Member Typedef Documentation

◆ Ptr

typedef std::shared_ptr<Simulation> DPsim::Simulation::Ptr

Definition at line 33 of file Simulation.h.

Constructor & Destructor Documentation

◆ Simulation() [1/2]

Simulation::Simulation ( String name,
CommandLineArgs & args )

Creates simulation with name and CommandLineArgs.

Definition at line 53 of file Simulation.cpp.

◆ Simulation() [2/2]

Simulation::Simulation ( String name,
CPS::Logger::Level logLevel = CPS::Logger::Level::info )

Creates simulation with name and log level.

Definition at line 36 of file Simulation.cpp.

◆ ~Simulation()

virtual DPsim::Simulation::~Simulation ( )
inlinevirtual

Desctructor.

Definition at line 190 of file Simulation.h.

Member Function Documentation

◆ addEvent()

void DPsim::Simulation::addEvent ( Event::Ptr e)
inline

Schedule an event in the simulation.

Definition at line 321 of file Simulation.h.

◆ addInterface()

void DPsim::Simulation::addInterface ( Interface::Ptr eint)
inline

Definition at line 335 of file Simulation.h.

◆ addLogger()

void DPsim::Simulation::addLogger ( DataLoggerInterface::Ptr logger)
inline

Add a new data logger.

Definition at line 323 of file Simulation.h.

◆ checkForOverruns()

void Simulation::checkForOverruns ( String logName)

Check for overruns.

Definition at line 541 of file Simulation.cpp.

◆ create()

void Simulation::create ( )
protected

Helper function for constructors.

Definition at line 72 of file Simulation.cpp.

◆ createMNASolver()

template<typename VarType>
void Simulation::createMNASolver ( )
protected

Subroutine for MNA only because there are many MNA options.

Definition at line 176 of file Simulation.cpp.

◆ createSolvers()

template<typename VarType>
void Simulation::createSolvers ( )
protected

Create solvers depending on simulation settings.

Definition at line 107 of file Simulation.cpp.

◆ doFrequencyParallelization()

void DPsim::Simulation::doFrequencyParallelization ( Bool value)
inline

Compute phasors of different frequencies in parallel.

Definition at line 240 of file Simulation.h.

◆ doInitFromNodesAndTerminals()

void DPsim::Simulation::doInitFromNodesAndTerminals ( Bool f = true)
inline

Definition at line 223 of file Simulation.h.

◆ doSplitSubnets()

void DPsim::Simulation::doSplitSubnets ( Bool splitSubnets = true)
inline

Definition at line 227 of file Simulation.h.

◆ doStateSpaceExtraction()

void DPsim::Simulation::doStateSpaceExtraction ( Bool value = true)
inline

Enable extraction of the MNA-coupled discrete-time state matrix.

Definition at line 254 of file Simulation.h.

◆ doSteadyStateInit()

void DPsim::Simulation::doSteadyStateInit ( Bool f)
inline

activate steady state initialization

Definition at line 263 of file Simulation.h.

◆ doSystemMatrixRecomputation()

void DPsim::Simulation::doSystemMatrixRecomputation ( Bool value)
inline

DEPRECATED: Enable or disable system-matrix recomputation explicitly. This compatibility method maps true to Enabled and false to Disabled.

Definition at line 248 of file Simulation.h.

◆ finalTime()

Real DPsim::Simulation::finalTime ( ) const
inline

Definition at line 348 of file Simulation.h.

◆ getIdObjAttribute()

CPS::AttributeBase::Ptr Simulation::getIdObjAttribute ( const String & comp,
const String & attr )

CHECK: Can these be deleted? getIdObjAttribute + "**attr =" should suffice.

Definition at line 585 of file Simulation.cpp.

◆ getPFBaseApparentPowerFallback()

Real Simulation::getPFBaseApparentPowerFallback ( ) const

Definition at line 370 of file Simulation.cpp.

◆ getPFKeepLastSolution()

Bool Simulation::getPFKeepLastSolution ( ) const

Definition at line 364 of file Simulation.cpp.

◆ getPFMaxIterations()

CPS::UInt Simulation::getPFMaxIterations ( ) const

Definition at line 378 of file Simulation.cpp.

◆ getPFSolverBaseVoltageLooseTolerance()

Real Simulation::getPFSolverBaseVoltageLooseTolerance ( ) const

Definition at line 398 of file Simulation.cpp.

◆ getPFSolverBaseVoltageStrictTolerance()

Real Simulation::getPFSolverBaseVoltageStrictTolerance ( ) const

Definition at line 406 of file Simulation.cpp.

◆ getPFSolverEnforceReactiveLimits()

Bool Simulation::getPFSolverEnforceReactiveLimits ( ) const

Definition at line 390 of file Simulation.cpp.

◆ getPFSolverUseSparse()

Bool Simulation::getPFSolverUseSparse ( ) const

Definition at line 384 of file Simulation.cpp.

◆ getStateSpaceExtractor()

const MNAStateSpaceExtractor & Simulation::getStateSpaceExtractor ( UInt solverIndex = 0) const

Read-only access to the MNA state-space extractor of one solver.

If the system is split into subnetworks, one MNA solver is created per subnet. The solverIndex selects the corresponding solver.

Definition at line 563 of file Simulation.cpp.

◆ getZeroSkipping()

Bool DPsim::Simulation::getZeroSkipping ( ) const
inline

Definition at line 288 of file Simulation.h.

◆ initialize()

void Simulation::initialize ( )

Create solver instances etc.

Definition at line 82 of file Simulation.cpp.

◆ logAttribute()

void Simulation::logAttribute ( String name,
CPS::AttributeBase::Ptr attr )

CHECK: Can we store the attribute name / UID intrinsically inside the attribute?

Definition at line 613 of file Simulation.cpp.

◆ loggers()

DataLogger::List & DPsim::Simulation::loggers ( )
inline

Definition at line 351 of file Simulation.h.

◆ logIdObjAttribute()

void Simulation::logIdObjAttribute ( const String & comp,
const String & attr )

Definition at line 607 of file Simulation.cpp.

◆ logLUTimes()

void Simulation::logLUTimes ( )

Write LU decomposition times measurements to log file.

Definition at line 556 of file Simulation.cpp.

◆ logStepTimes()

void Simulation::logStepTimes ( String logName)

Write step time measurements to log file.

Definition at line 523 of file Simulation.cpp.

◆ name()

String DPsim::Simulation::name ( ) const
inline

Definition at line 346 of file Simulation.h.

◆ next()

Real Simulation::next ( )

Run until next time step.

Definition at line 462 of file Simulation.cpp.

◆ prepSchedule()

void Simulation::prepSchedule ( )
protected

Prepare schedule for simulation.

Definition at line 244 of file Simulation.cpp.

◆ run()

void Simulation::run ( )

Run simulation until total time is elapsed.

Definition at line 471 of file Simulation.cpp.

◆ schedule()

void Simulation::schedule ( )

Create the schedule for the independent tasks.

Definition at line 269 of file Simulation.cpp.

◆ scheduler()

std::shared_ptr< Scheduler > DPsim::Simulation::scheduler ( )
inline

Definition at line 352 of file Simulation.h.

◆ setDirectLinearSolverConfiguration()

void DPsim::Simulation::setDirectLinearSolverConfiguration ( const DirectLinearSolverConfiguration & configuration)
inline

Definition at line 214 of file Simulation.h.

◆ setDirectLinearSolverImplementation()

void DPsim::Simulation::setDirectLinearSolverImplementation ( DirectLinearSolverImpl directImpl)
inline

Definition at line 210 of file Simulation.h.

◆ setDomain()

void DPsim::Simulation::setDomain ( CPS::Domain domain = CPS::Domain::DP)
inline

Definition at line 200 of file Simulation.h.

◆ setFinalTime()

void DPsim::Simulation::setFinalTime ( Real finalTime)
inline

Definition at line 198 of file Simulation.h.

◆ setLogStepTimes()

void DPsim::Simulation::setLogStepTimes ( Bool f)
inline

If logStepTimes is enabled, the time needed for every timesteps is logged and can be written to a file or the console using logStepTimes()

Definition at line 259 of file Simulation.h.

◆ setMaxNumberOfIterations()

void DPsim::Simulation::setMaxNumberOfIterations ( int maxIterations)
inline

Definition at line 219 of file Simulation.h.

◆ setPFBaseApparentPowerFallback()

void Simulation::setPFBaseApparentPowerFallback ( Real value)

Definition at line 366 of file Simulation.cpp.

◆ setPFKeepLastSolution()

void Simulation::setPFKeepLastSolution ( Bool value)

Definition at line 360 of file Simulation.cpp.

◆ setPFMaxIterations()

void Simulation::setPFMaxIterations ( CPS::UInt value)

Definition at line 374 of file Simulation.cpp.

◆ setPFSolverBaseVoltageLooseTolerance()

void Simulation::setPFSolverBaseVoltageLooseTolerance ( Real tolerance)

Definition at line 394 of file Simulation.cpp.

◆ setPFSolverBaseVoltageStrictTolerance()

void Simulation::setPFSolverBaseVoltageStrictTolerance ( Real tolerance)

Definition at line 402 of file Simulation.cpp.

◆ setPFSolverEnforceReactiveLimits()

void Simulation::setPFSolverEnforceReactiveLimits ( Bool value)

Definition at line 386 of file Simulation.cpp.

◆ setPFSolverUseSparse()

void Simulation::setPFSolverUseSparse ( Bool value)

Definition at line 380 of file Simulation.cpp.

◆ setScheduler()

void DPsim::Simulation::setScheduler ( const std::shared_ptr< Scheduler > & scheduler)
inline

Set the scheduling method.

Definition at line 236 of file Simulation.h.

◆ setSolverAndComponentBehaviour()

void DPsim::Simulation::setSolverAndComponentBehaviour ( Solver::Behaviour behaviour)
inline

set solver and component to initialization or simulation behaviour

Definition at line 206 of file Simulation.h.

◆ setSolverType()

void DPsim::Simulation::setSolverType ( Solver::Type solverType = Solver::Type::MNA)
inline

Definition at line 202 of file Simulation.h.

◆ setSteadStIniAccLimit()

void DPsim::Simulation::setSteadStIniAccLimit ( Real v)
inline

set steady state initialization accuracy limit

Definition at line 267 of file Simulation.h.

◆ setSteadStIniTimeLimit()

void DPsim::Simulation::setSteadStIniTimeLimit ( Real v)
inline

set steady state initialization time limit

Definition at line 265 of file Simulation.h.

◆ setSystem()

void DPsim::Simulation::setSystem ( const CPS::SystemTopology & system)
inline

Definition at line 194 of file Simulation.h.

◆ setSystemMatrixRecomputationMode()

void DPsim::Simulation::setSystemMatrixRecomputationMode ( Solver::SystemMatrixRecomputationMode mode)
inline

Set the system-matrix recomputation mode.

Definition at line 243 of file Simulation.h.

◆ setTearingComponents()

void DPsim::Simulation::setTearingComponents ( CPS::IdentifiedObject::List tearComponents = CPS::IdentifiedObject::List())
inline

Definition at line 231 of file Simulation.h.

◆ setTimeStep()

void DPsim::Simulation::setTimeStep ( Real timeStep)
inline

Definition at line 196 of file Simulation.h.

◆ setZeroSkipping()

void DPsim::Simulation::setZeroSkipping ( Bool enabled)
inline

Enable or disable exact-zero skipping in matrix assembly and power flow.

Definition at line 286 of file Simulation.h.

◆ start()

void Simulation::start ( )

Start simulation without advancing in time.

Definition at line 410 of file Simulation.cpp.

◆ step()

Real Simulation::step ( )
virtual

Solve system A * x = z for x and current time.

Definition at line 503 of file Simulation.cpp.

◆ stepTimes()

std::vector< Real > & DPsim::Simulation::stepTimes ( )
inline

Definition at line 353 of file Simulation.h.

◆ stop()

void Simulation::stop ( )

Stop simulation including scheduler and interfaces.

Definition at line 442 of file Simulation.cpp.

◆ sync()

void Simulation::sync ( ) const

Synchronize simulation with remotes by exchanging intial state over interfaces.

Definition at line 232 of file Simulation.cpp.

◆ time()

Real DPsim::Simulation::time ( ) const
inline

Definition at line 347 of file Simulation.h.

◆ timeStep()

Real DPsim::Simulation::timeStep ( ) const
inline

Definition at line 350 of file Simulation.h.

◆ timeStepCount()

Int DPsim::Simulation::timeStepCount ( ) const
inline

Definition at line 349 of file Simulation.h.

Member Data Documentation

◆ mDirectImpl

DirectLinearSolverImpl DPsim::Simulation::mDirectImpl = DirectLinearSolverImpl::Undef
protected

Definition at line 114 of file Simulation.h.

◆ mDirectLinearSolverConfiguration

DirectLinearSolverConfiguration DPsim::Simulation::mDirectLinearSolverConfiguration
protected

Definition at line 116 of file Simulation.h.

◆ mDomain

CPS::Domain DPsim::Simulation::mDomain = CPS::Domain::DP
protected

Definition at line 106 of file Simulation.h.

◆ mEvents

EventQueue DPsim::Simulation::mEvents
protected

The simulation event queue.

Definition at line 85 of file Simulation.h.

◆ mFinalTime

const CPS::Attribute<Real>::Ptr DPsim::Simulation::mFinalTime

Final time of the simulation.

Definition at line 40 of file Simulation.h.

◆ mFreqParallel

Bool DPsim::Simulation::mFreqParallel = false
protected

Determines if the system matrix is split into several smaller matrices, one for each frequency. This can only be done if the network is composed of linear components that do no create cross frequency coupling.

Definition at line 135 of file Simulation.h.

◆ mInitFromNodesAndTerminals

Bool DPsim::Simulation::mInitFromNodesAndTerminals = true
protected

Definition at line 118 of file Simulation.h.

◆ mInitialized

Bool DPsim::Simulation::mInitialized = false
protected

Definition at line 137 of file Simulation.h.

◆ mInterfaces

std::vector<Interface::Ptr> DPsim::Simulation::mInterfaces
protected

Vector of Interfaces.

Definition at line 154 of file Simulation.h.

◆ mLog

CPS::Logger::Log DPsim::Simulation::mLog

Simulation logger.

Definition at line 180 of file Simulation.h.

◆ mLoggers

DataLoggerInterface::List DPsim::Simulation::mLoggers
protected

The data loggers.

Definition at line 164 of file Simulation.h.

◆ mLogLevel

CPS::Logger::Level DPsim::Simulation::mLogLevel
protected

Simulation log level.

Definition at line 98 of file Simulation.h.

◆ mLogStepTimes

Bool DPsim::Simulation::mLogStepTimes = false
protected

activate collection of step times

Definition at line 102 of file Simulation.h.

◆ mMaxIterations

int DPsim::Simulation::mMaxIterations = 10
protected

SynGen Interface

Definition at line 176 of file Simulation.h.

◆ mName

const CPS::Attribute<String>::Ptr DPsim::Simulation::mName

Simulation name.

Definition at line 36 of file Simulation.h.

◆ mPFBaseApparentPowerFallback

const CPS::Attribute<Real>::Ptr DPsim::Simulation::mPFBaseApparentPowerFallback

Fallback base apparent power used by the PF solver when no generator or transformer rating is available to derive it from.

Definition at line 48 of file Simulation.h.

◆ mPFBaseVoltageLooseTolerance

const CPS::Attribute<Real>::Ptr DPsim::Simulation::mPFBaseVoltageLooseTolerance

Loose tolerance for a zone's Load base-voltage vs. its rating; default 0.1.

Definition at line 63 of file Simulation.h.

◆ mPFBaseVoltageStrictTolerance

const CPS::Attribute<Real>::Ptr DPsim::Simulation::mPFBaseVoltageStrictTolerance

Strict tolerance between authoritative base-voltage sources in a zone; default 0.01.

Definition at line 66 of file Simulation.h.

◆ mPFEnforceReactiveLimits

const CPS::Attribute<Bool>::Ptr DPsim::Simulation::mPFEnforceReactiveLimits

Enforce generator reactive-power limits in the powerflow via PV<->PQ switching. Default false; opt in via setPFSolverEnforceReactiveLimits(true).

Definition at line 60 of file Simulation.h.

◆ mPFKeepLastSolution

const CPS::Attribute<Bool>::Ptr DPsim::Simulation::mPFKeepLastSolution

Definition at line 44 of file Simulation.h.

◆ mPFMaxIterations

const CPS::Attribute<CPS::UInt>::Ptr DPsim::Simulation::mPFMaxIterations

Maximum number of Newton-Raphson iterations for the PF solver.

Definition at line 51 of file Simulation.h.

◆ mPFSolverUseSparse

const CPS::Attribute<Bool>::Ptr DPsim::Simulation::mPFSolverUseSparse

Use the sparse-Jacobian powerflow solver (scales to large grids). Default false (dense solver); opt in via setPFSolverUseSparse(true). Ignored (dense solver used) if no sparse linear solver is available.

Definition at line 56 of file Simulation.h.

◆ mScheduler

std::shared_ptr<Scheduler> DPsim::Simulation::mScheduler
protected

Scheduler used for task scheduling.

Definition at line 147 of file Simulation.h.

◆ mSimulationCalculationTime

std::chrono::duration<double> DPsim::Simulation::mSimulationCalculationTime
protected

Measured calculation time for simulation.

Definition at line 94 of file Simulation.h.

◆ mSimulationEndTimePoint

std::chrono::time_point<std::chrono::steady_clock> DPsim::Simulation::mSimulationEndTimePoint
protected

End time point to measure calculation time.

Definition at line 92 of file Simulation.h.

◆ mSimulationStartTimePoint

std::chrono::time_point<std::chrono::steady_clock> DPsim::Simulation::mSimulationStartTimePoint
protected

Start time point to measure calculation time.

Definition at line 90 of file Simulation.h.

◆ mSolverBehaviour

Solver::Behaviour DPsim::Simulation::mSolverBehaviour = Solver::Behaviour::Simulation
protected

Definition at line 110 of file Simulation.h.

◆ mSolverPluginName

String DPsim::Simulation::mSolverPluginName

If there we use a solver plugin, this specifies its name (excluding .so)

Definition at line 38 of file Simulation.h.

◆ mSolvers

Solver::List DPsim::Simulation::mSolvers
protected

Definition at line 112 of file Simulation.h.

◆ mSolverType

Solver::Type DPsim::Simulation::mSolverType = Solver::Type::MNA
protected

Definition at line 108 of file Simulation.h.

◆ mSplitSubnets

const CPS::Attribute<Bool>::Ptr DPsim::Simulation::mSplitSubnets

Determines if the network should be split into subnetworks at decoupling lines. If the system is split, each subsystem is solved by a dedicated MNA solver.

Definition at line 72 of file Simulation.h.

◆ mStateSpaceExtraction

Bool DPsim::Simulation::mStateSpaceExtraction = false
protected

Enable extraction of the MNA-coupled discrete-time state matrix.

Definition at line 123 of file Simulation.h.

◆ mSteadStIniAccLimit

Real DPsim::Simulation::mSteadStIniAccLimit = Solver::DEFAULT_STEAD_ST_INI_ACC_LIMIT
protected

steady state initialization accuracy limit

Definition at line 143 of file Simulation.h.

◆ mSteadStIniTimeLimit

Real DPsim::Simulation::mSteadStIniTimeLimit = Solver::DEFAULT_STEAD_ST_INI_TIME_LIMIT
protected

steady state initialization time limit

Definition at line 141 of file Simulation.h.

◆ mSteadyStateInit

const CPS::Attribute<Bool>::Ptr DPsim::Simulation::mSteadyStateInit

Determines if steady-state initialization should be executed prior to the simulation. By default the initialization is disabled.

Definition at line 77 of file Simulation.h.

◆ mStepTimes

std::vector<Real> DPsim::Simulation::mStepTimes
protected

(Real) time needed for the timesteps

Definition at line 100 of file Simulation.h.

◆ mSystem

CPS::SystemTopology DPsim::Simulation::mSystem
protected

System list.

Definition at line 87 of file Simulation.h.

◆ mSystemMatrixRecomputationMode

Solver::SystemMatrixRecomputationMode DPsim::Simulation::mSystemMatrixRecomputationMode
protected
Initial value:
=
@ Auto
Select the mode automatically based on the system topology.
Definition Solver.h:45

Requested system-matrix recomputation mode.

Definition at line 120 of file Simulation.h.

◆ mTaskInEdges

Scheduler::Edges DPsim::Simulation::mTaskInEdges
protected

Task dependencies as incoming / outgoing edges.

Definition at line 151 of file Simulation.h.

◆ mTaskOutEdges

Scheduler::Edges DPsim::Simulation::mTaskOutEdges
protected

Definition at line 151 of file Simulation.h.

◆ mTasks

CPS::Task::List DPsim::Simulation::mTasks
protected

List of all tasks to be scheduled.

Definition at line 149 of file Simulation.h.

◆ mTearComponents

CPS::IdentifiedObject::List DPsim::Simulation::mTearComponents = CPS::IdentifiedObject::List()
protected

If tearing components exist, the Diakoptics solver is selected automatically.

Definition at line 129 of file Simulation.h.

◆ mTime

Real DPsim::Simulation::mTime = 0
protected

Time variable that is incremented at every step.

Definition at line 81 of file Simulation.h.

◆ mTimeStep

const CPS::Attribute<Real>::Ptr DPsim::Simulation::mTimeStep

Simulation timestep.

Definition at line 42 of file Simulation.h.

◆ mTimeStepCount

Int DPsim::Simulation::mTimeStepCount = 0
protected

Number of step which have been executed for this simulation.

Definition at line 83 of file Simulation.h.

◆ mZeroSkipping

Bool DPsim::Simulation::mZeroSkipping = true
protected

Skip exact zero matrix contributions. Enabled by default for all solvers.

Definition at line 125 of file Simulation.h.


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