Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# Testing convergence

pytools.convergence.estimate_order_of_convergence(abscissae, errors)

  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
  add_data_point(abscissa: float, error: float) → None
  estimate_order_of_convergence(gliding_mean: int | None = None) → ndarray
  order_estimate() → float
  max_error() → float
  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
  write_gnuplot_file(filename: str) → None

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
  Parameters:

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

class pytools.convergence.PConvergenceVerifier