mbsim  4.0.0
MBSim Kernel
MBSim::RADAUIntegrator Class Reference

DAE-Integrator RADAU. More...

#include <radau_integrator.h>

Inheritance diagram for MBSim::RADAUIntegrator:
[legend]

Public Types

enum class  StepSizeControl { ModPred = 1 , Classic = 2 }
 
- Public Types inherited from MBSim::DAEIntegrator
enum  Formalism {
  ODE =0 , DAE1 , DAE2 , DAE3 ,
  GGL , unknown
}
 

Public Member Functions

void setInitialStepSize (double dt0_)
 
void setMaximumStepSize (double dtMax_)
 
void setStepLimit (int maxSteps_)
 
void setMaximalNumberOfNewtonIterations (int iter)
 
void setNewtonIterationTolerance (double tol)
 
void setJacobianRecomputation (double value)
 
void setJacobianRecomputationAtRejectedSteps (bool recomp)
 
void setStepSizeControl (StepSizeControl ssc)
 
void setStepSizeSaftyFactor (double fac)
 
void integrate () override
 start the integration of the system set by setSystem. Each class implemeting this function should call debugInit first. More...
 
void initializeUsingXML (xercesc::DOMElement *element) override
 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. More...
 
void integrate (MBSim::DynamicSystemSolver &sys)
 Convinent function: call setSystem(&sys) and integrate()
 
- Public Member Functions inherited from MBSim::DAEIntegrator
void initializeUsingXML (xercesc::DOMElement *element) override
 initialize integrator More...
 
void setFormalism (Formalism formalism_)
 
void setAbsoluteTolerance (const fmatvec::Vec &aTol_)
 
void setAbsoluteTolerance (double aTol_)
 
void setRelativeTolerance (const fmatvec::Vec &rTol_)
 
void setRelativeTolerance (double rTol_)
 
void setAbsolutePositionTolerance (double aTolPos_)
 
void setAbsoluteVelocityTolerance (double aTolVel_)
 
void setAbsoluteFirstOrderTolerance (double aTol1st_)
 
void setAbsoluteForceTolerance (double aTolForce_)
 
void setRelativePositionTolerance (double rTolPos_)
 
void setRelativeVelocityTolerance (double rTolVel_)
 
void setRelativeFirstOrderTolerance (double rTol1st_)
 
void setRelativeForceTolerance (double rTolForce_)
 
- Public Member Functions inherited from MBSim::ImplicitIntegrator
void setReducedForm (bool reduced_)
 
void setPartiallyAnalyticalJacobian (bool partiallyAnalyticalJacobian_)
 
- 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.
 
virtual void initializeUsingXML (xercesc::DOMElement *element)
 initialize integrator More...
 
- 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. More...
 
virtual void integrate ()=0
 start the integration of the system set by setSystem. Each class implemeting this function should call debugInit first. More...
 
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 ()
 
void initializeUsingXML (xercesc::DOMElement *element) override
 initialize integrator More...
 
- Public Member Functions inherited from MBSim::Solver
 Solver ()
 constructor
 
 ~Solver () override=default
 destructor
 
void throwError (const std::string &msg) const
 
virtual void execute ()=0
 start solving the dynamic system set by setSystem. More...
 
virtual void postprocessing ()
 
virtual void initializeUsingXML (xercesc::DOMElement *element)
 
virtual const fmatvec::Vec & getInitialState () const =0
 
void setSystem (DynamicSystemSolver *s)
 
MBSim::DynamicSystemSolvergetSystem ()
 
const MBXMLUtils::DOMEvalExceptiongetDOMEvalError () const
 

Private Types

typedef void(* Fzdot) (int *n, double *t, double *y, double *yd, double *rpar, int *ipar)
 
typedef void(* Jac) (int *n, double *t, double *y, double *J, int *nn, double *rpar, int *ipar)
 
typedef void(* Mass) (int *n, double *m, int *lmas, double *rpar, int *ipar)
 

Private Member Functions

double delta (int i, double z) const override
 
void reinit () override
 

Static Private Member Functions

static void fzdotODE (int *n, double *t, double *z, double *zd, double *rpar, int *ipar)
 
static void fzdotDAE1 (int *n, double *t, double *y, double *yd, double *rpar, int *ipar)
 
static void fzdotDAE2 (int *n, double *t, double *y, double *yd, double *rpar, int *ipar)
 
static void fzdotDAE3 (int *n, double *t, double *y, double *yd, double *rpar, int *ipar)
 
static void jacODE (int *n, double *t, double *z, double *J, int *nn, double *rpar, int *ipar)
 
static void jacDAE1 (int *n, double *t, double *y, double *J, int *nn, double *rpar, int *ipar)
 
static void jacDAE2 (int *n, double *t, double *y, double *J, int *nn, double *rpar, int *ipar)
 
static void jacDAE3 (int *n, double *t, double *y, double *J, int *nn, double *rpar, int *ipar)
 
static void jacGGL (int *n, double *t, double *y, double *J, int *nn, double *rpar, int *ipar)
 
static void fzdotGGL (int *n, double *t, double *y, double *yd, double *rpar, int *ipar)
 
static void massFull (int *n, double *m, int *lmas, double *rpar, int *ipar)
 
static void massReduced (int *n, double *m, int *lmas, double *rpar, int *ipar)
 
