Skip to main content

A Python library of numerical methods for root finding, interpolation, integration, ODEs, and linear systems

Project description

PySolverKit

Tests Python

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 algebraVector and Matrix with arithmetic operations, and LinearSystem with Gaussian elimination and Gauss-Jacobi/Seidel iterative solvers
  • 2D FEMFEM2D for 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:

  1. Fork the repository and create a feature branch.
  2. Add or update tests in tests/tests.py for any new behaviour.
  3. Ensure all tests pass: python3 -m unittest discover -s tests -v
  4. Open a pull request with a clear description of the change.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysolverkit-0.1.1.tar.gz (31.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pysolverkit-0.1.1-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

Details for the file pysolverkit-0.1.1.tar.gz.

File metadata

  • Download URL: pysolverkit-0.1.1.tar.gz
  • Upload date:
  • Size: 31.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pysolverkit-0.1.1.tar.gz
Algorithm Hash digest
SHA256 94b7d7beb895868573ddfc132a9fb39636825e6ef242db143d844dd35dccfce0
MD5 cb52f99a01fc6c5aeb12ea35353464ea
BLAKE2b-256 8655f55a43e2e2950d7e9021fa3c38f7fa166f4f8c31d09df37c33f7de1390c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysolverkit-0.1.1.tar.gz:

Publisher: python-publish.yml on mrigankpawagi/PySolverKit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pysolverkit-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pysolverkit-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pysolverkit-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e52158932ee24a9acfa5842a74e84f753534057bbd9b6f7c502b7c87e7c3b5f7
MD5 a29553954a97443649796cbfaad0da4a
BLAKE2b-256 c4be79da52231161784b7bdff549e896df6de0cc768a4d8d69c38201504e0565

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysolverkit-0.1.1-py3-none-any.whl:

Publisher: python-publish.yml on mrigankpawagi/PySolverKit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page