AdaptiveSteps

class probnum.diffeq.AdaptiveSteps(tol_per_step, localconvrate, limitchange=(0.1, 5.0), safetyscale=0.95, **kwargs)[source]

Bases: probnum.diffeq.StepRule

Adaptive step size selection based on tolerance per step.

By default, there is no being “too small” for a step. However, a Warning is printed if the suggested step is smaller than roughly machine precision: 1e-15.

Parameters:
  • tol_per_step (float) – Tolerance per step (absolute)
  • localconvrate (float) – (Estimated) convergence rate of the solver.
  • limitchange (list with 2 elements, optional) – Lower and upper bounds for computed change of step.
  • safetyscale (float, optional) – Safety factor for proposal of distributions, 0 << safetyscale < 1

Methods Summary

is_accepted(proposedstep, errorest, **kwargs) Check if the proposed step should be accepted or not.
suggest(laststep, errorest, **kwargs) Suggest a new step h_{n+1} given error estimate e_n at step h_n.

Methods Documentation

is_accepted(proposedstep, errorest, **kwargs)[source]

Check if the proposed step should be accepted or not.

Variable “proposedstep” not used yet, but may be important in the future, e.g. if we decide that instead of tol_per_step (see AdaptiveSteps) we want to be able to control tol_per_unitstep.

suggest(laststep, errorest, **kwargs)[source]

Suggest a new step h_{n+1} given error estimate e_n at step h_n.