AdaptiveSteps¶
- class probnum.diffeq.stepsize.AdaptiveSteps(firststep, atol, rtol, limitchange=(0.2, 10.0), safetyscale=0.95, minstep=1e-15, maxstep=1000000000000000.0)¶
Bases:
StepRule
Adaptive step-size selection (using proportional control).
- Parameters
firststep (Union[float, Real, floating]) – First step to be taken by the ODE solver (which happens in absence of error estimates).
atol (Union[_SupportsArray[dtype], _NestedSequence[_SupportsArray[dtype]], bool, int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]) – Absolute tolerance.
rtol (Union[_SupportsArray[dtype], _NestedSequence[_SupportsArray[dtype]], bool, int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]) – Relative tolerance.
limitchange (Optional[Tuple[Union[float, Real, floating]]]) – Lower and upper bounds for computed change of step.
safetyscale (Optional[Union[float, Real, floating]]) – Safety factor for proposal of distributions, 0 << safetyscale < 1
minstep (Optional[Union[float, Real, floating]]) – Minimum step that is allowed. A runtime error is thrown if the proposed step is smaller.
maxstep (Optional[Union[float, Real, floating]]) – Maximum step that is allowed. A runtime error is thrown if the proposed step is larger.
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.