Testing convergence#

pytools.convergence.estimate_order_of_convergence(abscissae, errors)[source]#

Assuming that abscissae and errors are connected by a law of the form

\[\text{Error} = \text{constant} \cdot \text{abscissa }^{\text{order}},\]

this function finds, in a least-squares sense, the best approximation of constant and order for the given data set. It returns a tuple (constant, order).

class pytools.convergence.EOCRecorder[source]#
add_data_point(abscissa: float, error: float) None[source]#
estimate_order_of_convergence(gliding_mean: int | None = None) ndarray[source]#
order_estimate() float[source]#
max_error() float[source]#
pretty_print(*, abscissa_label: str = 'h', error_label: str = 'Error', gliding_mean: int = 2, abscissa_format: str = '%s', error_format: str = '%s', eoc_format: str = '%s', table_type: str = 'markdown') str[source]#
write_gnuplot_file(filename: str) None[source]#
pytools.convergence.stringify_eocs(*eocs: EOCRecorder, names: Tuple[str, ...] | None = None, abscissa_label: str = 'h', error_label: str = 'Error', gliding_mean: int = 2, abscissa_format: str = '%s', error_format: str = '%s', eoc_format: str = '%s', table_type: str = 'markdown') str[source]#
Parameters:

names – a tuple of names to use for the error_label of each eoc.

class pytools.convergence.PConvergenceVerifier[source]#