Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pytools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Klöckner
pytools
Commits
dcf5c6ca
Commit
dcf5c6ca
authored
8 months ago
by
Andreas Klöckner
Committed by
Andreas Klöckner
8 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Document convergence functionality
parent
c9012fa8
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
doc/convergence.rst
+4
-0
4 additions, 0 deletions
doc/convergence.rst
doc/index.rst
+1
-0
1 addition, 0 deletions
doc/index.rst
pytools/convergence.py
+12
-2
12 additions, 2 deletions
pytools/convergence.py
with
17 additions
and
2 deletions
doc/convergence.rst
0 → 100644
+
4
−
0
View file @
dcf5c6ca
Testing convergence
-------------------
.. automodule:: pytools.convergence
This diff is collapsed.
Click to expand it.
doc/index.rst
+
1
−
0
View file @
dcf5c6ca
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
pytools/convergence.py
+
12
−
2
View file @
dcf5c6ca
"""
.. 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::
e
rror = constant
* abscissa ^ (
order
)
,
\text{E
rror
}
=
\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).
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment