AdaptiveSteps

class probnum.diffeq.AdaptiveSteps(firststep, atol, rtol, limitchange=(0.2, 10.0), safetyscale=0.95, minstep=1e-15, maxstep=1000000000000000.0)[source]

Bases: probnum.diffeq.StepRule

Adaptive step size selection using proportional control.

Parameters
  • firststep (float) – First step to be taken by the ODE solver (which happens in absence of error estimates).

  • 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

  • minstep (float, optional) – Minimum step that is allowed. A runtime error is thrown if the proposed step is smaller. Default is 1e-15.

  • maxstep (float, optional) – Maximum step that is allowed. A runtime error is thrown if the proposed step is larger. Default is 1e15.

Methods Summary

errorest_to_norm(errorest, reference_state)

Computes the norm of error per tolerance (usually referred to as ‘E’).

is_accepted(scaled_error)

Check if the proposed step should be accepted or not.

suggest(laststep, scaled_error[, localconvrate])

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

Methods Documentation

errorest_to_norm(errorest, reference_state)[source]

Computes the norm of error per tolerance (usually referred to as ‘E’).

The norm is usually the current error estimate normalised with atol, rtol, and the magnitude of the previous states. If this is smaller than 1, the step was small enough.

is_accepted(scaled_error)[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, scaled_error, localconvrate=None)[source]

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