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.5, 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.5.tar.gz (15.3 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

cubature-0.18.5-cp39-cp39-win_amd64.whl (10.6 MB view details)

Uploaded CPython 3.9Windows x86-64

cubature-0.18.5-cp38-cp38-win_amd64.whl (10.6 MB view details)

Uploaded CPython 3.8Windows x86-64

File details

Details for the file cubature-0.18.5.tar.gz.

File metadata

  • Download URL: cubature-0.18.5.tar.gz
  • Upload date:
  • Size: 15.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for cubature-0.18.5.tar.gz
Algorithm Hash digest
SHA256 993ad134dd8bb8861aa059096eb132510fc07b9b364afc0da59ff2f69c6bf6ef
MD5 b5d6d1b96743997c7f9a8a7d3d0b3fe5
BLAKE2b-256 37d76250ae5d3bc7b2986b2e2179dbcebdaec36ec9ee13b1f55b98f406013f0c

See more details on using hashes here.

File details

Details for the file cubature-0.18.5-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: cubature-0.18.5-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 10.6 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.13

File hashes

Hashes for cubature-0.18.5-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 aef5a526c6f7fa4f23419b5e57c9ad9037359c18cd10b0d95ec497a50f8c8ff1
MD5 7f2daddc601245094812e06fbd565bf3
BLAKE2b-256 c6b9fbab997b4e629fdbfba86a4d0df3c91d270483e9a28d7f81ce0de97934ca

See more details on using hashes here.

File details

Details for the file cubature-0.18.5-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: cubature-0.18.5-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 10.6 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.10

File hashes

Hashes for cubature-0.18.5-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 816b95065344014f07a9a483f2d701fca8afedecb6d020eaa1267a1d8898291f
MD5 c0512ebdc64b112dcc4d0a52157b6c76
BLAKE2b-256 fe3af4272f4c0409b1170b08bcbb9aaf6947431e2dd70753c3804b0b22e64cad

See more details on using hashes here.

Supported by

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