61 const double safety = 0.9;
62 const double max_ratio = 4.0;
63 const double pshrnk = 0.25;
64 const double pgrow = 0.20;
71 Dprintf((
" RKF5 integration step "));
91 (*ip)->SetState((*ip)->GetOldState() + 0.2*
A1[i]);
103 (*ip)->SetState((*ip)->GetOldState() + (3.0*
A1[i] + 9.0*
A2[i]) / 40.0);
115 (*ip)->SetState((*ip)->GetOldState() + 0.3 *
A1[i] - 0.9 *
A2[i] + 1.2 *
A3[i]);
127 (*ip)->SetState((*ip)->GetOldState() - 11.0 / 54.0 *
A1[i]
129 - 70.0 / 27.0 *
A3[i]
130 + 35.0 / 27.0 *
A4[i]);
142 (*ip)->SetState((*ip)->GetOldState() + 1631.0 / 55296.0 *
A1[i]
143 + 175.0 / 512.0 *
A2[i]
144 + 575.0 / 13824.0 *
A3[i]
145 + 44275.0 / 110592.0 *
A4[i]
146 + 253.0 / 4096.0 *
A5[i]);
158 (*ip)->SetState((*ip)->GetOldState() + 37.0 / 378.0 *
A1[i]
159 + 250.0 / 621.0 *
A3[i]
160 + 125.0 / 594.0 *
A4[i]
161 + 512.0 / 1771.0 *
A6[i]);
181 eerr = fabs( -277.0 / 64512.0 *
A1[i]
182 + 6925.0 / 370944.0 *
A3[i]
183 - 6925.0 / 202752.0 *
A4[i]
184 - 277.0 / 14336.0 *
A5[i]
185 + 277.0 / 7084.0 *
A6[i]);
188 if(terr < eerr*ratio) {
197 ratio = pow(ratio,pshrnk);
207 _Print(
"\n Integrator[%lu] ",(
unsigned long)n);
212 ratio =
min(pow(ratio,pgrow),max_ratio);
static bool IsEndStepEvent
int _Print(const char *fmt,...)
output of messages to stdout, too
Runge-Kutta-Fehlberg 5th order.
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
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
virtual void Integrate(void) override
double SIMLIB_DeltaTime
Time-SIMLIB_StepStartTime.
double SIMLIB_OptStep
optimal step
double SIMLIB_MaxStep
max. step