Base class for GEAR-type integrators that defines the universal methods.
Numerical integration method based on BDFs (linear multistep methods).
Uses n-th order BDF for timestepping and (n-1)-th order BDF coefficients
to estimate a lower ordersolutuin for error control.
The adaptive timestep BDF coefficients are dynamically computed at the
beginning of each timestep from the buffered previous timsteps.
Revert integration engine to previous timestep, this is only
relevant for adaptive methods where the simulation timestep ‘dt’
is rescaled and the engine step is recomputed with the smaller
timestep.
Finalizes the timestep by resetting the solver for the implicit
update equation and computing the lower order estimate of the
solution for error control.
Adaptive-step GEAR integrator using 2nd order BDF with variable timesteps.
Uses 2nd order BDF for timestepping and 1st order BDF (Backward Euler) for truncation
error estimation. Dynamically computes BDF coefficients for variable timesteps. Excellent
for moderately stiff problems where adaptive timestepping is beneficial. Uses ESDIRK32
for startup.
Adaptive-step GEAR integrator using 3rd order BDF with variable timesteps.
Uses 3rd order BDF for timestepping and 2nd order BDF for truncation error estimation.
Dynamically computes BDF coefficients for variable timesteps. Suitable for stiff problems
requiring higher accuracy than GEAR21. Uses ESDIRK32 for startup.
Adaptive-step GEAR integrator using 4th order BDF with variable timesteps.
Uses 4th order BDF for timestepping and 3rd order BDF for truncation error estimation.
Dynamically computes BDF coefficients for variable timesteps. Suitable for stiff problems
requiring good accuracy. Uses ESDIRK32 for startup.
Adaptive-step GEAR integrator using 5th order BDF with variable timesteps.
Uses 5th order BDF for timestepping and 4th order BDF for truncation error estimation.
Dynamically computes BDF coefficients for variable timesteps. Suitable for stiff problems
requiring high accuracy, but stability region is smaller than lower-order GEAR methods.
Uses ESDIRK32 for startup.
This method dynamically adjusts both timestep and BDF order (between 2 and 5) based on
error estimates from lower and higher order predictors. Optimizes step size by using
higher orders for smooth regions and lower, more stable orders for stiff or rapidly
changing regions. Dynamically computes BDF coefficients for variable timesteps and orders.
Uses ESDIRK32 for startup.
Error estimation compares the current order solution with predictions from
order n-1 and n+1 formulas to select the optimal order.
Recommended for problems where the optimal order is unknown. This is similar to
MATLAB’s ode15s. Can be more efficient than fixed-order methods for problems with
varying smoothness.
Compute scaling factor for adaptive timestep based on absolute and
relative tolerances of the local truncation error estimate obtained from
esimated lower and higher order solution.
Checks if the error tolerance is achieved and returns a success metric.
Adapts the stepping order such that the normalized error is minimized and
larger steps can be taken by the integrator.
Parameters:
tr_m (array[float]) – lower order truncation error estimate
tr_p (array[float]) – higher order truncation error estimate
Returns:
success (bool) – True if the timestep was successful
error (float) – estimated error of the internal error controller
scale (float) – estimated timestep rescale factor for error control