Skip to content
Snippets Groups Projects
Commit dcf5c6ca authored by Andreas Klöckner's avatar Andreas Klöckner Committed by Andreas Klöckner
Browse files

Document convergence functionality

parent c9012fa8
No related branches found
No related tags found
No related merge requests found
Testing convergence
-------------------
.. automodule:: pytools.convergence
...@@ -8,6 +8,7 @@ Welcome to pytools's documentation! ...@@ -8,6 +8,7 @@ Welcome to pytools's documentation!
reference reference
obj_array obj_array
persistent_dict persistent_dict
convergence
graph graph
tag tag
codegen codegen
......
"""
.. autofunction:: estimate_order_of_convergence
.. autoclass:: EOCRecorder
.. autofunction:: stringify_eocs
.. autoclass:: PConvergenceVerifier
"""
import numbers import numbers
from typing import List, Optional, Tuple from typing import List, Optional, Tuple
...@@ -7,9 +15,11 @@ import numpy as np ...@@ -7,9 +15,11 @@ import numpy as np
# {{{ eoc estimation -------------------------------------------------------------- # {{{ eoc estimation --------------------------------------------------------------
def estimate_order_of_convergence(abscissae, errors): def estimate_order_of_convergence(abscissae, errors):
"""Assuming that abscissae and errors are connected by a law of the form r"""Assuming that abscissae and errors are connected by a law of the form
.. math::
error = constant * abscissa ^ (order), \text{Error} = \text{constant} \cdot \text{abscissa }^{\text{order}},
this function finds, in a least-squares sense, the best approximation of 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). constant and order for the given data set. It returns a tuple (constant, order).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment