numdifftools.core.MaxStepGenerator

class numdifftools.core.MaxStepGenerator(base_step=2.0, step_ratio=2.0, num_steps=15, step_nom=None, offset=0, num_extrap=0, use_exact_steps=False, check_num_steps=True, scale=500)[source][source]

Generates a sequence of steps

where
steps = step_nom * base_step * step_ratio ** (-i + offset)

for i = 0, 1, ..., num_steps-1.

Parameters:

base_step : float, array-like, default 2.0

Defines the maximum step, if None, the value is set to EPS**(1/scale)

step_ratio : real scalar, optional, default 2

Ratio between sequential steps generated. Note: Ratio > 1 If None then step_ratio is 2 for n=1 otherwise step_ratio is 1.6

num_steps : scalar integer, optional, default min_num_steps + num_extrap

defines number of steps generated. It should be larger than min_num_steps = (n + order - 1) / fact where fact is 1, 2 or 4 depending on differentiation method used.

step_nom : default maximum(log(1+|x|), 1)

Nominal step where x is supplied at runtime through the __call__ method.

offset : real scalar, optional, default 0

offset to the base step

num_extrap : scalar integer

num_extrap

check_num_steps : boolean

If True make sure num_steps larger than the minimum required steps.

use_exact_steps : boolean

If true make sure exact steps are generated

scale : real scalar, default 500

scale used in base step.

__init__(base_step=2.0, step_ratio=2.0, num_steps=15, step_nom=None, offset=0, num_extrap=0, use_exact_steps=False, check_num_steps=True, scale=500)[source][source]

Methods

__init__([base_step, step_ratio, num_steps, ...])