static void plot (int *nr, double *told, double *t, double *y, double *cont, int *lrc, int *n, double *rpar, int *ipar, int *irtrn)
 

Private Attributes

double tPlot {0}
 
double dtOut {0}
 
double s0
 
double time {0}
 
double dt0 {0}
 
int maxSteps {std::numeric_limits<int>::max()}
 
double dtMax {0}
 
int mlJac
 
int muJac
 
std::vector< int > iWorkExtended
 
int * iWork
 
fmatvec::Vec work
 
int maxNewtonIter { 0 }
 
double newtonIterTol { 0 }
 
double jacobianRecomputation { 0 }
 
bool jacobianRecomputationAtRejectedSteps { true }
 
bool drift { false }
 
StepSizeControl stepSizeControl { StepSizeControl::ModPred }
 
double stepSizeSaftyFactor { 0.9 }
 
std::exception_ptr exception
 

Static Private Attributes

static Fzdot fzdot [5]
 
static Jac jac [5]
 
static Mass mass [2]
 

Additional Inherited Members

- Protected Member Functions inherited from MBSim::DAEIntegrator
void par_ud_xd_gdd_par_q_u (fmatvec::Mat &J, const fmatvec::Vec &ud_=fmatvec::Vec())
 
void par_zd_gdd_par_q_u (fmatvec::Mat &J, const fmatvec::Vec &ud_=fmatvec::Vec())
 
void par_ud_xd_par_x (fmatvec::Mat &J)
 
void par_ud_xd_gd_par_q (fmatvec::Mat &J)
 
void par_zd_gd_par_q (fmatvec::Mat &J)
 
void par_ud_xd_g_par_q (fmatvec::Mat &J)
 
void par_zd_g_par_q (fmatvec::Mat &J)
 
void par_ud_xd_gd_g_par_q (fmatvec::Mat &J)
 
void par_zd_gd_g_par_q (fmatvec::Mat &J)
 
void calcSize () override
 
void init () override
 
virtual void reinit ()
 
- Protected Member Functions inherited from MBSim::ImplicitIntegrator
virtual double delta (int i, double z) const
 
void par_ud_xd_par_q (fmatvec::Mat &J)
 
void par_zd_par_q (fmatvec::Mat &J)
 
void par_ud_xd_par_u_x (fmatvec::Mat &J, bool updla)
 
void par_zd_par_z (fmatvec::Mat &J, bool updla)
 
virtual void calcSize ()
 
virtual void init ()
 
- Protected Member Functions inherited from MBSim::RootFindingIntegrator
bool signChangedWRTsvLast (const fmatvec::Vec &svStepEnd) const
 
- Protected Attributes inherited from MBSim::DAEIntegrator
Formalism formalism {ODE}
 
fmatvec::Vec aTol
 
std::optional< double > aTolScalar
 
fmatvec::Vec rTol
 
std::optional< double > rTolScalar
 
std::optional< double > aTolPos
 
std::optional< double > aTolVel
 
std::optional< double > aTol1st
 
std::optional< double > aTolForce
 
std::optional< double > rTolPos
 
std::optional< double > rTolVel
 
std::optional< double > rTol1st
 
std::optional< double > rTolForce
 
int laInd
 
int lInd
 
fmatvec::Vec gd0
 
fmatvec::Vec g0
 
fmatvec::RangeV Rla
 
fmatvec::RangeV Rl
 
fmatvec::RangeV RlaMove
 
fmatvec::RangeV RlMove
 
- Protected Attributes inherited from MBSim::ImplicitIntegrator
bool reduced {false}
 
bool partiallyAnalyticalJacobian {false}
 
int neq
 
int qMove
 
fmatvec::Vec zd0
 
fmatvec::RangeV Rq
 
fmatvec::RangeV Ru
 
fmatvec::RangeV Rx
 
fmatvec::RangeV Rz
 
fmatvec::RangeV RuMove
 
fmatvec::RangeV RxMove
 
- 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::DynamicSystemSolversystem
 dynamic system
 
MBXMLUtils::DOMEvalException domEvalError
 Special XML helper variable.
 

Detailed Description

DAE-Integrator RADAU.

Member Function Documentation

◆ delta()

double MBSim::RADAUIntegrator::delta ( int  i,
double  z 
) const
overrideprivatevirtual

Reimplemented from MBSim::ImplicitIntegrator.

◆ initializeUsingXML()

void MBSim::RADAUIntegrator::initializeUsingXML ( xercesc::DOMElement *  element)
overridevirtual

initialize integrator

Parameters
XMLdescription

Reimplemented from MBSim::DAEIntegrator.

◆ integrate() [1/2]

void MBSim::RADAUIntegrator::integrate ( )
overridevirtual

start the integration of the system set by setSystem. Each class implemeting this function should call debugInit first.

Implements MBSim::Integrator.

◆ integrate() [2/2]

virtual void MBSim::Integrator::integrate ( )
virtual

start the integration of the system set by setSystem. Each class implemeting this function should call debugInit first.

Implements MBSim::Integrator.

◆ reinit()

void MBSim::RADAUIntegrator::reinit ( )
overrideprivatevirtual

Reimplemented from MBSim::DAEIntegrator.

Member Data Documentation

◆ dt0

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

step size for the first step

◆ dtMax

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

maximal step size

◆ maxSteps

int MBSim::RADAUIntegrator::maxSteps {std::numeric_limits<int>::max()}
private

maximum number of steps


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