# StepRule¶

class probnum.diffeq.StepRule(firststep)

Bases: abc.ABC

(Adaptive) step size rules for ODE solvers.

Methods Summary

 errorest_to_norm(errorest, proposed_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, errorest[, localconvrate]) Suggest a new step h_{n+1} given error estimate e_n at step h_n.

Methods Documentation

abstract errorest_to_norm(errorest, proposed_state, current_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.

abstract 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.

abstract suggest(laststep, errorest, localconvrate=None)[source]

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