07 Integration
09 Feb 2016Numerical integration is based on the Riemann definition of an integral
In the simplest algorithm, the integral can be approximated by the finite sum over rectangles of width and height corresponding to the value of the function.
More sophisticated algorithms are then variations on this theme (with the exception of Monte Carlo integration, which randomly samples the integrand and which is the preferred technique for higher-dimensional integrals).
Instead of writing our own integration algorithms we typically used tried and tested and highly optimized code in libraries (or modules as they are called in Python) such as scipy.integrate, which is part of SciPy.
Class Material
You can follow the lecture in the slides 07_integration.ipynb.
Additional resources
- Computational Physics: Ch 5.7 – 5.22
- scipy.integrate for high performance integration algorithms for Python