48 const double safety = 0.9;
49 const double max_ratio = 4.0;
50 const double pshrnk = 0.5;
51 const double pgrow = 1.0/3.0;
58 Dprintf((
" RKF3 integration step "));
78 (*ip)->SetState((*ip)->GetOldState() + 0.5*
A1[i]);
90 (*ip)->SetState((*ip)->GetOldState() + 0.75*
A2[i]);
102 (*ip)->SetState((*ip)->GetOldState()
103 + (2.0*
A1[i] + 3.0*
A2[i] + 4.0*
A3[i]) / 9.0);
124 eerr = fabs( -5.0*
A1[i]
131 if(terr < eerr*ratio) {
140 ratio = pow(ratio,pshrnk);
150 _Print(
"\n Integrator[%lu] ",(
unsigned long)n);
155 ratio =
min(pow(ratio,pgrow),max_ratio);
static bool IsEndStepEvent
int _Print(const char *fmt,...)
output of messages to stdout, too
void SIMLIB_Dynamic()
performs evaluation of integrators and status blocks
double SIMLIB_StepStartTime
last step time
double SIMLIB_ContractStep
requested step size
const double & OptStep
optimal integration step
Implementation of class CalendarList interface is static - using global functions in SQS namespace...
double max(double a, double b)
double SIMLIB_RelativeError
relative error
void SIMLIB_warning(const enum _ErrEnum N)
print warning message and continue
const double & Time
model time (is NOT the block)
double SIMLIB_StepSize
actual step
static bool StateCond(void)
check on changes of state conditions
virtual void Integrate(void) override
double min(double a, double b)
double SIMLIB_AbsoluteError
absolute error
bool SIMLIB_ContractStepFlag
requests shorter step
Internal header file for SIMLIB/C++.
static Iterator LastIntegrator(void)
static Iterator FirstIntegrator(void)
Main SIMLIB/C++ interface.
IntegratorContainer::iterator Iterator
#define _SetTime(t, x)
macro for simple assignement to internal time variables
double SIMLIB_MinStep
minimal step
double SIMLIB_DeltaTime
Time-SIMLIB_StepStartTime.
Runge-Kutta-Fehlberg 3rd order.
double SIMLIB_OptStep
optimal step
double SIMLIB_MaxStep
max. step