A lightweight Python library of numerical methods built on NumPy.
- Python >= 3.9
- NumPy >= 1.20
pip install -e .from numal.nonlinear import bisection
from numal.integration import simpsons_13
root = bisection(lambda x: x**3 - x - 2, 1, 2)
area = simpsons_13(lambda x: 1 / (1 + x**2), 0, 1, 10)| Module | Methods |
|---|---|
numal.nonlinear |
bisection, secant, Newton-Raphson, Newton-Raphson for systems |
numal.linear |
Gauss-Jordan, Gaussian elimination with partial pivoting, Gauss-Seidel, power method |
numal.interpolation |
Newton forward, Lagrange, least squares (linear / exponential / polynomial), natural cubic spline |
numal.integration |
trapezoidal, Simpson's 1/3, Simpson's 3/8, Boole's, Weddle's, Gauss-Legendre |
numal.ode |
RK4 (first order), RK4 (systems / second order), shooting method, finite difference BVP |
numal.pde |
Laplace (Gauss-Seidel), Poisson (Gauss-Seidel), heat equation (Bendre-Schmidt, Crank-Nicolson) |
python -m pytest tests/