48 const double err_coef = 0.02;
52 static bool DoubleStepFlag;
54 Dprintf((
" Euler integration step "));
73 A[i] = (*ip)->GetOldDiff();
74 (*ip)->SetState((*ip)->GetOldState() + dthlf*(*ip)->GetDiff());
96 A[i] -= (*ip)->GetDiff();
97 (*ip)->SetState(
si[i] + dthlf*(*ip)->GetDiff());
111 DoubleStepFlag =
true;
120 if(eerr < err_coef*terr)
135 _Print(
"\n Integrator[%lu] ",(
unsigned long)i);
140 DoubleStepFlag =
false;
152 if(wasContractStepFlag) {
virtual void Integrate(void) override
static Iterator LastIntegrator(void)
static bool IsEndStepEvent
IntegratorContainer::iterator Iterator
static bool StateCond(void)
check on changes of state conditions
static Iterator FirstIntegrator(void)
static void StoreState(Memory &di, Memory &si, StatusMemory &xi)
store state of integrators and status variables
static void RestoreState(double dthlf, Memory &di, Memory &si, StatusMemory &xi)
restore state of integrators and status variables
static void GoToState(Memory &di, Memory &si, StatusMemory &xi)
move startpoint to given state
Internal header file for SIMLIB/C++.
#define _SetTime(t, x)
macro for simple assignement to internal time variables
Implementation of class CalendarList interface is static - using global functions in SQS namespace.
const double & Time
model time (is NOT the block)
bool SIMLIB_ConditionFlag
double SIMLIB_RelativeError
relative error
double SIMLIB_OptStep
optimal step
bool SIMLIB_ContractStepFlag
requests shorter step
void SIMLIB_Dynamic()
performs evaluation of integrators and status blocks
int _Print(const char *fmt,...)
output of messages to stdout, too
double min(double a, double b)
double max(double a, double b)
void SIMLIB_warning(const enum _ErrEnum N)
print warning message and continue
double SIMLIB_AbsoluteError
absolute error
double SIMLIB_MinStep
minimal step
double SIMLIB_MaxStep
max. step
const double & OptStep
optimal integration step
double SIMLIB_ContractStep
requested step size
double SIMLIB_StepStartTime
last step time
double SIMLIB_StepSize
actual step
double SIMLIB_DeltaTime
Time-SIMLIB_StepStartTime.
Main SIMLIB/C++ interface.