Skip to main content

Functions represented as Chebyshev series

Project description

cheby

This package provides:

  • Basis of Chebyshev polynomials of the first kind
  • Functions represented as Chebyshev series

It is intended to be used for the resolution of differential equations using spectral methods. It is primarily a C++ library with a Python wrapper using pybind11. It also relies on Eigen for linear algebra.

Installation

The simplest way is to use pip:

pip install cheby

The package can be installed directly from source:

git clone https://github.com/GwenaelGabard/cheby
cd cheby
git submodule update --init --recursive
pip install .

This will require a C++ compiler and cmake.

Usage

The Python class Basis1D provides the following features:

  • Evaluation of Chebyshev polynomials of the first kind and their derivatives
  • Chebyshev points of the first and second kinds
  • Differentiation matrix
  • Matrix for Dirichlet recombination

The Python classes RealFunction and ComplexFunction provide representations of univariate functions as Chebyshev series. THey provide the following features:

  • Construction of the Chebyshev representation based on a Python function
  • Evaluation of the function and its derivatives
  • Addition, subtraction and multiplication
  • Primitive and integrals (over the whole domain or over a subsegment)
  • Roots and extrema
  • Integer powers

See the Jupyter notebooks in the examples folder for examples of usage.

Unit tests

Unit tests are written using pytest. They can be run using

pytest tests

License

This project is licensed under the MIT License - see the LICENSE file for details

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

cheby-0.3.7-cp312-cp312-win_amd64.whl (173.4 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

cheby-0.3.7-cp312-cp312-musllinux_1_1_x86_64.whl (790.6 kB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

cheby-0.3.7-cp312-cp312-musllinux_1_1_i686.whl (822.6 kB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ i686

cheby-0.3.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (270.0 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

cheby-0.3.7-cp312-cp312-macosx_10_9_x86_64.whl (187.9 kB view hashes)

Uploaded CPython 3.12 macOS 10.9+ x86-64

cheby-0.3.7-cp312-cp312-macosx_10_9_universal2.whl (331.2 kB view hashes)

Uploaded CPython 3.12 macOS 10.9+ universal2 (ARM64, x86-64)

cheby-0.3.7-cp311-cp311-win_amd64.whl (172.7 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

cheby-0.3.7-cp311-cp311-musllinux_1_1_x86_64.whl (792.2 kB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

cheby-0.3.7-cp311-cp311-musllinux_1_1_i686.whl (821.7 kB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ i686

cheby-0.3.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (267.2 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

cheby-0.3.7-cp311-cp311-macosx_10_9_x86_64.whl (187.0 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

cheby-0.3.7-cp311-cp311-macosx_10_9_universal2.whl (330.9 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)

cheby-0.3.7-cp310-cp310-win_amd64.whl (171.8 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

cheby-0.3.7-cp310-cp310-musllinux_1_1_x86_64.whl (791.1 kB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

cheby-0.3.7-cp310-cp310-musllinux_1_1_i686.whl (820.6 kB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ i686

cheby-0.3.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (265.7 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

cheby-0.3.7-cp310-cp310-macosx_10_9_x86_64.whl (185.6 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

cheby-0.3.7-cp310-cp310-macosx_10_9_universal2.whl (328.3 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)

cheby-0.3.7-cp39-cp39-win_amd64.whl (169.9 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

cheby-0.3.7-cp39-cp39-musllinux_1_1_x86_64.whl (791.3 kB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

cheby-0.3.7-cp39-cp39-musllinux_1_1_i686.whl (820.9 kB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ i686

cheby-0.3.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (265.9 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

cheby-0.3.7-cp39-cp39-macosx_10_9_x86_64.whl (185.7 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

cheby-0.3.7-cp39-cp39-macosx_10_9_universal2.whl (328.5 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64)

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