55 const double err_lo = 0.75;
56 const double err_hi = 1.00;
57 const int max_dbl = 8;
62 static double PrevStep;
64 static int DoubleCount = 0;
66 Dprintf((
" ABM4 integration step "));
74 DoubleStepFlag =
true;
82 Dprintf((
"NEW START, Time = %g",(
double)Time));
109 Dprintf((
"own-method, step = %g, Time = %g",
118 Z[(ind+3)%
abm_ord][i] = (*ip)->GetOldDiff();
120 (*ip)->SetState(
PRED[i] = (*ip)->GetOldState() +
139 (*ip)->SetState( (*ip)->GetOldState()
140 + ( 9.0 * (*ip)->GetDiff()
157 eerr = 0.5 * fabs(
PRED[i] - (*ip)->GetState());
160 if(eerr < err_lo*terr)
163 if(eerr > err_hi*terr) {
175 _Print(
"\n Integrator[%i] ",i);
179 DoubleStepFlag =
false;
205 if(DoubleCount >= max_dbl) {
219 Dprintf((
"ABM4::PrepareStep()"));
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
virtual bool PrepareStep(void) override
prepare the object for the step of integration
virtual void Integrate(void) override
const double & OptStep
optimal integration step
Adams-Bashforth-Moulton 4th order.
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
virtual void Integrate(void)=0
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
bool SIMLIB_ConditionFlag
double SIMLIB_MinStep
minimal step
SingleStepMethod * SlavePtr(void)
return pointer to the starting method (initialize it also)
double SIMLIB_DeltaTime
Time-SIMLIB_StepStartTime.
virtual bool PrepareStep(void) override
prepare the object for the step of integration
double SIMLIB_OptStep
optimal step
double SIMLIB_MaxStep
max. step