A Python project to compute integrals:
- symbolically with SymPy
- numerically through Riemann sums
The project aims to be educational, showing how numerical integration works through animations like the one at the beginning. There are more animations in the images folder. Yes, you can do such calculations with SciPy but without the nice animations :-)
- clone the repo, not a package yet :-(
- create a virtual environment with Python 3.8+
- activate the virtual environment
- install dependencies
- run the scripts
git clone https://github.com/chicolucio/integrals
cd integrals
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python animation.py
python integral.py
python antiderivatives.py
animation.py
shows how more Riemann rectangles make the approximation better.
integral.py
has examples of how to use the other methods. Both files have
more examples that can be uncommented in the code as instructed in them.
antiderivatives.py
just plots a family of functions that are antiderivatives
of 2x.
Tests can be run in the top-level directory with the command pytest -v tests/
.
All contributions are welcome.
Issues
Feel free to submit issues regarding:
- recommendations
- more animations or examples
- enhancement requests and new useful features
- code bugs
There are some open issues waiting for your help, see here.
Pull requests
- before starting to work on your pull request, please submit an issue first
- fork the repo
- clone the project to your own machine
- commit changes to your own branch
- push your work back up to your fork
- submit a pull request so that your changes can be reviewed
MIT, see LICENSE
If you use this project in a scientific publication or in classes, please consider citing as
F. L. S. Bustamante, Integrals, 2022 - Available at: https://github.com/chicolucio/integrals