A Python library of numerical methods for root finding, interpolation, integration, ODEs, and linear systems
Project description
PySolverKit
A compact Python library that brings classical numerical methods to life — root finding, interpolation, differentiation, integration, ODE solvers, linear systems, and 2D FEM for Poisson problems.
Features
- Function arithmetic — add, subtract, multiply, and compose built-in function types (
Polynomial,Sin,Cos,Tan,Exponent,Log) with plain Python operators - Root finding — bisection, Newton-Raphson, secant, Regula Falsi, and modified Newton methods
- Interpolation — Lagrange and Newton divided-difference forms (forward/backward difference tables included)
- Differentiation — forward, backward, and central finite-difference schemes; set an exact derivative for Newton-type solvers
- Integration — rectangular, midpoint, trapezoidal, Simpson's, and Gauss-Legendre quadrature
- ODE solvers — Euler, Runge-Kutta (orders 1–4), Taylor series, trapezoidal, Adams-Bashforth/Moulton, and predictor-corrector methods for first-order IVPs; shooting and finite-difference methods for second-order BVPs
- Linear algebra —
VectorandMatrixwith arithmetic operations, andLinearSystemwith Gaussian elimination and Gauss-Jacobi/Seidel iterative solvers - 2D FEM —
FEM2Dfor Poisson equations on rectangular domains with Dirichlet boundary conditions
Quick start
import math
from pysolverkit import Polynomial, Sin, RootFindingMethod, IntegrationMethod
# Root finding
f = Polynomial(-6, 14, -7, 1) # x³ − 7x² + 14x − 6
root = f.root(RootFindingMethod.BISECTION, a=0, b=1, TOLERANCE=1e-6)
# Integration
g = Sin(Polynomial(0, 1)) # sin(x)
area = g.integrate(0, math.pi, method=IntegrationMethod.SIMPSON, n=100)
Documentation
Full API reference, detailed usage examples, and a method selector reference are in docs/README.md.
Running tests
python3 -m unittest discover -s tests -v
Contributing
Contributions are welcome! To get started:
- Fork the repository and create a feature branch.
- Add or update tests in
tests/tests.pyfor any new behaviour. - Ensure all tests pass:
python3 -m unittest discover -s tests -v - Open a pull request with a clear description of the change.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pysolverkit-0.1.0.tar.gz.
File metadata
- Download URL: pysolverkit-0.1.0.tar.gz
- Upload date:
- Size: 29.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9d0fbbe95314c95653a270ed32e30a0c913effa3f7ea6b1d56196eb4be5fe12
|
|
| MD5 |
c7d31e5442336d1fc4965abf766dc9c4
|
|
| BLAKE2b-256 |
72bbbb3de4ed9967dfd7098f6dd6cb7fd7942548d2ad1edd83acedfe70b550d8
|
File details
Details for the file pysolverkit-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pysolverkit-0.1.0-py3-none-any.whl
- Upload date:
- Size: 21.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51717c485f23816d0189140b62d93f7146a0371cb9067347cb9c231f426ec9ce
|
|
| MD5 |
43065ddc10f45faeb7fe13504098d081
|
|
| BLAKE2b-256 |
9255ff9eb362920539abf4d7cd881d1e9134539fd27c81ef649c1ec8dbe83a2a
|