A fully functional Python package implementing core numerical methods for engineering and applied mathematics. Designed for usability and educational clarity.
Install via pip:
pip install numeth
Here's a simple example using the Newton-Raphson method to find the square root of 2:
from numeth import newton_raphson
def f(x):
return x**2 - 2
def df(x):
return 2 * x
root, iterations, converged = newton_raphson(f, df, x0=1.0, tol=1e-6, max_iter=100)
print(f"Root: {root}, Iterations: {iterations}, Converged: {converged}")
# Output: Root: 1.414213562373095, Iterations: 4, Converged: True- Trapezoidal Rule (single and composite)
- Simpson’s 1/3 Rule (single and composite)
- Simpson’s 3/8 Rule
- Gaussian Quadrature (2-point and 3-point)
- Forward difference (first derivative)
- Backward difference (first derivative)
- Central difference (first derivative)
- Central difference (second derivative)
- Richardson extrapolation (first derivative)
- Bisection Method
- Newton-Raphson Method
- Secant Method
- False Position Method
- Linear Interpolation
- Lagrange Interpolation
- Newton’s Divided Difference Interpolation
- Gauss Elimination with partial pivoting
- LU Decomposition (Doolittle’s method)
- Jacobi Iterative Method
- Gauss-Seidel Iterative Method
- Golden Section Search (minimization)
- Newton’s Method for Optimization (1D)
Contributions are welcome! Please submit pull requests or open issues on the GitHub repository.
This project is licensed under the MIT License - see the LICENSE file for details.
