You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A comprehensive collection of 20 Python programs implementing fundamental numerical methods, designed as a single, self-contained repository for students, engineers, and researchers.
Shows error estimates comparing to exact solutions (where applicable)
Has consistent formatted output via the shared utils.py
Requirements
Core (zero dependencies — Python 3.7+)
All 20 programs use only the Python standard library (math, sys). No installation is needed.
Optional (for tests and plots)
pip install -r requirements.txt
Package
Purpose
numpy
Optional — used in test suite for verification
matplotlib
Optional — used in test suite for comparison plots
pytest
Optional — alternative test runner
Customisation
To implement your own function, simply edit the f() function at the top of any source file. For example, in src/01_bisection.py:
deff(x):
# Change this to your own functionreturnmath.cos(x) -x# root near 0.7391
All root-finding, ODE, integration, and differentiation programs follow this pattern — the target function is defined at the top and clearly labelled.
Comparison with the C++ Version
A companion C++ implementation is available with identical algorithms, method-by-method, for performance-critical applications or CUDA/OpenMP parallelisation.
License
This project is licensed under the MIT License. See LICENSE for details. Free to use, modify, and distribute.