23#ifndef _RADAU_INTEGRATOR_H_
24#define _RADAU_INTEGRATOR_H_
26#include "dae_integrator.h"
35 enum class StepSizeControl {
41 double delta(
int i,
double z)
const override;
42 typedef void (*Fzdot)(
int* n,
double* t,
double* y,
double* yd,
double* rpar,
int* ipar);
43 typedef void (*Jac)(
int* n,
double *t,
double *y,
double *J,
int *nn,
double *rpar,
int *ipar);
44 typedef void (*Mass)(
int* n,
double* m,
int* lmas,
double* rpar,
int* ipar);
45 static Fzdot fzdot[5];
48 static void fzdotODE(
int* n,
double* t,
double* z,
double* zd,
double* rpar,
int* ipar);
49 static void fzdotDAE1(
int* n,
double* t,
double* y,
double* yd,
double* rpar,
int* ipar);
50 static void fzdotDAE2(
int* n,
double* t,
double* y,
double* yd,
double* rpar,
int* ipar);
51 static void fzdotDAE3(
int* n,
double* t,
double* y,
double* yd,
double* rpar,
int* ipar);
52 static void jacODE(
int* n,
double *t,
double *z,
double *J,
int *nn,
double *rpar,
int *ipar);
53 static void jacDAE1(
int* n,
double *t,
double *y,
double *J,
int *nn,
double *rpar,
int *ipar);
54 static void jacDAE2(
int* n,
double *t,
double *y,
double *J,
int *nn,
double *rpar,
int *ipar);
55 static void jacDAE3(
int* n,
double *t,
double *y,
double *J,
int *nn,
double *rpar,
int *ipar);
56 static void jacGGL(
int* n,
double *t,
double *y,
double *J,
int *nn,
double *rpar,
int *ipar);
57 static void fzdotGGL(
int* n,
double* t,
double* y,
double* yd,
double* rpar,
int* ipar);
58 static void massFull(
int* n,
double* m,
int* lmas,
double* rpar,
int* ipar);
59 static void massReduced(
int* n,
double* m,
int* lmas,
double* rpar,
int* ipar);
60 static void plot(
int* nr,
double* told,
double* t,
double* y,
double* cont,
int* lrc,
int* n,
double* rpar,
int* ipar,
int* irtrn);
62 void reinit()
override;
77 std::vector<int> iWorkExtended;
int *iWork;
80 int maxNewtonIter { 0 };
81 double newtonIterTol { 0 };
82 double jacobianRecomputation { 0 };
83 bool jacobianRecomputationAtRejectedSteps {
true };
85 StepSizeControl stepSizeControl { StepSizeControl::ModPred };
86 double stepSizeSaftyFactor { 0.9 };
88 std::exception_ptr exception;
91 ~RADAUIntegrator()
override =
default;
93 void setInitialStepSize(
double dt0_) {
dt0 = dt0_; }
94 void setMaximumStepSize(
double dtMax_) {
dtMax = dtMax_; }
95 void setStepLimit(
int maxSteps_) {
maxSteps = maxSteps_; }
96 void setMaximalNumberOfNewtonIterations(
int iter) { maxNewtonIter = iter; }
97 void setNewtonIterationTolerance(
double tol) { newtonIterTol = tol; }
98 void setJacobianRecomputation(
double value) { jacobianRecomputation = value; }
99 void setJacobianRecomputationAtRejectedSteps(
bool recomp) { jacobianRecomputationAtRejectedSteps = recomp; }
100 void setStepSizeControl(StepSizeControl ssc) { stepSizeControl = ssc; }
101 void setStepSizeSaftyFactor(
double fac) { stepSizeSaftyFactor = fac; }
Base class for all DAE integrators.
Definition: dae_integrator.h:33
virtual void integrate()=0
start the integration of the system set by setSystem. Each class implemeting this function should cal...
DAE-Integrator RADAU.
Definition: radau_integrator.h:32
void integrate() override
start the integration of the system set by setSystem. Each class implemeting this function should cal...
Definition: radau_integrator.cc:540
void initializeUsingXML(xercesc::DOMElement *element) override
initialize integrator
Definition: radau_integrator.cc:737
double dtMax
Definition: radau_integrator.h:74
double dt0
Definition: radau_integrator.h:70
int maxSteps
Definition: radau_integrator.h:72
namespace MBSim
Definition: bilateral_constraint.cc:30