Skip to main content

Numerical integration technique

Project description

Cubature

Cubature

Github Actions status:

pytest and coverage

Coverage status:

Codecov Status

What is Cubature?

It is a numerical integration technique. From MathWorld http://mathworld.wolfram.com/Cubature.html, Ueberhuber (1997, p. 71) and Krommer and Ueberhuber (1998, pp. 49 and 155-165) use the word "quadrature" to mean numerical computation of a univariate integral, and "cubature" to mean numerical computation of a multiple integral.

Cubature for Python

This is a wrapper to Prof. Steven Johnson's C package, available at https://github.com/stevengj/cubature. The current version is a wrapper to version 1.0.4 of Prof. Johnson's package.

Documentation

Please, see the module documentation here http://saullocastro.github.io/cubature.

Python wrapper for the Cubature package

From the Nanostructures and Computation Wiki at MIT http://ab-initio.mit.edu/wiki/index.php/Cubature, Steven W. Johnson http://math.mit.edu/~stevenj has written a simple C package for adaptive multidimensional integration (cubature) of vector-valued functions over hypercubes and this is a Python wrapper for the referred C package.

Installation from source code

You must have Cython installed. Then do:

python setup.py install 

or (usually in Linux):

python3 setup.py install

Installation from pip repository

Just do:

python -m pip install cubature

or (usually in Linux):

python3 -m pip install cubature

Running the tests

To run the tests you will have to download the source code. After installing as explained above, go to the source code root folder and run:

py.test .

The Python wrapper has been proven using test integrands from the C package and some additional testing functions from Genz. The integrands were implemented in Cython and verified with Mathematica.

Citing this Python wrapper for Cubature

We kindly ask you to cite this Python library properly. Also, it would be helpful if you could cite the papers where this methods has been applied as well.

Castro, S.G.P.; Loukianov, A.; et al. "Python wrapper for Cubature: adaptive multidimensional integration". DOI:10.5281/zenodo.2541552. Version 0.18.6, 2024.

Citing Papers using this Python wrapper for Cubature

Used to integrate tangent stiffness matrices in computational solid mechanics

Castro, S.G.P. et al. "Evaluation of non-linear buckling loads of geometrically imperfect composite cylinders and cones with the Ritz method". Composite Structures, Vol. 122, 284-299, 2015.

Castro, S.G.P. et al. "A semi-analytical approach for linear and non-linear analysis of unstiffened laminated composite cylinders and cones under axial, torsion and pressure loads". Thin-Walled Structures, Vol. 90, 61-73, 2015.

Examples

Some examples are given in "./examples" https://github.com/saullocastro/cubature/tree/master/examples.

Fork me!

You are welcome to fork this repository and modify it in whatever way you want. It will also be nice if you could send a pull request here in case you think your modifications are valuable for another person.

License

This wrapper follows the GNU-GPL license terms of Steven G. Johnson described in the C Package <https://github.com/saullocastro/cubature/tree/master/cubature/cpackage/COPYING>_.

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

cubature-0.18.6.tar.gz (15.3 MB view hashes)

Uploaded Source

Built Distributions

cubature-0.18.6-cp312-cp312-win_amd64.whl (10.5 MB view hashes)

Uploaded CPython 3.12 Windows x86-64

cubature-0.18.6-cp312-cp312-musllinux_1_1_x86_64.whl (11.6 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

cubature-0.18.6-cp312-cp312-musllinux_1_1_i686.whl (11.5 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ i686

cubature-0.18.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.6 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

cubature-0.18.6-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (11.5 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

cubature-0.18.6-cp312-cp312-macosx_10_9_universal2.whl (21.2 MB view hashes)

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

cubature-0.18.6-cp311-cp311-win_amd64.whl (10.5 MB view hashes)

Uploaded CPython 3.11 Windows x86-64

cubature-0.18.6-cp311-cp311-musllinux_1_1_x86_64.whl (11.6 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

cubature-0.18.6-cp311-cp311-musllinux_1_1_i686.whl (11.5 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ i686

cubature-0.18.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.6 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

cubature-0.18.6-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (11.5 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

cubature-0.18.6-cp311-cp311-macosx_10_9_universal2.whl (21.2 MB view hashes)

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

cubature-0.18.6-cp310-cp310-win_amd64.whl (10.5 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

cubature-0.18.6-cp310-cp310-musllinux_1_1_x86_64.whl (11.6 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

cubature-0.18.6-cp310-cp310-musllinux_1_1_i686.whl (11.5 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ i686

cubature-0.18.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.5 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

cubature-0.18.6-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (11.5 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

cubature-0.18.6-cp310-cp310-macosx_11_0_x86_64.whl (10.6 MB view hashes)

Uploaded CPython 3.10 macOS 11.0+ x86-64

cubature-0.18.6-cp39-cp39-win_amd64.whl (10.6 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

cubature-0.18.6-cp39-cp39-musllinux_1_1_x86_64.whl (11.6 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

cubature-0.18.6-cp39-cp39-musllinux_1_1_i686.whl (11.5 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ i686

cubature-0.18.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.5 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

cubature-0.18.6-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (11.5 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

cubature-0.18.6-cp39-cp39-macosx_11_0_x86_64.whl (10.6 MB view hashes)

Uploaded CPython 3.9 macOS 11.0+ x86-64

cubature-0.18.6-cp38-cp38-win_amd64.whl (10.6 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

cubature-0.18.6-cp38-cp38-musllinux_1_1_x86_64.whl (11.6 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

cubature-0.18.6-cp38-cp38-musllinux_1_1_i686.whl (11.5 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ i686

cubature-0.18.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.5 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

cubature-0.18.6-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (11.5 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

cubature-0.18.6-cp38-cp38-macosx_11_0_x86_64.whl (10.6 MB view hashes)

Uploaded CPython 3.8 macOS 11.0+ x86-64

cubature-0.18.6-cp37-cp37m-win_amd64.whl (10.5 MB view hashes)

Uploaded CPython 3.7m Windows x86-64

cubature-0.18.6-cp37-cp37m-musllinux_1_1_x86_64.whl (11.5 MB view hashes)

Uploaded CPython 3.7m musllinux: musl 1.1+ x86-64

cubature-0.18.6-cp37-cp37m-musllinux_1_1_i686.whl (11.4 MB view hashes)

Uploaded CPython 3.7m musllinux: musl 1.1+ i686

cubature-0.18.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.4 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

cubature-0.18.6-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (11.4 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

cubature-0.18.6-cp37-cp37m-macosx_11_0_x86_64.whl (10.6 MB view hashes)

Uploaded CPython 3.7m macOS 11.0+ 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