Skip to main content

An extension to SageMath's module for computations with asymptotic expansions. Provides a special AsymptoticRing that allows to specify a secondary, dependent (monomially bounded) variable.

Project description

dependent_bterms

An extension to SageMath's module for computations with asymptotic expansions. Provides a special AsymptoticRing that allows to specify a secondary, dependent (monomially bounded) variable.

Quickstart and Summary

The package can be made available to your SageMath installation by running

$ sage -pip install dependent_bterms

from your terminal, or just

!pip install dependent_bterms

from within a SageMath Jupyter notebook. The package can then be used as follows:

sage: import dependent_bterms as dbt
sage: AR, n, k = dbt.AsymptoticRingWithDependentVariable(  # create a special AsymptoticRing
....:     'n^QQ',  # in one asymptotic (monomial) variable n with rational powers
....:     'k', 0, 1/2,  # with a symbolic variable k assumed to be in the range n^0 <= k <= n^(1/2)
....:     bterm_round_to=2  # and explicit error terms should be rounded to two decimal places
....: )
sage: k*n^2 + O(n^(3/2)) + k^3*n  # summands are ordered w.r.t. their highest potential growth
k^3*n  + k*n^2 + O(n^(3/2))
sage: asy = 1/n + AR.B(k/n^2, valid_from=10)
sage: asy_exp = dbt.taylor_with_explicit_error(lambda t: exp(t), asy, order=3, valid_from=10)
sage: asy_exp
1 + n^(-1) + B((abs(28/25*k + 73/100))*n^(-2), n >= 10)
sage: dbt.simplify_expansion(asy_exp, simplify_bterm_growth=True)
1 + n^(-1) + B(34/25*n^(-3/2), n >= 10)

One-line descriptions of the top-level members exported with this module are given below. A description of their respective input arguments and several examples are provided in the respective docstrings.

  • AsymptoticRingWithDependentVariables -- A special (univariate) AsymptoticRing that is aware of a monomially bounded symbolic variable.

  • evaluate -- Evaluate a symbolic expression without necessarily returning a result in the symbolic ring.

  • simplify_expansion -- Simplify an asymptotic expansion by allowing error terms to try and absorb parts of exact terms.

  • round_bterm_coefficients -- Round the coefficients of all B-terms in the given expansion to the next integer (or rational with respect to the provided precision).

  • set_bterm_valid_from -- Changes the point from which a B-term bound is valid such that the term remains valid.

  • expansion_upper_bound -- Returns an upper bound for the given asymptotic expansion by turning all B-term instances into exact terms

  • taylor_with_explicit_error -- Determines the series expansion with explicit error bounds of a given function f at a specified asymptotic term.

Demo

A worksheet containing a comprehensive introduction to the capabilities of this package can be found here: toolbox_demo.ipynb.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dependent_bterms-1.0.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

dependent_bterms-1.0.0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file dependent_bterms-1.0.0.tar.gz.

File metadata

  • Download URL: dependent_bterms-1.0.0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.8 Linux/6.5.0-1015-azure

File hashes

Hashes for dependent_bterms-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4a93e85d734e895bf2b763efe386c0024708c6dfb6c7c7068a7ad95c2f844c68
MD5 98bdbe823e42bb8256b2fdc9e1c560ab
BLAKE2b-256 3bb672a3b242a3937497e9fa8ca37db8f76c4f6f5da5babf714cb94e3ac99335

See more details on using hashes here.

File details

Details for the file dependent_bterms-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: dependent_bterms-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.8 Linux/6.5.0-1015-azure

File hashes

Hashes for dependent_bterms-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1d843f299e1c139db978e14f08bec4d17b3400a3808deaf426e4191ca177c32c
MD5 1778871ff52d484cb577685da750e568
BLAKE2b-256 048e55695aabbc2735bc11a78ac9b04f4ffe6fb257f76d7f3c19413036070055

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page