mbsim  4.0.0
MBSim Kernel
MBSim::DASPKIntegrator Class Reference

Petzold’s DAE solver DASPK. More...

#include <daspk_integrator.h>

Inheritance diagram for MBSim::DASPKIntegrator:
[legend]

Public Types

enum  Formalism {
  ODE =0, DAE1, DAE2, GGL,
  unknown
}
 

Public Member Functions

void setMaximumStepSize (double dtMax_)
 
void setAbsoluteTolerance (const fmatvec::Vec &aTol_)
 
void setAbsoluteTolerance (double aTol_)
 
void setRelativeTolerance (const fmatvec::Vec &rTol_)
 
void setRelativeTolerance (double rTol_)
 
void setInitialStepSize (double dt0_)
 
void setFormalism (Formalism formalism_)
 
void setExcludeAlgebraicVariablesFromErrorTest (bool excludeAlgebraicVariables_)
 
void integrate ()
 start the integration of the system set by setSystem. Each class implemeting this function should call debugInit first.
 
virtual void initializeUsingXML (xercesc::DOMElement *element)
 initialize integrator More...
 
virtual void integrate ()=0
 start the integration of the system set by setSystem. Each class implemeting this function should call debugInit first.
 
void integrate (MBSim::DynamicSystemSolver &sys)
 Convinent function: call setSystem(&sys) and integrate()
 
- Public Member Functions inherited from MBSim::RootFindingIntegrator
void setRootFindingAccuracy (double dtRoot_)
 Define the root-finding accuracy.
 
void setPlotOnRoot (bool b)
 Define wether to trigger a plot before and after each found root.
 
void setToleranceForPositionConstraints (double gMax_)
 Set the maximum allowed position drift.
 
void setToleranceForVelocityConstraints (double gdMax_)
 Set the maximum allowed velocity drift.
 
double getToleranceForPositionConstraints ()
 Get the maximum allowed position drift.
 
double getToleranceForVelocityConstraints ()
 Get the maximum allowed velocity drift.
 
- Public Member Functions inherited from MBSim::Integrator
 Integrator ()
 constructor
 
 ~Integrator () override=default
 destructor
 
void setStartTime (double tStart_)
 
void setEndTime (double tEnd_)
 
void setPlotStepSize (double dtPlot_)
 
void setInitialState (const fmatvec::Vec &z0_)
 
double getStartTime () const
 
double getEndTime () const
 
double getPlotStepSize () const
 
const fmatvec::Vec & getInitialState () const override
 
void execute () override
 start solving the dynamic system set by setSystem.
 
void integrate (MBSim::DynamicSystemSolver &sys)
 Convinent function: call setSystem(&sys) and integrate()
 
void debugInit ()
 
virtual void preIntegrate ()
 
virtual void subIntegrate (double tStop)
 
virtual void postIntegrate ()
 
- Public Member Functions inherited from MBSim::Solver
 Solver ()
 constructor
 
 ~Solver () override=default
 destructor
 
void throwError (const std::string &msg) const
 
void setSystem (DynamicSystemSolver *s)
 
MBSim::DynamicSystemSolver * getSystem ()
 
const MBXMLUtils::DOMEvalException & getDOMEvalError () const
 

Private Types

typedef void(* Delta) (double *t, double *y_, double *yd_, double *cj, double *delta_, int *ires, double *rpar, int *ipar)
 

Private Member Functions

void calcSize ()
 

Static Private Member Functions

static void deltaODE (double *t, double *y_, double *yd_, double *cj, double *delta_, int *ires, double *rpar, int *ipar)
 
static void deltaDAE1 (double *t, double *y_, double *yd_, double *cj, double *delta_, int *ires, double *rpar, int *ipar)
 
static void deltaDAE2 (double *t, double *y_, double *yd_, double *cj, double *delta_, int *ires, double *rpar, int *ipar)
 
static void deltaGGL (double *t, double *y_, double *yd_, double *cj, double *delta_, int *ires, double *rpar, int *ipar)
 

Private Attributes

double dtMax {0}
 
fmatvec::Vec aTol
 
fmatvec::Vec rTol
 
double dt0 {0}
 
Formalism formalism {DAE2}
 
bool excludeAlgebraicVariables {true}
 
int neq
 

Static Private Attributes

static Delta delta [4]
 

Additional Inherited Members

- Protected Member Functions inherited from MBSim::RootFindingIntegrator
bool signChangedWRTsvLast (const fmatvec::Vec &svStepEnd) const
 
- Protected Attributes inherited from MBSim::RootFindingIntegrator
double dtRoot {1e-10}
 
bool plotOnRoot {false}
 
double gMax {-1}
 
double gdMax {-1}
 
fmatvec::Vec svLast
 
bool shift {false}
 
- Protected Attributes inherited from MBSim::Integrator
double tStart {0.}
 start, end, plot time
 
double tEnd {1.}
 
double dtPlot {1e-4}
 
fmatvec::Vec z0
 initial state
 
std::string name
 name of integrator
 
- Protected Attributes inherited from MBSim::Solver
MBSim::DynamicSystemSolver * system
 dynamic system
 
MBXMLUtils::DOMEvalException domEvalError
 Special XML helper variable.
 

Detailed Description

Petzold’s DAE solver DASPK.

This integrator uses DASPK (http://www.netlib.org/ode).

Member Function Documentation

◆ initializeUsingXML()

void MBSim::DASPKIntegrator::initializeUsingXML ( xercesc::DOMElement *  element)
virtual

initialize integrator

Parameters
XMLdescription

Reimplemented from MBSim::RootFindingIntegrator.

Member Data Documentation

◆ aTol

fmatvec::Vec MBSim::DASPKIntegrator::aTol
private

Absolute Toleranz

◆ dt0

double MBSim::DASPKIntegrator::dt0 {0}
private

step size for the first step

◆ dtMax

double MBSim::DASPKIntegrator::dtMax {0}
private

maximal step size

◆ excludeAlgebraicVariables

bool MBSim::DASPKIntegrator::excludeAlgebraicVariables {true}
private

exclude algebraic variables from error test

◆ formalism

Formalism MBSim::DASPKIntegrator::formalism {DAE2}
private

formalism

◆ rTol

fmatvec::Vec MBSim::DASPKIntegrator::rTol
private

Relative Toleranz


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